Populate the Identity service database

Bug #1612409 reported by Ben on 2016-08-11
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openstack-manuals
Undecided
Unassigned

Bug Description

Hello
I'm trying to install OpenStack on Ubuntu 16.04 LTS.
When I try to populate the identity service database by running the command:
su -s /bin/sh -c "keystone-manage db_sync" keystone

I would get an SQL connection error as following :
SQL connection failed. 10 attempts left. 2016-08-10 11:27:41.023 20906 WARNING oslo_db.sqlalchemy.engines [-] SQL connection failed. 9 attempts left. 2016-08-10 11:27:51.035 20906 WARNING oslo_db.sqlalchemy.engines [-] SQL connection failed. 8 attempts left. 2016-08-10 11:28:01.043 20906 WARNING oslo_db.sqlalchemy.engines [-] SQL connection failed. 7 attempts left. 2016-08-10 11:28:11.052 20906 WARNING oslo_db.sqlalchemy.engines [-] SQL connection failed. 6 attempts left. 2016-08-10 11:28:21.064 20906 WARNING oslo_db.sqlalchemy.engines [-] SQL connection failed. 5 attempts left. 2016-08-10 11:28:31.076 20906 WARNING oslo_db.sqlalchemy.engines [-] SQL connection failed. 4 attempts left. 2016-08-10 11:28:41.085 20906 WARNING oslo_db.sqlalchemy.engines [-] SQL connection failed. 3 attempts left. 2016-08-10 11:28:51.088 20906 WARNING oslo_db.sqlalchemy.engines [-] SQL connection failed. 2 attempts left. 2016-08-10 11:29:01.099 20906 WARNING oslo_db.sqlalchemy.engines [-] SQL connection failed. 1 attempts left. 2016-08-10 11:29:11.101 20906 CRITICAL keystone [-] DBConnectionError: (pymysql.err.OperationalError) (2003, "Can't connect to MySQL server on 'controller' ([Errno -2] Name or service not known)") 2016-08-10 11:29:11.101 20906 ERROR keystone Traceback (most recent call last): 2016-08-10 11:29:11.101 20906 ERROR keystone File "/usr/bin/keystone-manage", line 10, in <module> 2016-08-10 11:29:11.101 20906 ERROR keystone sys.exit(main()) 2016-08-10 11:29:11.101 20906 ERROR keystone File "/usr/lib/python2.7/dist-packages/keystone/cmd/manage.py", line 47, in main 2016-08-10 11:29:11.101 20906 ERROR keystone cli.main(argv=sys.argv, config_files=config_files) 2016-08-10 11:29:11.101 20906 ERROR keystone File "/usr/lib/python2.7/dist-packages/keystone/cmd/cli.py", line 992, in main 2016-08-10 11:29:11.101 20906 ERROR keystone CONF.command.cmd_class.main() 2016-08-10 11:29:11.101 20906 ERROR keystone File "/usr/lib/python2.7/dist-packages/keystone/cmd/cli.py", line 371, in main 2016-08-10 11:29:11.101 20906 ERROR keystone migration_helpers.sync_database_to_version(extension, version) 2016-08-10 11:29:11.101 20906 ERROR keystone File "/usr/lib/python2.7/dist-packages/keystone/common/sql/migration_helpers.py", line 210, in sync_database_to_version 2016-08-10 11:29:11.101 20906 ERROR keystone _sync_common_repo(version) 2016-08-10 11:29:11.101 20906 ERROR keystone File "/usr/lib/python2.7/dist-packages/keystone/common/sql/migration_helpers.py", line 132, in _sync_common_repo 2016-08-10 11:29:11.101 20906 ERROR keystone with sql.session_for_write() as session: 2016-08-10 11:29:11.101 20906 ERROR keystone File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__ 2016-08-10 11:29:11.101 20906 ERROR keystone return self.gen.next() 2016-08-10 11:29:11.101 20906 ERROR keystone File "/usr/lib/python2.7/dist-packages/oslo_db/sqlalchemy/enginefacade.py", line 759, in _transaction_scope 2016-08-10 11:29:11.101 20906 ERROR keystone allow_async=self._allow_async) as resource: 2016-08-10 11:29:11.101 20906 ERROR keystone File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__ 2016-08-10 11:29:11.101 20906 ERROR keystone return self.gen.next() 2016-08-10 11:29:11.101 20906 ERROR keystone File "/usr/lib/python2.7/dist-packages/oslo_db/sqlalchemy/enginefacade.py", line 491, in _session 2016-08-10 11:29:11.101 20906 ERROR keystone bind=self.connection, mode=self.mode) 2016-08-10 11:29:11.101 20906 ERROR keystone File "/usr/lib/python2.7/dist-packages/oslo_db/sqlalchemy/enginefacade.py", line 272, in _create_session 2016-08-10 11:29:11.101 20906 ERROR keystone self._start() 2016-08-10 11:29:11.101 20906 ERROR keystone File "/usr/lib/python2.7/dist-packages/oslo_db/sqlalchemy/enginefacade.py", line 338, in _start 2016-08-10 11:29:11.101 20906 ERROR keystone engine_args, maker_args) 2016-08-10 11:29:11.101 20906 ERROR keystone File "/usr/lib/python2.7/dist-packages/oslo_db/sqlalchemy/enginefacade.py", line 362, in _setup_for_connection 2016-08-10 11:29:11.101 20906 ERROR keystone sql_connection=sql_connection, **engine_kwargs) 2016-08-10 11:29:11.101 20906 ERROR keystone File "/usr/lib/python2.7/dist-packages/oslo_db/sqlalchemy/engines.py", line 152, in create_engine 2016-08-10 11:29:11.101 20906 ERROR keystone test_conn = _test_connection(engine, max_retries, retry_interval) 2016-08-10 11:29:11.101 20906 ERROR keystone File "/usr/lib/python2.7/dist-packages/oslo_db/sqlalchemy/engines.py", line 334, in _test_connection 2016-08-10 11:29:11.101 20906 ERROR keystone six.reraise(type(de_ref), de_ref) 2016-08-10 11:29:11.101 20906 ERROR keystone File "<string>", line 2, in reraise 2016-08-10 11:29:11.101 20906 ERROR keystone DBConnectionError: (pymysql.err.OperationalError) (2003, "Can't connect to MySQL server on 'controller' ([Errno -2] Name or service not known)") 2016-08-10 11:29:11.101 20906 ERROR keystone

