Install issue: Unable to import backend 'sqlalchemy'

Asked by Tamás Pflanzner

When I try to install Rally based on this tutorial https://wiki.openstack.org/wiki/Rally/installation/manual (because I already deployed an OpenStack cloud) I get an error message:
rally-manage db recreate

Traceback (most recent call last):
  File "/usr/bin/rally-manage", line 6, in <module>
    from rally.cmd.manage import main
  File "/usr/lib/python2.6/site-packages/rally/cmd/manage.py", line 24, in <module>
    from rally import db
  File "/usr/lib/python2.6/site-packages/rally/db/__init__.py", line 16, in <module>
    from rally.db.api import * # noqa
  File "/usr/lib/python2.6/site-packages/rally/db/api.py", line 55, in <module>
    IMPL = db_api.DBAPI.from_config(CONF, backend_mapping=_BACKEND_MAPPING)
  File "/usr/lib/python2.6/site-packages/oslo/db/api.py", line 229, in from_config
    max_retries=conf.database.db_max_retries)
  File "/usr/lib/python2.6/site-packages/oslo/db/api.py", line 166, in __init__
    self._load_backend()
  File "/usr/lib/python2.6/site-packages/oslo/db/api.py", line 183, in _load_backend
    self._backend_name)
ImportError: Unable to import backend 'sqlalchemy'

If I try to install sqlalchemy with pip install sqlalchemy I get the following:
Requirement already satisfied (use --upgrade to upgrade): sqlalchemy in /usr/lib64/python2.6/site-packages
Cleaning up...

When I runned the setup.py I got a long error message (sudo python setup.py install)
...
src/lxml/lxml.etree.c:201298: error: expected ‘)’ before ‘__pyx_f_4lxml_5etree__ xslt_doc_loader’

error: command 'gcc' failed with exit status 1

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build _root/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read ().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-0JQay2-r ecord/install-record.txt --single-version-externally-managed --compile failed wi th error code 1 in /tmp/pip_build_root/lxml
Traceback (most recent call last):
  File "/usr/lib64/python2.6/runpy.py", line 122, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib64/python2.6/runpy.py", line 34, in _run_code
    exec code in run_globals
  File "/usr/lib/python2.6/site-packages/pip/__init__.py", line 275, in <module>
    exit = main()
  File "/usr/lib/python2.6/site-packages/pip/__init__.py", line 185, in main
    return command.main(cmd_args)
  File "/usr/lib/python2.6/site-packages/pip/basecommand.py", line 161, in main
    text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 81: ordinal not in range(128)
error: ['/usr/bin/python', u'-m', u'pip.__init__', u'install', u'Babel>=1.3', u' decorator>=3.4.0', u'fixtures>=0.3.14', u'iso8601>=0.1.9', u'jsonschema>=2.0.0,< 3.0.0', u'netaddr>=0.7.12', u'oslo.config>=1.4.0 # Apache-2.0', u'oslo.db>=1.0. 0 # Apache-2.0', u'paramiko>=1.13.0', u'pbr>=0.6,!=0.7,<1.0', u'pecan>=0.5.0', u'PrettyTable>=0.7,<0.8', u'PyYAML>=3.1.0', u'python-designateclient>=1.0.0', u' python-glanceclient>=0.14.0', u'python-keystoneclient>=0.10.0', u'python-novacli ent>=2.18.0', u'python-neutronclient>=2.3.6,<3', u'python-cinderclient>=1.1.0', u'python-heatclient>=0.2.9', u'python-ceilometerclient>=1.0.6', u'python-ironicc lient>=0.2.1', u'python-saharaclient>=0.7.3', u'python-zaqarclient>=0.0.3', u'py thon-subunit>=0.0.18', u'requests>=1.2.1,!=2.4.0', u'SQLAlchemy>=0.8.4,<=0.8.99, >=0.9.7,<=0.9.99', u'sphinx>=1.1.2,!=1.2.0,<1.3', u'six>=1.7.0', u'WSME>=0.6'] r eturned 255

But when I runned it again, it installed successfully.

