Ask Your Question
0

glance-manage db_sync problem

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

Daniel Ilie gravatar image

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

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/manage.py", 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
0

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

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

Comments

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 -0500 )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 https://launchpad.net/ubuntu/+source/glance/1:2014.1~rc2-0ubuntu1

Daniel Ilie gravatar imageDaniel Ilie ( 2014-07-04 07:30:36 -0500 )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 -0500 )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 -0500 )edit
0

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

jsubirat gravatar image

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

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: 1.4.0.0a5

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: 1.4.0.0a5

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
0

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

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

Comments

Thanks,

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 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

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

Seen: 1,157 times

Last updated: Sep 16 '14