syntax error on sqlite schema upgrade

Bug #1487257 reported by Stanislaw Pitucha
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Magnum
Fix Released
Undecided
Vilobh Meshram

Bug Description

When running the db upgrade on a clean database, sqlalchemy tries to execute some invalid queries:

INFO [alembic.runtime.migration] Running upgrade 2d1354bbf76e -> 29affeaa2bc2, rename-bay-master-address
...
sqlalchemy.exc.OperationalError: (pysqlite2.dbapi2.OperationalError) near "master_address": syntax error [SQL: u'ALTER TABLE bay RENAME master_address TO api_address']

Relevant modules:
pysqlite (2.8.0)
sqlalchemy-migrate (0.9.7)
SQLAlchemy (1.0.8)
magnum master / eea7400054a874524f8436204e9aa2eacf4d1520

Changed in magnum:
assignee: nobody → Vilobh Meshram (vilobhmm)
Revision history for this message
hongbin (hongbin034) wrote :

I saw you are using sqlite, but Magnum is tested with mysql. I am not surprise if DB migration doesn't work in sqlite. Are you able to reproduce the error by using mysql?

Revision history for this message
Vilobh Meshram (vilobhmm) wrote :

+1 Discussed this with hongbin on IRC I also have a similar question that do you see similar problem on MySQL ?

Revision history for this message
Stanislaw Pitucha (stanislaw-pitucha) wrote :

It's an sqlite-specific issue. Mysql works fine.

Revision history for this message
Vilobh Meshram (vilobhmm) wrote :

Can we close this bug then ? If it works fine with mysql.

Revision history for this message
Stanislaw Pitucha (stanislaw-pitucha) wrote :

If that's by design, then sure. But in that case, can this bug be changed to "documentation doesn't clearly mention which backends are allowed"?

This is still in the source, which indicates that sqlite is not only supported, but also the default option: (magnum/db/sqlalchemy/models.py)

_DEFAULT_SQL_CONNECTION = 'sqlite:///' + paths.state_path_def('magnum.sqlite')

cfg.CONF.register_opts(sql_opts, 'database')
db_options.set_defaults(cfg.CONF, _DEFAULT_SQL_CONNECTION, 'magnum.sqlite')

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to magnum (master)

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

Changed in magnum:
status: New → In Progress
Changed in magnum:
status: In Progress → Confirmed
Changed in magnum:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to magnum (master)

Reviewed: https://review.openstack.org/220347
Committed: https://git.openstack.org/cgit/openstack/magnum/commit/?id=2219a2d82e7c39da4677a3eaa2d989a704300382
Submitter: Jenkins
Branch: master

commit 2219a2d82e7c39da4677a3eaa2d989a704300382
Author: Vilobh Meshram <email address hidden>
Date: Thu Sep 3 16:15:38 2015 -0700

    DB Migration does not work for SQLite backend

    Update the doc to mention it clearly that DB Migration
    does not work for SQLite Backend.

    Change-Id: I7d2682f6b4af37fb0cc2d640b02fd598baf42625
    Closes-Bug: #1487257

Changed in magnum:
status: In Progress → Fix Committed
Adrian Otto (aotto)
Changed in magnum:
milestone: none → mitaka-1
status: Fix Committed → Fix Released
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.