I thought the problem can be with my config file, because in the tutorial the connection variable is like this:
connection="sqlite:////a/path/here/rally.sqlite"
but in the example config file there are no quotation marks:
connection=sqlite:////rally/openstack/common/db/$sqlite_db
(https://github.com/stackforge/rally/blob/c8508134c05bbffde9f9422029d48adb1a0f38ea/etc/rally/rally.conf.sample#L145)

I tried both version, but the problem with the sqlalchemy is the same, now I have this line in the config file:
connection=sqlite:////rally/openstack/common/db/rally.sqlite

What can be the problem? How should I solve this?

Question information

Language:
English Edit question
Status:
Solved
For:
Rally Edit question
Assignee:
No assignee Edit question
Solved by:
Boris Pavlovic
Solved:
Last query:
Last reply:
Revision history for this message
Boris Pavlovic (boris-42) said :
#1
Revision history for this message
Tamás Pflanzner (tamas-pflanzner) said :
#2

Unfortunately I get the same error with the automated installation.

[root@fuel rally]# ./install_rally.sh
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/metalink

                               | 24 kB 00:00
 * epel: fedora.aau.at
epel

                               | 4.4 kB 00:00
epel/primary_db

                               | 6.3 MB 00:00
nailgun

                               | 3.9 kB 00:00 ...
sensu

                               | 951 B 00:00
zabbix

                               | 951 B 00:00
zabbix-non-supported

                               | 951 B 00:00
Setting up Install Process
Package wget-1.12-1.11.el6_5.x86_64 already installed and latest version
Package gcc-4.4.7-4.el6.x86_64 already installed and latest version
No package libffi-devel available.
Package python-devel-2.6.6-52.el6.x86_64 already installed and latest version
Package openssl-devel-1.0.1e-16.el6_5.14.x86_64 already installed and latest version
No package gmp-devel available.
No package libxml2-devel available.
No package libxslt-devel available.
Nothing to do
Requirement already satisfied (use --upgrade to upgrade): pbr in /usr/lib/python2.6/site-packages
Cleaning up...
Downloading/unpacking tox<=1.6.1
  Downloading tox-1.6.1.tar.gz (131kB): 131kB downloaded
  Running setup.py (path:/tmp/pip_build_root/tox/setup.py) egg_info for package tox
Downloading/unpacking virtualenv>=1.9.1 (from tox<=1.6.1)
  Downloading virtualenv-1.11.6-py2.py3-none-any.whl (1.6MB): 1.6MB downloaded
Downloading/unpacking py>=1.4.15 (from tox<=1.6.1)
  Downloading py-1.4.25.tar.gz (190kB): 190kB downloaded
  Running setup.py (path:/tmp/pip_build_root/py/setup.py) egg_info for package py
Requirement already satisfied (use --upgrade to upgrade): argparse in /usr/lib/python2.6/site-packages (from tox<=1.6.1)
Installing collected packages: tox, virtualenv, py
  Running setup.py install for tox
    Installing tox script to /usr/bin
    Installing tox-quickstart script to /usr/bin
  Running setup.py install for py
Successfully installed tox virtualenv py
Cleaning up...
running install
Requirement already satisfied (use --upgrade to upgrade): Babel>=1.3 in /usr/lib/python2.6/site-packages
Requirement already satisfied (use --upgrade to upgrade): decorator>=3.4.0 in /usr/lib/python2.6/site-packages
Requirement already satisfied (use --upgrade to upgrade): fixtures>=0.3.14 in /usr/lib/python2.6/site-packages
Requirement already satisfied (use --upgrade to upgrade): iso8601>=0.1.9 in /usr/lib/python2.6/site-packages
Requirement already satisfied (use --upgrade to upgrade): jsonschema>=2.0.0,<3.0.0 in /usr/lib/python2.6/site-packages
Requirement already satisfied (use --upgrade to upgrade): netaddr>=0.7.12 in /usr/lib/python2.6/site-packages
Requirement already satisfied (use --upgrade to upgrade): oslo.config>=1.4.0 in /usr/lib/python2.6/site-packages
Requirement already satisfied (use --upgrade to upgrade): oslo.db>=1.0.0 in /usr/lib/python2.6/site-packages
Requirement already satisfied (use --upgrade to upgrade): paramiko>=1.13.0 in /usr/lib/python2.6/site-packages
Requirement already satisfied (use --upgrade to upgrade): pbr>=0.6,!=0.7,<1.0 in /usr/lib/python2.6/site-packages
Requirement already satisfied (use --upgrade to upgrade): pecan>=0.5.0 in /usr/lib/python2.6/site-packages
Requirement already satisfied (use --upgrade to upgrade): PrettyTable>=0.7,<0.8 in /usr/lib/python2.6/site-packages
Requirement already satisfied (use --upgrade to upgrade): PyYAML>=3.1.0 in /usr/lib64/python2.6/site-packages
Requirement already satisfied (use --upgrade to upgrade): python-designateclient>=1.0.0 in /usr/lib/python2.6/site-packages
Requirement already satisfied (use --upgrade to upgrade): python-glanceclient>=0.14.0 in /usr/lib/python2.6/site-packages
Requirement already satisfied (use --upgrade to upgrade): python-keystoneclient>=0.10.0 in /usr/lib/python2.6/site-packages
Requirement already satisfied (use --upgrade to upgrade): python-novaclient>=2.18.0 in /usr/lib/python2.6/site-packages
Requirement already satisfied (use --upgrade to upgrade): python-neutronclient>=2.3.6,<3 in /usr/lib/python2.6/site-packages
Requirement already satisfied (use --upgrade to upgrade): python-cinderclient>=1.1.0 in /usr/lib/python2.6/site-packages
Requirement already satisfied (use --upgrade to upgrade): python-heatclient>=0.2.9 in /usr/lib/python2.6/site-packages
Requirement already satisfied (use --upgrade to upgrade): python-ceilometerclient>=1.0.6 in /usr/lib/python2.6/site-packages
Requirement already satisfied (use --upgrade to upgrade): python-ironicclient>=0.2.1 in /usr/lib/python2.6/site-packages
Requirement already satisfied (use --upgrade to upgrade): python-saharaclient>=0.7.3 in /usr/lib/python2.6/site-packages
Requirement already satisfied (use --upgrade to upgrade): python-zaqarclient>=0.0.3 in /usr/lib/python2.6/site-packages
Requirement already satisfied (use --upgrade to upgrade): python-subunit>=0.0.18 in /usr/lib/python2.6/site-packages
Requirement already satisfied (use --upgrade to upgrade): requests>=1.2.1,!=2.4.0 in /usr/lib/python2.6/site-packages
Requirement already satisfied (use --upgrade to upgrade): SQLAlchemy>=0.8.4,<=0.8.99,>=0.9.7,<=0.9.99 in /usr/lib64/python2.6/site-packages
Requirement already satisfied (use --upgrade to upgrade): sphinx>=1.1.2,!=1.2.0,<1.3 in /usr/lib64/python2.6/site-packages
Requirement already satisfied (use --upgrade to upgrade): six>=1.7.0 in /usr/lib/python2.6/site-packages
Requirement already satisfied (use --upgrade to upgrade): WSME>=0.6 in /usr/lib/python2.6/site-packages
Requirement already satisfied (use --upgrade to upgrade): pytz>=0a in /usr/lib/python2.6/site-packages (from Babel>=1.3)
Requirement already satisfied (use --upgrade to upgrade): testtools>=0.9.22 in /usr/lib/python2.6/site-packages (from fixtures>=0.3.14)
Requirement already satisfied (use --upgrade to upgrade): extras in /usr/lib/python2.6/site-packages (from python-subunit>=0.0.18)
Requirement already satisfied (use --upgrade to upgrade): simplegeneric in /usr/lib/python2.6/site-packages (from WSME>=0.6)
Requirement already satisfied (use --upgrade to upgrade): WebOb in /usr/lib/python2.6/site-packages (from WSME>=0.6)
Requirement already satisfied (use --upgrade to upgrade): ordereddict in /usr/lib/python2.6/site-packages (from WSME>=0.6)
Requirement already satisfied (use --upgrade to upgrade): ipaddr in /usr/lib/python2.6/site-packages (from WSME>=0.6)
Requirement already satisfied (use --upgrade to upgrade): python-mimeparse in /usr/lib/python2.6/site-packages (from testtools>=0.9.22-

>fixtures>=0.3.14)
Cleaning up...
running build
running build_py
running egg_info
writing requirements to rally.egg-info/requires.txt
writing rally.egg-info/PKG-INFO
writing top-level names to rally.egg-info/top_level.txt
writing dependency_links to rally.egg-info/dependency_links.txt
writing entry points to rally.egg-info/entry_points.txt
[pbr] Reusing existing SOURCES.txt
running install_lib
running install_egg_info
removing '/usr/lib/python2.6/site-packages/rally-0.0.1.dev1179.g265dfd9-py2.6.egg-info' (and everything under it)
Copying rally.egg-info to /usr/lib/python2.6/site-packages/rally-0.0.1.dev1179.g265dfd9-py2.6.egg-info
running install_scripts
Installing rally-manage script to /usr/bin
Installing rally script to /usr/bin
Installing rally-api script to /usr/bin
Traceback (most recent call last):
  File "/usr/bin/rally-manage", line 6, in <module>
    from rally.cmd.manage import main
  File "/usr/lib/python2.6/site-packages/rally/cmd/manage.py", line 24, in <module>
    from rally import db
  File "/usr/lib/python2.6/site-packages/rally/db/__init__.py", line 16, in <module>
    from rally.db.api import * # noqa
  File "/usr/lib/python2.6/site-packages/rally/db/api.py", line 55, in <module>
    IMPL = db_api.DBAPI.from_config(CONF, backend_mapping=_BACKEND_MAPPING)
  File "/usr/lib/python2.6/site-packages/oslo/db/api.py", line 229, in from_config
    max_retries=conf.database.db_max_retries)
  File "/usr/lib/python2.6/site-packages/oslo/db/api.py", line 166, in __init__
    self._load_backend()
  File "/usr/lib/python2.6/site-packages/oslo/db/api.py", line 183, in _load_backend
    self._backend_name)
