Reviewed: https://review.openstack.org/583115 Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=e0546870cd667bc54e41cb3c603d6b176a68b56c Submitter: Zuul Branch: master
commit e0546870cd667bc54e41cb3c603d6b176a68b56c Author: jichenjc <[email protected]> Date: Tue Jul 17 02:22:32 2018 -0400 Enhance doc to guide user to use nova user The document doesn't follow previous pattern to guide use in using nova user to execute command and lead to issue Change-Id: I795706a8f78ab4154bd39ce6259901800b34890e Closes-Bug: 1781573 ** Changed in: nova Status: In Progress => Fix Released -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to OpenStack Compute (nova). https://bugs.launchpad.net/bugs/1781573 Title: Document "Install and configure controller node for Ubuntu in nova" has an incorrect command in section "Install and configure components", step 7 Status in OpenStack Compute (nova): Fix Released Bug description: Description =========== Following the OpenStack installation procedure for a minimal install of Queens on Bionic, one of the "nova-manage" commands is not run as the nova user when attempting to verify the installation, causing an exception traceback and the creation of a spurious sqlite database. In addition, the sample output is missing fields compared to the actual output (see "Suggested fix" below). Steps to reproduce ================== Following the steps in the document "Install and configure controller node for Ubuntu" for nova, when you reach section "Install and configure components" step 7 it says to verify the installation by running "nova-manage cell_v2 list_cells" after configuring nova on the controller. Expected behaviour ================== Output is:: # nova-manage cell_v2 list_cells +-------+--------------------------------------+ | Name | UUID | +-------+--------------------------------------+ | cell1 | 109e1d4b-536a-40d0-83c6-5f121b82b650 | | cell0 | 00000000-0000-0000-0000-000000000000 | +-------+--------------------------------------+ Actual behaviour ================ Output is:: # nova-manage cell_v2 list_cells An error has occurred: Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/nova/cmd/manage.py", line 1644, in main ret = fn(*fn_args, **fn_kwargs) File "/usr/lib/python2.7/dist-packages/nova/cmd/manage.py", line 1367, in list_cells context.get_admin_context()) File "/usr/lib/python2.7/dist-packages/oslo_versionedobjects/base.py", line 184, in wrapper result = fn(cls, context, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/nova/objects/cell_mapping.py", line 137, in get_all db_mappings = cls._get_all_from_db(context) File "/usr/lib/python2.7/dist-packages/oslo_db/sqlalchemy/enginefacade.py", line 986, in wrapper return fn(*args, **kwargs) File "/usr/lib/python2.7/dist-packages/nova/objects/cell_mapping.py", line 133, in _get_all_from_db asc(api_models.CellMapping.id)).all() File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2703, in all return list(self) File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2855, in __iter__ return self._execute_and_instances(context) File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2878, in _execute_and_instances result = conn.execute(querycontext.statement, self._params) File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 945, in execute return meth(self, multiparams, params) File "/usr/lib/python2.7/dist-packages/sqlalchemy/sql/elements.py", line 263, in _execute_on_connection return connection._execute_clauseelement(self, multiparams, params) File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1053, in _execute_clauseelement compiled_sql, distilled_params File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1189, in _execute_context context) File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1398, in _handle_dbapi_exception util.raise_from_cause(newraise, exc_info) File "/usr/lib/python2.7/dist-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause reraise(type(exception), exception, tb=exc_tb, cause=cause) File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1182, in _execute_context context) File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 470, in do_execute cursor.execute(statement, parameters) DBNonExistentTable: (sqlite3.OperationalError) no such table: cell_mappings [SQL: u'SELECT cell_mappings.created_at AS cell_mappings_created_at, cell_mappings.updated_at AS cell_mappings_updated_at, cell_mappings.id AS cell_mappings_id, cell_mappings.uuid AS cell_mappings_uuid, cell_mappings.name AS cell_mappings_name, cell_mappings.transport_url AS cell_mappings_transport_url, cell_mappings.database_connection AS cell_mappings_database_connection \nFROM cell_mappings ORDER BY cell_mappings.id ASC'] In addition, a spurious empty sqlite database is created in /var/lib/nova:: # ls -l /var/lib/nova/*.sqlite -rw------- 1 root root 0 Jul 13 11:27 /var/lib/nova/nova_api.sqlite Suggested fix ============= Amend the command to run as user "nova", as all the previous commands are:: # su -s /bin/sh -c "nova-manage cell_v2 list_cells" nova +-------+--------------------------------------+-----------------------------------------+------------------------------------------------------+ | Name | UUID | Transport URL | Database Connection | +-------+--------------------------------------+-----------------------------------------+------------------------------------------------------+ | cell0 | 00000000-0000-0000-0000-000000000000 | none:/ | mysql+pymysql://nova:****@controller/nova_cell0 | | cell1 | xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx | rabbit://openstack:****@controller | mysql+pymysql://nova:****@controller/nova | +-------+--------------------------------------+-----------------------------------------+------------------------------------------------------+ - [x] This doc is inaccurate in this way: Command in section "Install and configure components" step 7 is incorrect - [ ] This is a doc addition request. - [x] I have a fix to the document that I can paste below including example: input and output. Replace: nova-manage cell_v2 list_cells With: su -s /bin/sh -c "nova-manage cell_v2 list_cells" nova ----------------------------------- Release: 17.0.6.dev47 on 2018-07-08 17:16 SHA: 7ae2dc840a0bccb868122bb4b77e8958a0e842a7 Source: https://git.openstack.org/cgit/openstack/nova/tree/doc/source/install/controller-install-ubuntu.rst URL: https://docs.openstack.org/nova/queens/install/controller-install-ubuntu.html To manage notifications about this bug go to: https://bugs.launchpad.net/nova/+bug/1781573/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : [email protected] Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp

