An KeyError: 'connection' has occurred when I executed the command su -s /bin/sh -c "glance-manage db_sync" glance

Bug #1695275 reported by CHEOLMIN KIM
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Glance
Invalid
Undecided
Unassigned

Bug Description

Hello.

I'm following the Installation Guide of Ocata from https://docs.openstack.org/project-install-guide/ocata/ubuntu-services.html

The release version of the guide (pdf) is 15.0.0

I'm using Ubuntu 16.04.2 x64

At the Image Service Section, the guide said that invoke
 su -s /bin/sh -c "glance-manage db_sync" glance

After invoking the command, an error has occurred as I attached (error.png).

I entered options in conf files (glance-api.conf, glance-registry.conf) as the guide said.

I checked glance database, glance user, privileges of glance database, connection to glance database as the user glance.

Please reply this issue.

Thanks.

Revision history for this message
CHEOLMIN KIM (vanilet) wrote :
Revision history for this message
CHEOLMIN KIM (vanilet) wrote :

At the image service section, the guide let me create user glance, endpoints, and add admin role to user glance.

The attachment shows the result.

Revision history for this message
CHEOLMIN KIM (vanilet) wrote :

The guide also lets me create database named glance. Also, create a database user glance with all privileges to glance database.

The attachment shows the result.

summary: - An KeyError: 'connection' occurred when I executed the command su -s
- /bin/sh -c "glance-manage db_sync" glance
+ An KeyError: 'connection' has occurred when I executed the command su
+ -s /bin/sh -c "glance-manage db_sync" glance
CHEOLMIN KIM (vanilet)
description: updated
Revision history for this message
CHEOLMIN KIM (vanilet) wrote :

from the attachment error.png, There last error said that an error File "/usr/lib/python2.7/dist-packages/oslo_db/sqlalchemy/enginefacade.py", line 402, in _start
 url_args['connection']
KeyError: 'connection'

So I decided to add a print statement of url_args. I attach the result.

From the result.png, the url_args variable only havs {'slave_connection': None}.

Is there something wrong with my configuration file?

my connection string is connection = mysql+pymysql://glance:1NS6Zt$rw%bF4dj8A3@controller/glance

?field.comment=from the attachment error.png, There last error said that an error File "/usr/lib/python2.7/dist-packages/oslo_db/sqlalchemy/enginefacade.py", line 402, in _start
 url_args['connection']
KeyError: 'connection'

So I had decided to add print statements of url_args. I attach the result.

I have added print statements of the variable url_args to right after url_args = self.url_args_for_conf(conf) statement and right before self._writer_engine, self.writer_mmaker = \self._setup_for_connection(url_args['connection'], engine_args, marker_args) statement which the error was occurred.

From the result.png, the url_args variable only havs {'slave_connection': None} both print statement.

Is there something wrong with my configuration file?

my connection string of glance-registry.conf and glance-api.conf is connection = mysql+pymysql://glance:1NS6Zt$rw%bF4dj8A3@controller/glance

Revision history for this message
CHEOLMIN KIM (vanilet) wrote :

The attachment file source_code.png is to show where I added the print statement for url_args.

The red square means that the statements which i added.

The blue square means that the line which the error occurred.

Revision history for this message
Praveen N (praveenn) wrote :

Hi CHEOLMIN KIM,

Are you stuck at this issue yet?
Please share the configuration files glance-api.conf and glance-registry.conf.

--Thanks

Revision history for this message
CHEOLMIN KIM (vanilet) wrote :
Download full text (5.7 KiB)

Hello. Praveen N.

I had deleted the virtual machine which I tried to configure glance. So I re-tried to configure glance with the same pdf file (currently latest).

This time, another error message have appeared. The configuration process was the same as before.

I attached the error log and configuration files (glance-api.conf, glance-registry.conf).

Because the error is different to this issue, should I close this case and open another one? or keep this issue?

Thanks.

--- Below is the error message. ---
/usr/lib/python2.7/dist-packages/oslo_db/sqlalchemy/enginefacade.py:1241: OsloDBDeprecationWarning: EngineFacade is deprecated; please use oslo_db.sqlalchemy.enginefacade
  expire_on_commit=expire_on_commit, _conf=conf)
2017-08-22 22:50:34.361 30446 CRITICAL glance [-] NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:mysql.pymsql
2017-08-22 22:50:34.361 30446 ERROR glance Traceback (most recent call last):
2017-08-22 22:50:34.361 30446 ERROR glance File "/usr/bin/glance-manage", line 10, in <module>
2017-08-22 22:50:34.361 30446 ERROR glance sys.exit(main())
2017-08-22 22:50:34.361 30446 ERROR glance File "/usr/lib/python2.7/dist-packages/glance/cmd/manage.py", line 447, in main
2017-08-22 22:50:34.361 30446 ERROR glance return CONF.command.action_fn()
2017-08-22 22:50:34.361 30446 ERROR glance File "/usr/lib/python2.7/dist-packages/glance/cmd/manage.py", line 286, in sync
2017-08-22 22:50:34.361 30446 ERROR glance self.command_object.sync(CONF.command.version)
2017-08-22 22:50:34.361 30446 ERROR glance File "/usr/lib/python2.7/dist-packages/glance/cmd/manage.py", line 116, in sync
2017-08-22 22:50:34.361 30446 ERROR glance alembic_migrations.place_database_under_alembic_control()
2017-08-22 22:50:34.361 30446 ERROR glance File "/usr/lib/python2.7/dist-packages/glance/db/sqlalchemy/alembic_migrations/__init__.py", line 73, in place_database_under_alembic_control
2017-08-22 22:50:34.361 30446 ERROR glance a_config = get_alembic_config()
2017-08-22 22:50:34.361 30446 ERROR glance File "/usr/lib/python2.7/dist-packages/glance/db/sqlalchemy/alembic_migrations/__init__.py", line 36, in get_alembic_config
2017-08-22 22:50:34.361 30446 ERROR glance engine = db_api.get_engine()
2017-08-22 22:50:34.361 30446 ERROR glance File "/usr/lib/python2.7/dist-packages/glance/db/sqlalchemy/api.py", line 98, in get_engine
2017-08-22 22:50:34.361 30446 ERROR glance facade = _create_facade_lazily()
2017-08-22 22:50:34.361 30446 ERROR glance File "/usr/lib/python2.7/dist-packages/glance/db/sqlalchemy/api.py", line 88, in _create_facade_lazily
2017-08-22 22:50:34.361 30446 ERROR glance _FACADE = session.EngineFacade.from_config(CONF)
2017-08-22 22:50:34.361 30446 ERROR glance File "/usr/lib/python2.7/dist-packages/oslo_db/sqlalchemy/enginefacade.py", line 1241, in from_config
2017-08-22 22:50:34.361 30446 ERROR glance expire_on_commit=expire_on_commit, _conf=conf)
2017-08-22 22:50:34.361 30446 ERROR glance File "/usr/lib/python2.7/dist-packages/oslo_db/sqlalchemy/enginefacade.py", line 1162, in __init__
2017-08-22 22:50:34.361 30446 ERROR glance slave_connection=slave_connection)
2017-08-22 2...

Read more...

Revision history for this message
Brian Rosmaita (brian-rosmaita) wrote :

This looks like you are having local issues related to your environment. With no activity since August 2017, I assume you figured out what the problem was. If not, feel free to reopen.

affects: python-glanceclient → glance
Changed in glance:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.