keystone could not find some scripts in migration repository after switched branch

Bug #1599124 reported by Wenyan Zhang
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
devstack
Fix Released
Undecided
Wenyan Zhang

Bug Description

I switched devstack from master to stable/mitaka, and before executing stash.sh, I has executed unstack.sh & clean.sh, but has exception as follow:

2016-07-04 06:43:11.742 | 2016-07-04 14:43:11.742 20162 DEBUG migrate.versioning.repository [-] Repository /opt/stack/keystone/keystone/common/sql/migrate_repo loaded successfully __init__ /usr/local/lib/python2.7/dist-packages/migrate/versioning/repository.py:82
2016-07-04 06:43:11.742 | 2016-07-04 14:43:11.742 20162 DEBUG migrate.versioning.repository [-] Config: OrderedDict([('db_settings', OrderedDict([('__name__', 'db_settings'), ('repository_id', 'keystone'), ('version_table', 'migrate_version'), ('required_dbs', '[]'), ('use_timestamp_numbering', 'False')]))]) __init__ /usr/local/lib/python2.7/dist-packages/migrate/versioning/repository.py:83
2016-07-04 06:43:11.750 | 2016-07-04 14:43:11.748 20162 CRITICAL keystone [-] AssertionError: There is no script for 98 version
2016-07-04 06:43:11.750 | 2016-07-04 14:43:11.748 20162 TRACE keystone Traceback (most recent call last):
2016-07-04 06:43:11.750 | 2016-07-04 14:43:11.748 20162 TRACE keystone File "/usr/local/bin/keystone-manage", line 10, in <module>
2016-07-04 06:43:11.750 | 2016-07-04 14:43:11.748 20162 TRACE keystone sys.exit(main())
2016-07-04 06:43:11.750 | 2016-07-04 14:43:11.748 20162 TRACE keystone File "/opt/stack/keystone/keystone/cmd/manage.py", line 47, in main
2016-07-04 06:43:11.750 | 2016-07-04 14:43:11.748 20162 TRACE keystone cli.main(argv=sys.argv, config_files=config_files)
2016-07-04 06:43:11.750 | 2016-07-04 14:43:11.748 20162 TRACE keystone File "/opt/stack/keystone/keystone/cmd/cli.py", line 992, in main
2016-07-04 06:43:11.751 | 2016-07-04 14:43:11.748 20162 TRACE keystone CONF.command.cmd_class.main()
2016-07-04 06:43:11.751 | 2016-07-04 14:43:11.748 20162 TRACE keystone File "/opt/stack/keystone/keystone/cmd/cli.py", line 371, in main
2016-07-04 06:43:11.751 | 2016-07-04 14:43:11.748 20162 TRACE keystone migration_helpers.sync_database_to_version(extension, version)
2016-07-04 06:43:11.751 | 2016-07-04 14:43:11.748 20162 TRACE keystone File "/opt/stack/keystone/keystone/common/sql/migration_helpers.py", line 210, in sync_database_to_version
2016-07-04 06:43:11.751 | 2016-07-04 14:43:11.748 20162 TRACE keystone _sync_common_repo(version)
2016-07-04 06:43:11.751 | 2016-07-04 14:43:11.748 20162 TRACE keystone File "/opt/stack/keystone/keystone/common/sql/migration_helpers.py", line 136, in _sync_common_repo
2016-07-04 06:43:11.751 | 2016-07-04 14:43:11.748 20162 TRACE keystone init_version=init_version, sanity_check=False)
2016-07-04 06:43:11.751 | 2016-07-04 14:43:11.748 20162 TRACE keystone File "/usr/local/lib/python2.7/dist-packages/oslo_db/sqlalchemy/migration.py", line 79, in db_sync
2016-07-04 06:43:11.751 | 2016-07-04 14:43:11.748 20162 TRACE keystone migration = versioning_api.upgrade(engine, repository, version)
2016-07-04 06:43:11.751 | 2016-07-04 14:43:11.748 20162 TRACE keystone File "/usr/local/lib/python2.7/dist-packages/migrate/versioning/api.py", line 186, in upgrade
2016-07-04 06:43:11.751 | 2016-07-04 14:43:11.748 20162 TRACE keystone return _migrate(url, repository, version, upgrade=True, err=err, **opts)
2016-07-04 06:43:11.751 | 2016-07-04 14:43:11.748 20162 TRACE keystone File "<decorator-gen-15>", line 2, in _migrate
2016-07-04 06:43:11.751 | 2016-07-04 14:43:11.748 20162 TRACE keystone File "/usr/local/lib/python2.7/dist-packages/migrate/versioning/util/__init__.py", line 160, in with_engine
2016-07-04 06:43:11.751 | 2016-07-04 14:43:11.748 20162 TRACE keystone return f(*a, **kw)
2016-07-04 06:43:11.751 | 2016-07-04 14:43:11.748 20162 TRACE keystone File "/usr/local/lib/python2.7/dist-packages/migrate/versioning/api.py", line 345, in _migrate
2016-07-04 06:43:11.751 | 2016-07-04 14:43:11.748 20162 TRACE keystone changeset = schema.changeset(version)
2016-07-04 06:43:11.751 | 2016-07-04 14:43:11.748 20162 TRACE keystone File "/usr/local/lib/python2.7/dist-packages/migrate/versioning/schema.py", line 82, in changeset
2016-07-04 06:43:11.751 | 2016-07-04 14:43:11.748 20162 TRACE keystone changeset = self.repository.changeset(database, start_ver, version)
2016-07-04 06:43:11.751 | 2016-07-04 14:43:11.748 20162 TRACE keystone File "/usr/local/lib/python2.7/dist-packages/migrate/versioning/repository.py", line 225, in changeset
2016-07-04 06:43:11.751 | 2016-07-04 14:43:11.748 20162 TRACE keystone changes = [self.version(v).script(database, op) for v in versions]
2016-07-04 06:43:11.752 | 2016-07-04 14:43:11.748 20162 TRACE keystone File "/usr/local/lib/python2.7/dist-packages/migrate/versioning/version.py", line 207, in script
2016-07-04 06:43:11.752 | 2016-07-04 14:43:11.748 20162 TRACE keystone "There is no script for %d version" % self.version
2016-07-04 06:43:11.752 | 2016-07-04 14:43:11.748 20162 TRACE keystone AssertionError: There is no script for 98 version
2016-07-04 06:43:11.752 | 2016-07-04 14:43:11.748 20162 TRACE keystone

