glance-manage db_sync problem

asked 2014-07-03 12:27:22 -0600

Daniel Ilie gravatar image

updated 2014-07-03 22:57:43 -0600

Hi guys,

I am trying to create the database tables for the Image Service. When I run the following command su -s /bin/sh -c "glance-manage db_sync" glance I receive:

Traceback (most recent call last):

  File "/usr/local/bin/glance-manage", line 6, in <module>
        from glance.cmd.manage import main
  File "/usr/local/lib/python2.7/dist-packages/glance/cmd/", line 41, in <module>
        from oslo.config import cfg
  ImportError: No module named config
edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted

answered 2014-07-04 01:03:03 -0600

Hi Daniel,

For some reason you're missing the oslo.config package in your environment, hence the ImportError you're seeing. How did you install Glance? If you used your distro's package manager you should try to find the python-oslo-config package. Based on the path, there's a change you may have installed using the git repo. If this is the case, make sure you run pip install -r requirements.txt in the Glance repo folder.

edit flag offensive delete link more


Thanks for reply,

First time I tried to install with apt-get install glance. Well, there was a problem with that package because at the same command the output was "CRITICAL glance AttributeError: 'NoneType' object has no attribute 'drivername'

Daniel Ilie gravatar imageDaniel Ilie ( 2014-07-04 07:29:38 -0600 )edit

I searched answers and I found it was a bug and a new version was deployed. I tried apt-get update but in the repository there wasn't any change. So, finally, I had to install from sources(with python install). This is the link from where I downloaded the package

Daniel Ilie gravatar imageDaniel Ilie ( 2014-07-04 07:30:36 -0600 )edit

I ran pip install -r requirements.txt as you said but nothing has changed.

Sorry for any misunderstanding I'm pretty inexperienced in this.

Daniel Ilie gravatar imageDaniel Ilie ( 2014-07-04 07:30:58 -0600 )edit

@daniel, If you're using a distro package, I'm afraid using pip is not the right thing to do. It sounds like something is wrong with the packages you've installed. Is the oslo-config package installed? (pls, make sure you mention thse things next time ;) )

flaper87 gravatar imageflaper87 ( 2014-07-16 02:20:39 -0600 )edit

answered 2014-09-16 10:26:09 -0600

jsubirat gravatar image

updated 2014-09-16 10:55:57 -0600

The oslo.config version that came with my Ubuntu was 1.2.1, which had this same error. Check it with:

root@controller:~# pip search oslo.config oslo.config - Oslo Configuration API INSTALLED: 1.2.1 LATEST:

So, what I did was to update it with:

pip --upgrade oslo.config

Then, check:

root@controller:~# pip search oslo.config oslo.config - Oslo Configuration API INSTALLED: 1.3.0 LATEST:

And with this, the command finally succeeded in its execution. Hope this helps!

UPDATE-WARNING: although what I posted helps executing the glance-manage db_sync command, from then on I haven't been able to anything with glance, as I always get the same error:

root@controller:~# glance image-list 'Discover' object has no attribute 'url_for'

edit flag offensive delete link more

answered 2014-07-03 15:02:38 -0600

foexle gravatar image

Hi Daniel,

glance-manage doesn't find your config file. Try

su -s /bin/sh -c "glance-manage --config-file /etc/glance/glance.conf db_sync" glance

or your config path.

In addition you can add again --config-file if you're missing the glance-api-paste.ini, whatever.

Cheers Heiko

edit flag offensive delete link more



Well, I tried either glance-api.conf and glance-api-paste.ini as --config-file option but the output is the same. Glance user has permissions on these files.

Also using glance-manager help or any other glance-manager command the result is the same.

Daniel Ilie gravatar imageDaniel Ilie ( 2014-07-03 16:19:32 -0600 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2014-07-03 12:27:22 -0600

Seen: 1,300 times

Last updated: Sep 16 '14