"ImportError : No module named config" for "glance-manage db_syn"

Bug #1287678 reported by Bo ZHANG on 2014-03-04
22
This bug affects 5 people
Affects Status Importance Assigned to Milestone
devstack
Undecided
Unassigned

Bug Description

I'm a new one to use devstack, and download devstack directly by "git clone https://github.com/openstack-dev/devstack.git".
But when I execute stack.sh, there is always an error:

+ /usr/local/bin/glance-manage db_sync
Traceback (most recent call last):
      File "/usr/local/bin/glance-manage", line 6, in <module>
            from glance.cmd.manage import main
      File "/opt/stack/glance/glance/cmd/manage.py", line 41, in <module>
            from oslo.config import cfg

From this report, I check /opt/stack/oslo.config.
I found there isn't file named cfg! But just "setup.cfg".

I'm not sure it's a bug or not.
I hope it will help you, and wait for your reply.

Mike BRIGHT (k5-openstack) wrote :

I'm seeing an equivalent problem running DevStack (full disclosure: vagrant-dockstack) where I get the same message with "keystone-manage db_sync".

It "may" help you to use this workaround mentioned here: https://bugs.launchpad.net/nova/+bug/1271097

    sudo ln -s /opt/stack/oslo.config/oslo/config/ /usr/local/lib/python2.7/dist-packages/oslo/config

I say "may" help you, as in my case I then hit another problem with the nova client not having access.
(as here: https://answers.launchpad.net/horizon/+question/245082)

YMMV.

Maybe this helps you.

Bo ZHANG (bo-zhang) wrote :

Thanks mike,

I think this is a bug who need much time to find solution.
So I change to use devstack-stable-havanna.

There is no problem.
But I meet a new problem: install savanna.

I will submit a new bug in another question, Thanks.

Song Li (lisong-cruise) on 2014-03-14
Changed in glance:
assignee: nobody → Song Li (lisong-cruise)
assignee: Song Li (lisong-cruise) → nobody
Song Li (lisong-cruise) wrote :

I have met the problem too, I think it was a devstack issue.

affects: glance → devstack
Changed in devstack:
assignee: nobody → Song Li (lisong-cruise)
Song Li (lisong-cruise) on 2014-03-14
Changed in devstack:
status: New → In Progress
Song Li (lisong-cruise) on 2014-03-14
Changed in devstack:
assignee: Song Li (lisong-cruise) → nobody
Doug Hellmann (doug-hellmann) wrote :

This problem is usually caused by having 1 oslo library installed by devstack from source and another copy installed as a system package or with pip using a python package. Check your python import path for this situation.

sumesh (ssumesh) wrote :

When I executed the following command during the glance installation phase

su -s /bin/sh -c "glance-manage db_sync" glance

 I am getting the error

Traceback (most recent call last):
  File "/usr/bin/glance-manage", line 6, in <module>
    from glance.cmd.manage import main
  File "/usr/lib/python2.7/dist-packages/glance/cmd/manage.py", line 41, in <mo$
    from oslo.config import cfg
ImportError: No module named config

Please give me some soluation for this error
I am using ubuntu 14.04 lts server with openstack icehouse version and My python version is 2.7.6

Summer (chengkun) wrote :

This has been solved? I encountered the same problem when i install devstack.

Hi,

 My problem is caused by the old version of oslo.config .

 So I only updated it and succeeded to solve it. You can try the bellow command.

       pip install oslo.config --upgrade

 Hope this will help you. :)

 Bo ZHANG

----- Mail original -----
> De: "yechengkun" <email address hidden>
> À: "bo zhang" <email address hidden>
> Envoyé: Samedi 25 Juillet 2015 10:41:24
> Objet: [Bug 1287678] Re: "ImportError : No module named config" for "glance-manage db_syn"
>
> This has been solved? I encountered the same problem when i install
> devstack.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1287678
>
> Title:
> "ImportError : No module named config" for "glance-manage db_syn"
>
> Status in devstack:
> In Progress
>
> Bug description:
> I'm a new one to use devstack, and download devstack directly by "git clone
> https://github.com/openstack-dev/devstack.git".
> But when I execute stack.sh, there is always an error:
>
>
> + /usr/local/bin/glance-manage db_sync
> Traceback (most recent call last):
> File "/usr/local/bin/glance-manage", line 6, in <module>
> from glance.cmd.manage import main
> File "/opt/stack/glance/glance/cmd/manage.py", line 41, in <module>
> from oslo.config import cfg
>
>
> From this report, I check /opt/stack/oslo.config.
> I found there isn't file named cfg! But just "setup.cfg".
>
> I'm not sure it's a bug or not.
> I hope it will help you, and wait for your reply.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/devstack/+bug/1287678/+subscriptions
>

Sean Dague (sdague) wrote :

This devstack bug was last updated over 180 days ago, as devstack
is a fast moving project and we'd like to get the tracker down to
currently actionable bugs, this is getting marked as Invalid. If the
issue still exists, please feel free to reopen it.

Changed in devstack:
status: In Progress → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers