sqlalchemy-migrate>0.9.1 and <0.9.5 causes glance test failures

Bug #1410494 reported by Nikhil Komawar
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Critical
Unassigned
sqlalchemy-migrate
Fix Committed
Undecided
Unassigned

Bug Description

The error is seen as

OperationalError: (OperationalError) cannot start a transaction within a transaction u'/*\n * This is necessary because SQLite does not support\n * RENAME INDEX or ALTER TABLE CHANGE COLUMN.\n */\nBEGIN TRANSACTION;' ()

More info at:
http://paste.openstack.org/show/157276/

Revision history for this message
Ian Cordasco (icordasc) wrote :

I can reproduce this with glance's tests. If you install sqlalchemy-migrate 0.9.1, all tests pass. If you install 0.9.4 a subset of the tests fail. It's unclear what is actually causing this.

Changed in glance:
status: New → Triaged
Changed in sqlalchemy-migrate:
status: New → Confirmed
Revision history for this message
Ian Cordasco (icordasc) wrote :

 Davanum (dims) helped me narrow it down to https://github.com/stackforge/sqlalchemy-migrate/commit/938757e7aa581646a6a501426a5dae84ebe5631f in #openstack-oslo since there weren't many changes between 0.9.2 and 0.9.4. This could also be a problem introduced in 0.9.2 and not found after we blacklisted its installation.

Revision history for this message
Nikhil Komawar (nikhil-komawar) wrote :

The versions breaking the tests are 0.9.2, 0.9.3(possibly removed) and 0.9.4 as of now.

Revision history for this message
Nikhil Komawar (nikhil-komawar) wrote :
Changed in glance:
status: Triaged → In Progress
Revision history for this message
Matt Riedemann (mriedem) wrote :

Ihar has a change in glance here: https://review.openstack.org/#/c/121033/

That would get around this for now, but wouldn't fix anyone busted with the other versions of sqlalchemy-migrate.

Revision history for this message
Matt Riedemann (mriedem) wrote :
Revision history for this message
Matt Riedemann (mriedem) wrote :
Revision history for this message
Matt Riedemann (mriedem) wrote :

sdague updated https://review.openstack.org/#/c/121033/ to fix the comments in the sql scripts to be using the correct format (-- rather than /* */), so the comments were wrong and that was causing a parsing error.

We can fix the migrations on master and pin sqlalchemy-migrate in the stable branches.

Revision history for this message
Ian Cordasco (icordasc) wrote :

For openstack-ansible, the solution is to pin sqlalchemy-migrate to version 0.9.1

Changed in openstack-ansible:
status: New → Triaged
status: Triaged → Won't Fix
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/121033
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=92a7111e9e5a9e3494ba1ce074f673bc11328c63
Submitter: Jenkins
Branch: master

commit 92a7111e9e5a9e3494ba1ce074f673bc11328c63
Author: Ihar Hrachyshka <email address hidden>
Date: Fri Sep 12 11:02:31 2014 +0200

    SQL scripts should not manage transactions

    Glance SQL scripts assume too much about the environment and the way in
    which they are executed by sqlalchemy-migrate. Particularly, they manage
    transactions on their own even though sqlalchemy-migrate do it itself,
    plus it assumes that scripts are executed in one go (even though
    standard Python DB-API 2.0 does not mention multi-statement SQL commands
    to be executed on DB cursors.

    Also fix comments to be actual SQL comments and not C comments

    https://blueprints.launchpad.net/oslo.db/+spec/enable-mysql-connector

    Change-Id: I10c58b3af75d3ab9153a8bbd2a539bf1577de328
    Closes-Bug: 1368391
    Closes-Bug: 1410494

Changed in glance:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on glance (stable/juno)

Change abandoned by Ihar Hrachyshka (<email address hidden>) on branch: stable/juno
Review: https://review.openstack.org/147217
Reason: We're going to cap sqlalchemy-migrate version instead.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on glance (stable/icehouse)

Change abandoned by Ihar Hrachyshka (<email address hidden>) on branch: stable/icehouse
Review: https://review.openstack.org/147218
Reason: We're going to cap sqlalchemy-migrate version instead.

Thierry Carrez (ttx)
Changed in glance:
milestone: none → kilo-2
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to sqlalchemy-migrate (master)

Reviewed: https://review.openstack.org/147013
Committed: https://git.openstack.org/cgit/stackforge/sqlalchemy-migrate/commit/?id=b9caaae4fccb1d6f8dea575ff318975fe197edde
Submitter: Jenkins
Branch: master

commit b9caaae4fccb1d6f8dea575ff318975fe197edde
Author: Ihar Hrachyshka <email address hidden>
Date: Wed Jan 14 00:09:32 2015 +0100

    script: strip comments in SQL statements

    Regular expression does not match correctly against statements that contain
    comments at their start. So strip those comments first (and whitespaces, while
    we are at it).

    Change-Id: Iad9b544bf995374d76cab1e125658aae2f8511f4
    Closes-Bug: #1410494

Changed in sqlalchemy-migrate:
status: Confirmed → Fix Committed
Thierry Carrez (ttx)
Changed in glance:
milestone: kilo-2 → 2015.1.0
no longer affects: openstack-ansible
no longer affects: openstack-ansible/juno
no longer affects: openstack-ansible/icehouse
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.