ImportError: Unable to import backend 'sqlalchemy'

Revision history for this message
Boris Pavlovic (boris-42) said :
#3

So we meet the same issue when we tried to install Rally on 32-bit system.

Is your system 64 bit?)

Revision history for this message
Tamás Pflanzner (tamas-pflanzner) said :
#4

Yes, my system is 64 bit.
Is there a workaround for this problem? Or do you know what causing the problem?

Revision history for this message
Boris Pavlovic (boris-42) said :
#5

So first of all that manual tutorial is out of date.

I removed it.

You should use automated installation script:

https://github.com/stackforge/rally/blob/master/install_rally.sh

Could you create a new fresh VM that is running Ubuntu/Centos and just do next operations

git clone https://github.com/stackforge/rally
cd rally
sudo ./install_rally.sh

That will work 100%. Because we are testing this on every patch in Rally

Revision history for this message
Tamás Pflanzner (tamas-pflanzner) said :
#6

I tried it on a new Ubuntu VM, and it worked. On a new CentOS VM, the git repo link is wrong, if I change it to http://git.openstack.org/stackforge/rally and install with the script, it works.
But if I try with a new Fuel master node (created with a virtualbox script [https://github.com/Wasapl/Fuel-VirtualBox-VBscripts]), it fails with the same reason (sqlalchemy).
I think the fuel master node is an ideal place to install Rally. Did you try to install it on a Fuel master node? How can Fuel cause this issue?

Revision history for this message
Boris Pavlovic (boris-42) said :
#7

Do not install it on Fuel node.

1) We don't and actually won't support FuelOS (because it is not Centos) in our install-rally.sh

2) It makes mess on master on node

We are going to provide with master node Rally installed in future. (that's why we won't touch install-rally.sh)

The cleanest way to use Rally is to create VM in cloud and install Rally in it.

Revision history for this message
Best Boris Pavlovic (boris-42) said :
#8

Do not install it on Fuel node.

1) We don't and actually won't support FuelOS (because it is not Centos) in our install-rally.sh

2) It makes mess on master on node

We are going to provide with master node Rally installed in future. (that's why we won't touch install-rally.sh)

The cleanest way to use Rally is to create VM in cloud and install Rally in it.

Revision history for this message
Tamás Pflanzner (tamas-pflanzner) said :
#9

Thank you Boris, It works.
Is there a GUI for rally? I saw a pretty cool in this video: http://www.youtube.com/watch?v=eXdtx-p60CI but I don't know where to find it.

Revision history for this message
Tamás Pflanzner (tamas-pflanzner) said :
#10

Thanks Boris Pavlovic, that solved my question.