Then I removed all *.pyc files in /opt/stack/keystone, the devstack successed.

So, I think clean.sh should remove the *.pyc files.

Tags: clean devstack
Changed in devstack:
assignee: nobody → Wenyan Zhang (zhang-wenyan3)
status: New → Confirmed
status: Confirmed → New
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to devstack (master)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on devstack (master)

Change abandoned by Wenyan Zhang (<email address hidden>) on branch: master
Review: https://review.openstack.org/339311
Reason: recommitted

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

Reviewed: https://review.openstack.org/339312
Committed: https://git.openstack.org/cgit/openstack-dev/devstack/commit/?id=8f0e97c1460f015f4eb03a8221b4b02b61559d9d
Submitter: Jenkins
Branch: master

commit 8f0e97c1460f015f4eb03a8221b4b02b61559d9d
Author: WenyanZhang <email address hidden>
Date: Thu Jul 7 18:57:32 2016 +0800

    Remove all *.pyc files in $DEST when executing clean.sh

    Currentlly, the *.pyc files could not be removed in any scripts or
    functions. But the redundant files would lead stack.sh not to find the
    correct script for some versions after branch switched from master to
    stable/mitaka in migration_helpers.sync_database_to_version.

    So this commit adds the process of cleaning all the *.pyc files in
    clean.sh.

    It is needed to execute clean.sh before re-stack.sh to prevent the
    exception.

    Change-Id: I9ba0674d6b20b13c0a26b22cd5d1939daa121a94
    Closes-Bug: #1599124

Changed in devstack:
status: In Progress → 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.