Install and configure controller node in OpenStack Installation Guide import error at /usr/lib/python2.6/site-packages/migrate/versioning/schema.py", line 10

Bug #1347827 reported by Jeff Silverman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openstack-manuals
Invalid
Undecided
Unassigned

Bug Description

-----------------------------------
Built: 2014-07-23T07:06:38 00:00
git SHA: 7352529ae6cd61366c2295601eb795ba3444acb6
URL: http://docs.openstack.org/trunk/install-guide/install/apt/content/nova-controller-install.html
source File: file:/home/jenkins/workspace/openstack-manuals-tox-doc-publishdocs/doc/install-guide/section_nova-controller-install.xml
xml:id: nova-controller-install

I am running under Centos 6.5

When I run su -s /bin/sh -c "nova-manage db sync" nova

I get an exception at
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

The complete stack trace in the debugger is

(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)

Here is the PYTHONPATH at the point of the failure
(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>:~#

This was previously reported on <email address hidden> which I now think was the wrong place to put it.

Jeff

summary: Install and configure controller node in OpenStack Installation Guide
- import error at
+ import error at /usr/lib/python2.6/site-
+ packages/migrate/versioning/schema.py", line 10
Revision history for this message
Jeff Silverman (jeffsilverm) wrote :
Download full text (5.1 KiB)

I think the problem is there is a file missing from sqlalchemy.

I used the sys.path variable to see where the imported file might be from. I settled on /usr/lib64/python2.6/site-packages/
I looked to see what packages supply a file that's present

<email address hidden>:~# yum provides /usr/lib64/python2.6/site-packages/sqlalchemy/events.py
Loaded plugins: fastestmirror, priorities, security
Repository sl-release-el6 is listed more than once in the configuration
Loading mirror speeds from cached hostfile
 * epel: mirror.pnl.gov
14039 packages excluded due to repository priority protections
centos-6.5-plus/filelists | 978 kB 00:00
centos-6.5-updates/filelists | 2.8 MB 00:00
epel/filelists_db | 8.9 MB 00:01
epel-6-x86_64/filelists | 7.3 MB 00:00
foreman-plugins/filelists_db | 45 kB 00:00
openstack-icehouse/filelists_db | 1.9 MB 00:00
puppetlabs-deps/filelists_db | 189 kB 00:00
puppetlabs-products/filelists_db | 954 kB 00:00
sl-release-el6/filelists | 815 kB 00:00
python-sqlalchemy-0.8.4-1.el6.x86_64 : Modular and flexible ORM library for python
Repo : openstack-icehouse
Matched from:
Filename : /usr/lib64/python2.6/site-packages/sqlalchemy/events.py

python-sqlalchemy-0.8.4-1.el6.x86_64 : Modular and flexible ORM library for python
Repo : installed
Matched from:
Other : Provides-match: /usr/lib64/python2.6/site-packages/sqlalchemy/events.py

Then looked more information from python-sqlalchemy:

<email address hidden>:~# yum info python-sqlalchemy
Loaded plugins: fastestmirror, priorities, security
Repository sl-release-el6 is listed more than once in the configuration
Loading mirror speeds from cached hostfile
 * epel: mirrors.cat.pdx.edu
14039 packages excluded due to repository priority protections
Installed Packages
Name : python-sqlalchemy
Arch : x86_64
Version : 0.8.4
Release : 1.el6
Size : 18 M
Repo : installed
From repo : openstack-icehouse
Summary : Modular and flexible ORM library for python
URL : http://www.sqlalchemy.org/
License : MIT
Description : SQLAlchemy is an Object Relational Mappper (ORM) that provides a flexible,
            : high-level interface to SQL databases. Database and domain concepts are
            : decoupled, allowing both sides maximum flexibility and power. SQLAlchemy...

Read more...

Revision history for this message
Jeff Silverman (jeffsilverm) wrote :

I found the answer, I think, at https://github.com/FormAlchemy/pyramid_formalchemy/issues/27 . Somebody changed the name of the file /usr/lib64/python2.6/site-packages/sqlalchemy/exceptions.py to /usr/lib64/python2.6/site-packages/sqlalchemy/exc.py. So I created a symlink: ln -s exc.py exceptions.py and tried the program again. That solves one problem but creates a new problem:

2014-07-23 11:20:18.757 29987 CRITICAL nova [-] AttributeError: 'module' object has no attribute 'DatabaseNotControlledError'

Revision history for this message
Andreas Jaeger (jaegerandi) wrote :

I don't see any documentation related issue here.

Changed in openstack-manuals:
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.