default cinder database is /usr/lib/python2.7/dist-packages/cinder/openstack/common/db/cinder.sqlit

Bug #1190036 reported by Adam Gandelman on 2013-06-11
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Undecided
Adam Gandelman
cinder (Ubuntu)
Undecided
Unassigned

Bug Description

The db sync call in cinder-commons postinst fails because the default cinder sqlite database is no longer set to live in /var/lib/cinder/, but /usr/lib/python2.7/dist-packages/cinder/openstack/common/db/cinder.sqlite:

2013-06-11 19:39:46,221: hook.output@INFO: Not creating home directory `/var/lib/cinder'.

2013-06-11 19:39:46,985: hook.output@INFO: 2013-06-11 19:39:46.982 14915 CRITICAL cinder [-] (OperationalError) unable to open database file None None
2013-06-11 19:39:46.982 14915 TRACE cinder Traceback (most recent call last):
2013-06-11 19:39:46.982 14915 TRACE cinder File "/usr/bin/cinder-manage", line 822, in <module>
2013-06-11 19:39:46.982 14915 TRACE cinder main()
2013-06-11 19:39:46.982 14915 TRACE cinder File "/usr/bin/cinder-manage", line 819, in main
2013-06-11 19:39:46.982 14915 TRACE cinder fn(*fn_args)
2013-06-11 19:39:46.982 14915 TRACE cinder File "/usr/bin/cinder-manage", line 222, in sync
2013-06-11 19:39:46.982 14915 TRACE cinder return migration.db_sync(version)
2013-06-11 19:39:46.982 14915 TRACE cinder File "/usr/lib/python2.7/dist-packages/cinder/db/migration.py", line 33, in db_sync
2013-06-11 19:39:46.982 14915 TRACE cinder return IMPL.db_sync(version=version)
2013-06-11 19:39:46.982 14915 TRACE cinder File "/usr/lib/python2.7/dist-packages/cinder/db/sqlalchemy/migration.py", line 74, in db_sync
2013-06-11 19:39:46.982 14915 TRACE cinder current_version = db_version()
2013-06-11 19:39:46.982 14915 TRACE cinder File "/usr/lib/python2.7/dist-packages/cinder/db/sqlalchemy/migration.py", line 86, in db_version
2013-06-11 19:39:46.982 14915 TRACE cinder return versioning_api.db_version(get_engine(), repository)
2013-06-11 19:39:46.982 14915 TRACE cinder File "/usr/lib/python2.7/dist-packages/cinder/openstack/common/db/sqlalchemy/session.py", line 498, in get_engine
2013-06-11 19:39:46.982 14915 TRACE cinder sqlite_fk=sqlite_fk)
2013-06-11 19:39:46.982 14915 TRACE cinder File "/usr/lib/python2.7/dist-packages/cinder/openstack/common/db/sqlalchemy/session.py", line 601, in create_engine
2013-06-11 19:39:46.982 14915 TRACE cinder engine.connect()
2013-06-11 19:39:46.982 14915 TRACE cinder File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 2471, in connect
2013-06-11 19:39:46.982 14915 TRACE cinder return self._connection_cls(self, **kwargs)
2013-06-11 19:39:46.982 14915 TRACE cinder File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 878, in __init__
2013-06-11 19:39:46.982 14915 TRACE cinder self.__connection = connection or engine.raw_connection()
2013-06-11 19:39:46.982 14915 TRACE cinder File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 2557, in raw_connection
2013-06-11 19:39:46.982 14915 TRACE cinder return self.pool.unique_connection()
2013-06-11 19:39:46.982 14915 TRACE cinder File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 184, in unique_connection
2013-06-11 19:39:46.982 14915 TRACE cinder return _ConnectionFairy(self).checkout()
2013-06-11 19:39:46.982 14915 TRACE cinder File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 401, in __init__
2013-06-11 19:39:46.982 14915 TRACE cinder rec = self._connection_record = pool._do_get()
2013-06-11 19:39:46.982 14915 TRACE cinder File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 822, in _do_get
2013-06-11 19:39:46.982 14915 TRACE cinder return self._create_connection()
2013-06-11 19:39:46.982 14915 TRACE cinder File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 189, in _create_connection
2013-06-11 19:39:46.982 14915 TRACE cinder return _ConnectionRecord(self)
2013-06-11 19:39:46.982 14915 TRACE cinder File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 282, in __init__
2013-06-11 19:39:46.982 14915 TRACE cinder self.connection = self.__connect()
2013-06-11 19:39:46.982 14915 TRACE cinder File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 344, in __connect
2013-06-11 19:39:46.982 14915 TRACE cinder connection = self.__pool._creator()
2013-06-11 19:39:46.982 14915 TRACE cinder File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/strategies.py", line 80, in connect
2013-06-11 19:39:46.982 14915 TRACE cinder return dialect.connect(*cargs, **cparams)
2013-06-11 19:39:46.982 14915 TRACE cinder File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 281, in connect
2013-06-11 19:39:46.982 14915 TRACE cinder return self.dbapi.connect(*cargs, **cparams)
2013-06-11 19:39:46.982 14915 TRACE cinder OperationalError: (OperationalError) unable to open database file None None
2013-06-11 19:39:46.982 14915 TRACE cinder

2013-06-11 19:39:47,019: hook.output@INFO: dpkg: error processing cinder-common (--configure):
 subprocess installed post-installation script returned error exit status 1

Adam Gandelman (gandelman-a) wrote :

Looks like the default config values have changed at some point in havana, and default sqlite_db does not get created in $state_path as expected.

Fix proposed to branch: master
Review: https://review.openstack.org/32646

Changed in cinder:
assignee: nobody → Adam Gandelman (gandelman-a)
status: New → In Progress

Reviewed: https://review.openstack.org/32646
Committed: http://github.com/openstack/cinder/commit/57cdb8f8c36a4835c918d9644bc26f41d0c0045a
Submitter: Jenkins
Branch: master

commit 57cdb8f8c36a4835c918d9644bc26f41d0c0045a
Author: Adam Gandelman <email address hidden>
Date: Tue Jun 11 14:50:01 2013 -0700

    Re-set default sql_connection and sqlite_db.

    The defaults seem to have been lost in the migration to Oslo's
    DB code. Re-set them to pre-grizzly defaults.

    Fixes bug: #1190036

    Change-Id: I7fca70e67d67905b15c2faaa745a86e957bec06e

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2013-07-17
Changed in cinder:
milestone: none → havana-2
status: Fix Committed → Fix Released
James Page (james-page) on 2013-07-22
Changed in cinder (Ubuntu):
status: New → Fix Committed
James Page (james-page) on 2013-07-23
Changed in cinder (Ubuntu):
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2013-10-17
Changed in cinder:
milestone: havana-2 → 2013.2
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers