Comment 6 for bug 1347243

Revision history for this message
Jeff Silverman (jeffsilverm) wrote : Re: [Bug 1347243] Re: nova-manage db sync throws an import error

Here is the sys.path list at the point where the import fails.

(Pdb) b /usr/lib/python2.6/site-packages/migrate/versioning/schema.py:10
Breakpoint 1 at /usr/lib/python2.6/site-packages/migrate/versioning/schema.py:10

(Pdb) c
> /usr/lib/python2.6/site-packages/migrate/versioning/schema.py(10)<module>()
-> from sqlalchemy import exceptions as sa_exceptions
(Pdb) list
  5 import logging
  6
  7 from sqlalchemy import (Table, Column, MetaData, String, Text, Integer,

  8 create_engine)
  9 from sqlalchemy.sql import and_
 10 B-> from sqlalchemy import exceptions as sa_exceptions
 11 from sqlalchemy.sql import bindparam
 12
 13 from migrate.changeset import SQLA_07

 14 from migrate.versioning import exceptions, genmodel, schemadiff
 15 from migrate.versioning.repository import Repository
(Pdb) print sys.path
['/usr/bin', '/usr/lib64/python26.zip', '/usr/lib64/python2.6',
'/usr/lib64/python2.6/plat-linux2', '/usr/lib64/python2.6/lib-tk',
'/usr/lib64/python2.6/lib-old', '/usr/lib64/python2.6/lib-dynload',
'/usr/lib64/python2.6/site-packages',
'/usr/lib64/python2.6/site-packages/PIL',
'/usr/lib64/python2.6/site-packages/gtk-2.0',
'/usr/lib/python2.6/site-packages',
'/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg-info']

(Pdb)

sqlalchemy is installed:

<email address hidden>:~# yum list | fgrep -i sqlal
Repository sl-release-el6 is listed more than once in the configuration
python-sqlalchemy.x86_64 0.8.4-1.el6
@openstack-icehouse
python-sqlalchemy0.7.x86_64 0.7.8-1.el6 @epel-6-x86_64
python-flask-sqlalchemy.noarch 0.16-2.el6 epel-6-x86_64
python-sqlalchemy-debuginfo.x86_64 0.8.4-1.el6 openstack-icehouse
python-sqlalchemy0.8.x86_64 0.8.2-4.el6 epel-6-x86_64
python-zope-sqlalchemy.noarch 0.4-3.el6 centos-6.5-base
<email address hidden>:~#

I think this was the wrong place to file this bug - I am sorry. I
think this bug is redundant with 1347827
<https://bugs.launchpad.net/openstack-manuals/+bug/1347827>.

Jeff

On Wed, Jul 23, 2014 at 9:41 AM, Jeff Silverman <email address hidden>
wrote:

