[Bug 1807262] Re: stein unit tests fail with sqlalchemy.exc.NoSuchTableError: migration_tmp
Christian Ehrhardt
1807262 at bugs.launchpad.net
Fri Dec 7 09:57:56 UTC 2018
As we knew from the logs already the issue is raised to "db_sync" at
/usr/lib/python3/dist-packages/oslo_db/sqlalchemy/migration.py:81
that is:
test.py:setUp -> test.py::Database:__init__ -> db/migration.py:db_sync -> oslo_db/sqlalchemy/migration.py:81
The __init__ suppresses logging for tests, lets remove that and set it to STDERR.
# Suppress logging for test runs
migrate_logger = logging.getLogger('migrate')
migrate_logger.setLevel(logging.DEBUG)
handler = logging.StreamHandler(sys.stderr)
handler.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
handler.setFormatter(formatter)
migrate_logger.addHandler(handler)
But no useful insight by that.
The actual exception is raised when trying this:
migration = versioning_api.upgrade(engine, repository, version)
engine Engine(sqlite://)
repository /root/cinder-14.0.0~b1~git2018111617.4529b193d/cinder/db/sqlalchemy/migrate_repo
version None
The path is a sqlalchemy database migration repository.
It exists after the test, but I'm not sure what we could do with it.
That code is of:
python3-migrate: /usr/lib/python3/dist-packages/migrate/versioning/api.py
This will call
_migrate(url, repository, version, upgrade=True, err=err, **opts)
url=engine
repo = the path above
That all seems ok and matches the upper stack trace in the report,
nointh too obvious on the way there.
BTW the definition of "migration_tmp" is from python3-migrate sqlite3 backend.
/usr/lib/python3/dist-packages/migrate/changeset/databases/sqlite.py
:99: self.append('ALTER TABLE %s RENAME TO migration_tmp' % table_name)
:107: self.append('DROP TABLE migration_tmp')
:133: 'SELECT %(cols)s from migration_tmp')%{'cols':columns}
:148: ' from migration_tmp'
:161: return 'INSERT INTO %(table_name)s SELECT * from migration_tmp'
:180: return 'INSERT INTO %(table_name)s SELECT * from migration_tmp'
:194: return 'INSERT INTO %(table_name)s SELECT * from migration_tmp'
Which is again openstack/sqlalchemy btw from
https://github.com/openstack/sqlalchemy-migrate/commits/master
No new commit there that would fix it either.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to sqlite3 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 foundations-bugs
mailing list