[Bug 1807262] Re: stein unit tests fail with sqlalchemy.exc.NoSuchTableError: migration_tmp
Laszlo Boszormenyi
gcs at debian.org
Fri Dec 7 16:56:45 UTC 2018
It's 'PRAGMA legacy_alter_table = ON' and the following change in
src:migrate (0.11.0 version) might do the trick.
@@ -9,6 +9,7 @@ except ImportError: # Python 2
from UserDict import DictMixin
from copy import copy
import re
+import sqlite3
from sqlalchemy.databases import sqlite as sa_base
from sqlalchemy.schema import ForeignKeyConstraint
@@ -96,6 +97,10 @@ class SQLiteHelper(SQLiteCommon):
if omit_constraints is None or cons.name not in omit_constraints
])
+ tup = sqlite3.sqlite_version_info
+ if tup[0] > 3 or (tup[0] == 3 and tup[1] >= 26):
+ self.append('PRAGMA legacy_alter_table = ON')
+ self.execute()
self.append('ALTER TABLE %s RENAME TO migration_tmp' % table_name)
self.execute()
@@ -106,6 +111,9 @@ class SQLiteHelper(SQLiteCommon):
self.execute()
self.append('DROP TABLE migration_tmp')
self.execute()
+ if tup[0] > 3 or (tup[0] == 3 and tup[1] >= 26):
+ self.append('PRAGMA legacy_alter_table = OFF')
+ self.execute()
def visit_column(self, delta):
if isinstance(delta, DictMixin):
--
You received this bug notification because you are a member of Ubuntu
OpenStack, which is subscribed to nova in Ubuntu.
https://bugs.launchpad.net/bugs/1807262
Title:
stein unit tests fail with sqlalchemy.exc.NoSuchTableError:
migration_tmp
Status in cinder package in Ubuntu:
Triaged
Status in nova package in Ubuntu:
Triaged
Status in sqlite3 package in Ubuntu:
New
Bug description:
Several tests that use sqlite fail with:
"sqlalchemy.exc.NoSuchTableError: migration_tmp". I'm currently
hitting this with nova and cinder packages in disco.
Note this started sometime after 11/19 when nova
2:19.0.0~b1~git2018111953.3e756ff674-0ubuntu1 was uploaded (and built
successfully at the time).
After doing some digging this appears to occur with libsqlite3-0
3.26.0-1 but does not occur with libsqlite3-0 3.25.3-1. Here are some
more details on that, shown by running a failing unit test from the
cinder package: https://paste.ubuntu.com/p/hsnQFQD572/
Update: The test in the paste above also works successfully with
libsqlite3-0 3.25.3-2.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cinder/+bug/1807262/+subscriptions
More information about the Ubuntu-openstack-bugs
mailing list