> Dmitry,
>
> We are not using fuel.
>
> Jeff
>
>
>
> On Wed, Jul 23, 2014 at 9:30 AM, Jeff Silverman <email address hidden>
> wrote:
>
>> Dmitry,
>>
>> Thank you for your quick response.
>>
>> <email address hidden>:~# echo $PYTHONPATH
>>
>> <email address hidden>:~# su -s /bin/sh -c "nova-manage
>> db sync" nova
>> Command failed, please check log for more info
>> <email address hidden>:~# echo $PYTHONPATH
>>
>> <email address hidden>:~# tail
>> /var/log/nova/nova-manage.log
>> 2014-07-22 15:18:35.279 18396 CRITICAL nova [-] ImportError: cannot
>> import name exceptions
>>
>> 2014-07-22 19:58:15.653 21403 CRITICAL nova [-] ImportError: cannot
>> import name exceptions
>>
>> 2014-07-23 09:29:04.627 28760 CRITICAL nova [-] ImportError: cannot
>> import name exceptions
>>
>> <email address hidden>:~#
>>
>> How do I tell if I am using fuel? How do I diagnose which sqlalchemy I
>> am using?
>>
>>
>> Many thanks,
>>
>>
>> Jeff Silverman
>>
>>
>>
>>
>> On Wed, Jul 23, 2014 at 2:30 AM, Dmitry Ilyin <<email address hidden>
>> > wrote:
>>
>>> Strage. I does'n throw this error on my deployments. Both Ubuntu and
>>> Centos...
>>>
>>> Oh, wait! You aren't using Fuel, aren't ye? And you can't import
>>> sqlalchemy but it's present.
>>> Hmm... looks linke OpenStack components use their own sqlalchemy
>>> componets insead of system-wide and perhaps they mess with python's include
>>> path to do so.
>>>
>>> --
>>> You received this bug notification because you are subscribed to the bug
>>> report.
>>> https://bugs.launchpad.net/bugs/1347243
>>>
>>> Title:
>>> nova-manage db sync throws an import error
>>>
>>> Status in Fuel: OpenStack installer that works:
>>> New
>>>
>>> Bug description:
>>> I am following the instructions in
>>>
>>> When I run nova-manage db sync, I get the following:
>>>
>>> <email address hidden>:~# su -s /bin/sh -c
>>> "nova-manage db sync" nova
>>> Command failed, please check log for more info
>>> <email address hidden>:~#
>>> <email address hidden>:~# tail
>>> /var/log/nova/nova-manage.log
>>> 2014-07-22 15:18:35.279 18396 CRITICAL nova [-] ImportError: cannot
>>> import name exceptions
>>>
>>> <email address hidden>:~#
>>>
>>>
>>> I did some checking. nova-manage is a python program, so I ran it
>>> with the debugger pdb. I find:
>>>
>>> (Pdb) c
>>> Command failed, please check log for more info
>>> Traceback (most recent call last):
>>> File "/usr/lib64/python2.6/pdb.py", line 1296, in main
>>> pdb._runscript(mainpyfile)
>>> File "/usr/lib64/python2.6/pdb.py", line 1215, in _runscript
>>> self.run(statement)
>>> File "/usr/lib64/python2.6/bdb.py", line 372, in run
>>> exec cmd in globals, locals
>>> File "<string>", line 1, in <module>
>>> File "/usr/bin/nova-manage", line 10, in <module>
>>> sys.exit(main())
>>> File "/usr/lib/python2.6/site-packages/nova/cmd/manage.py", line
>>> 1374, in main
>>> ret = fn(*fn_args, **fn_kwargs)
>>> File "/usr/lib/python2.6/site-packages/nova/cmd/manage.py", line
>>> 883, in sync
>>> return migration.db_sync(version)
>>> File "/usr/lib/python2.6/site-packages/nova/db/migration.py", line
>>> 29, in db_sync
>>> return IMPL.db_sync(version=version)
>>> File "/usr/lib/python2.6/site-packages/nova/utils.py", line 427, in
>>> __getattr__
>>> backend = self.__get_backend()
>>> File "/usr/lib/python2.6/site-packages/nova/utils.py", line 423, in
>>> __get_backend
>>> self.__backend = __import__(name, None, None, fromlist)
>>> File
>>> "/usr/lib/python2.6/site-packages/nova/db/sqlalchemy/migration.py", line
>>> 20, in <module>
>>> from migrate.versioning import api as versioning_api
>>> File "/usr/lib/python2.6/site-packages/migrate/versioning/api.py",
>>> line 32, in <module>
>>> from migrate.versioning import (exceptions, repository, schema,
>>> version,
>>> File
>>> "/usr/lib/python2.6/site-packages/migrate/versioning/schema.py", line 10,
>>> in <module>
>>> from sqlalchemy import exceptions as sa_exceptions
>>> ImportError: cannot import name exceptions
>>> Uncaught exception. Entering post mortem debugging
>>> Running 'cont' or 'step' will restart the program
>>> >
>>> /usr/lib/python2.6/site-packages/migrate/versioning/schema.py(10)<module>()
>>> -> from sqlalchemy import exceptions as sa_exceptions
>>> (Pdb)
>>>
>>>
>>> <email address hidden>:~# python /usr/bin/nova-manage
>>> --version
>>> 2014.1.1
>>> <email address hidden>:~#
>>>
>>>
>>> What other information would be helpful in pursuing this problem?
>>>
>>> Thank you
>>>
>>>
>>> Jeff Silverman
>>>
>>> To manage notifications about this bug go to:
>>> https://bugs.launchpad.net/fuel/+bug/1347243/+subscriptions
>>>
>>
>>
>>
>> --
>> Jeff Silverman, linux sysadmin
>> nine two four twentieth avenue east
>> Seattle, WA, nine eight one one two -3507
>> (2O6) 329-1O94
>> <email address hidden> (note the zero!)
>> http://www.commercialventvac.co
>> <http://www.commercialventvac.com/~jeffs/>m
>> Read my book, "Failure is Not an Option: How to build reliable computer
>> systems from unreliable parts using Open Source software"
>> http://www.commercialventvac.com/finao/index.html"
>>
>
>
>
> --
> Jeff Silverman, linux sysadmin
> nine two four twentieth avenue east
> Seattle, WA, nine eight one one two -3507
> (2O6) 329-1O94
> <email address hidden> (note the zero!)
> http://www.commercialventvac.co <http://www.commercialventvac.com/~jeffs/>
> m
> Read my book, "Failure is Not an Option: How to build reliable computer
> systems from unreliable parts using Open Source software"
> http://www.commercialventvac.com/finao/index.html"
>

--
Jeff Silverman, linux sysadmin
nine two four twentieth avenue east
Seattle, WA, nine eight one one two -3507
(2O6) 329-1O94
<email address hidden> (note the zero!)
http://www.commercialventvac.co <http://www.commercialventvac.com/~jeffs/>m
Read my book, "Failure is Not an Option: How to build reliable computer
systems from unreliable parts using Open Source software"
http://www.commercialventvac.com/finao/index.html"