Any thoughts?

This is from the Install and Configure page of the Identity service page.
-----------------------------------
Release: 0.1 on 2016-08-10 03:50
SHA: c74bdeef7a724c83caad2ebb2ca3828130eea41a
Source: http://git.openstack.org/cgit/openstack/openstack-manuals/tree/doc/install-guide/source/keystone-install.rst
URL: http://docs.openstack.org/mitaka/install-guide-ubuntu/keystone-install.html

Ben (benbonne) on 2016-08-11
description: updated
Matt Kassawara (ionosphere80) wrote :

The installation guide only supports Ubuntu 14.04. However, it seems like the database service either isn't running or is blocked by a firewall.

Matt Kassawara (ionosphere80) wrote :

For additional support, please use one of the support channels such as IRC, mailing lists, or ask.openstack.org.

Changed in openstack-manuals:
status: New → Invalid
cargonza (cargonza) wrote :

I encounter the same issue with the 16.04 Newton documentation: http://docs.openstack.org/newton/install-guide-ubuntu/keystone-install.html

No firewall and database is running.

Matt Kassawara (ionosphere80) wrote :

Is the database listening on the IP address of the management interface?

cargonza (cargonza) wrote :

just resolved it by editing the /etc/hosts file and commented out

#127.0.1.1 controller

and added my management ip address.

This information is found by digging into more of the host networking and getting to the controller networking (http://docs.openstack.org/newton/install-guide-ubuntu/environment-networking-controller.html) section. The warning box should be added to bullet #3 of the installation configuration section of http://docs.openstack.org/newton/install-guide-ubuntu/keystone-install.html.

From a user experience point of view, I didn't get into the controller networking page of the host networking page until after I "googled" a bunch of other documents to get a solution that never worked. Its probably satisfactory to say that the "warning box" should be repeated again in this particular section.

Lastly, this bug also did not provide the correct solution besides "ask.openstack.org".

Just my 2 bits to make the experience better. At least, this bug has some notes on how to simply fix it.

Thanks for the idea bit though Matt! Appreciate it...

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers