upgrade: rocky->stein upgrade fails - no MySQLdb module

Bug #1821192 reported by James Page
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Neutron API Charm
Fix Released
High
James Page

Bug Description

2019-03-21 14:33:01 INFO juju-log Migrating the neutron database.
2019-03-21 14:33:03 DEBUG config-changed Traceback (most recent call last):
2019-03-21 14:33:03 DEBUG config-changed File "/usr/bin/neutron-db-manage", line 10, in <module>
2019-03-21 14:33:03 DEBUG config-changed sys.exit(main())
2019-03-21 14:33:03 DEBUG config-changed File "/usr/lib/python3/dist-packages/neutron/db/migration/cli.py", line 656, in main
2019-03-21 14:33:03 DEBUG config-changed return_val |= bool(CONF.command.func(config, CONF.command.name))
2019-03-21 14:33:03 DEBUG config-changed File "/usr/lib/python3/dist-packages/neutron/db/migration/cli.py", line 178, in do_upgrade
2019-03-21 14:33:03 DEBUG config-changed run_sanity_checks(config, revision)
2019-03-21 14:33:03 DEBUG config-changed File "/usr/lib/python3/dist-packages/neutron/db/migration/cli.py", line 640, in run_sanity_checks
2019-03-21 14:33:03 DEBUG config-changed script_dir.run_env()
2019-03-21 14:33:03 DEBUG config-changed File "/usr/lib/python3/dist-packages/alembic/script/base.py", line 427, in run_env
2019-03-21 14:33:03 DEBUG config-changed util.load_python_file(self.dir, 'env.py')
2019-03-21 14:33:03 DEBUG config-changed File "/usr/lib/python3/dist-packages/alembic/util/pyfiles.py", line 81, in load_python_file
2019-03-21 14:33:03 DEBUG config-changed module = load_module_py(module_id, path)
2019-03-21 14:33:03 DEBUG config-changed File "/usr/lib/python3/dist-packages/alembic/util/compat.py", line 82, in load_module_py
2019-03-21 14:33:03 DEBUG config-changed spec.loader.exec_module(module)
2019-03-21 14:33:03 DEBUG config-changed File "<frozen importlib._bootstrap_external>", line 678, in exec_module
2019-03-21 14:33:03 DEBUG config-changed File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
2019-03-21 14:33:03 DEBUG config-changed File "/usr/lib/python3/dist-packages/neutron/db/migration/alembic_migrations/env.py", line 120, in <module>
2019-03-21 14:33:03 DEBUG config-changed run_migrations_online()
2019-03-21 14:33:03 DEBUG config-changed File "/usr/lib/python3/dist-packages/neutron/db/migration/alembic_migrations/env.py", line 106, in run_migrations_online
2019-03-21 14:33:03 DEBUG config-changed with DBConnection(neutron_config.database.connection, connection) as conn:
2019-03-21 14:33:03 DEBUG config-changed File "/usr/lib/python3/dist-packages/neutron/db/migration/connection.py", line 32, in __enter__
2019-03-21 14:33:03 DEBUG config-changed self.engine = session.create_engine(self.connection_url)
2019-03-21 14:33:03 DEBUG config-changed File "/usr/lib/python3/dist-packages/debtcollector/renames.py", line 43, in decorator
2019-03-21 14:33:03 DEBUG config-changed return wrapped(*args, **kwargs)
2019-03-21 14:33:03 DEBUG config-changed File "/usr/lib/python3/dist-packages/oslo_db/sqlalchemy/engines.py", line 177, in create_engine
2019-03-21 14:33:03 DEBUG config-changed engine = sqlalchemy.create_engine(url, **engine_args)
2019-03-21 14:33:03 DEBUG config-changed File "/usr/lib/python3/dist-packages/sqlalchemy/engine/__init__.py", line 425, in create_engine
2019-03-21 14:33:03 DEBUG config-changed return strategy.create(*args, **kwargs)
2019-03-21 14:33:03 DEBUG config-changed File "/usr/lib/python3/dist-packages/sqlalchemy/engine/strategies.py", line 81, in create
2019-03-21 14:33:03 DEBUG config-changed dbapi = dialect_cls.dbapi(**dbapi_args)
2019-03-21 14:33:03 DEBUG config-changed File "/usr/lib/python3/dist-packages/sqlalchemy/dialects/mysql/mysqldb.py", line 102, in dbapi
2019-03-21 14:33:03 DEBUG config-changed return __import__('MySQLdb')
2019-03-21 14:33:03 DEBUG config-changed ModuleNotFoundError: No module named 'MySQLdb'

Revision history for this message
James Page (james-page) wrote :

The code for stein re-introduces the pymysql prefix so I suspect we need to write out configuration files before upgrading.

Changed in charm-neutron-api:
status: New → In Progress
importance: Undecided → High
assignee: nobody → James Page (james-page)
milestone: none → 19.04
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-neutron-api (master)

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

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

Reviewed: https://review.openstack.org/645802
Committed: https://git.openstack.org/cgit/openstack/charm-neutron-api/commit/?id=71542f7452cc23bb89d6ef78bc96a81a903526aa
Submitter: Zuul
Branch: master

commit 71542f7452cc23bb89d6ef78bc96a81a903526aa
Author: James Page <email address hidden>
Date: Fri Mar 22 17:06:05 2019 +0000

    stein: migrate v1 firewalls -> v2

    Ensure that the firewall v1->v2 migrate tool is executed post
    upgrade to stein or later.

    Fix minor issue with switch of default mysql dialect to mysqldb
    at Stein by writing all new configuration files prior to
    executing the database upgrade.

    Change-Id: Ifb0b33038a4df7a2a6f5c1a55caaeea01a92fc20
    Closes-Bug: 1821192

Changed in charm-neutron-api:
status: In Progress → Fix Committed
David Ames (thedac)
Changed in charm-neutron-api:
status: Fix Committed → 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.