Ask Your Question
0

running gnocchi-api with swift all-in-one install fails

asked 2014-05-27 06:52:42 -0500

atmalagon gravatar image

updated 2014-05-28 09:51:20 -0500

Hi,

I'm trying to run gnocchi [1] with a Swift all-in-one install on a Ubuntu 12.04 VM, but am getting the following errors when trying gnocchi out:

  1. running ./run-tests.sh for gnocchi returns ImportError: no module named common.db.sqlalchemy.test_migrations and
  2. running /usr/local/bin/gnocchi-api --config-file ~/gnocchi/setup.cfg returns 14542 CRITICAL: AttributeError: 'NoneType' Object has no attribute 'drivername'

    I installed Swift as an all-in-one [2] and it passed all tests; I cloned the gnocchi repo from the stackforge github page and ran sudo python setup.py install as welll as sudo pip install -r requirements.txt and sudo pip install -r test-requirements.txt (also had to install libpq-dev and build-essential).

Thanks!

[1] http://github.com/stackforge/gnocchi.git

[2] http://docs.openstack.org/developer/swift/development_saio.html (http://docs.openstack.org/developer/s...)

Update: Thanks Eoghan for the explanation! I added a gnocchi.conf file in /etc/gnocchi/ which looks like this:

[api]
port = 8041
host = 0.0.0.0

[storage]
swift_auth_version = 1
swift_authurl = http://localhost:8080/auth/v1.0
swift_user = admin:admin
swift_key = admin
swift_coordination_driver = memcached

[indexer]
driver = sqlalchemy

[database]
connection = sqlite:////opt/stack/gnocchi/gnocchi/openstack/common/db/gnocchi.sqlite
sqlite_db = gnocchi.sqlite

now I get an OperationalError: unable to open database file when running gnocchi-api --debug --config-file /etc/gnocchi/gnocchi.conf : http://paste.openstack.org/show/81890/

I also tried running gnocchi on a VM with a devstack environment that had swift enabled; this produces the same error message as above when running gnocchi-api, but a different error message when trying ./run-tests.sh : http://paste.openstack.org/show/81889/

(I checked my version of msgpack with pip freeze and it is 0.1.10.)

edit retag flag offensive close merge delete

Comments

Sorry, looks like at least part of this was due to a very silly error: I had installed gnocchi to my home directory, instead of /opt/stack, which was why I was getting the OperationalError. Still getting the msgpack errors for run-tests though.

atmalagon gravatar imageatmalagon ( 2014-05-28 10:01:43 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-05-27 16:42:15 -0500

Hi Ana,

Looks like you're passing the wrong type of config file:

/usr/local/bin/gnocchi-api --config-file ~/gnocchi/setup.cfg

That setup.cfg is used by setup.py to generate the entry_points.txt, the gnocchi-api console scripts and the likes.

Whereas you need a .conf file in the oslo.config format, containing definitions for the config options needed by gnocchi, e.g.

 gnocchi.conf:
  [storage]
  driver = swift
  compression_level = 2
  swift_user = anamalagon:passwd

  [indexer]
  driver = sqlalchemy

Note those are just some random config options I pulled from the code, not intended to be a complete/working set of config. I'll try to get you a working example gnocchi.conf for tomorrow.

Cheers, Eoghan

edit flag offensive delete link more

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-05-27 06:52:42 -0500

Seen: 1,474 times

Last updated: May 28 '14