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'
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: :Database: __init_ _ -> db/migration. py:db_sync -> oslo_db/ sqlalchemy/ migration. py:81
test.py:setUp -> test.py:
The __init__ suppresses logging for tests, lets remove that and set it to STDERR.
migrate_ logger = logging. getLogger( 'migrate' )
migrate_ logger. setLevel( logging. DEBUG) StreamHandler( sys.stderr)
handler. setLevel( logging. DEBUG) Formatter( '%(asctime) s - %(name)s - %(levelname)s - %(message)s')
handler. setFormatter( formatter)
migrate_ logger. addHandler( handler)
# Suppress logging for test runs
handler = logging.
formatter = logging.
But no useful insight by that.
The actual exception is raised when trying this: api.upgrade( engine, repository, version) 14.0.0~ b1~git201811161 7.4529b193d/ cinder/ db/sqlalchemy/ migrate_ repo
migration = versioning_
engine Engine(sqlite://)
repository /root/cinder-
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/ dist-packages/ migrate/ versioning/ api.py
python3-migrate: /usr/lib/
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. python3/ dist-packages/ migrate/ changeset/ databases/ sqlite. py tmp')%{ 'cols': columns}
/usr/lib/
: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_
: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.