Comment 3 for bug 1835037

Revision history for this message
Angel Vargas (angelvargas) wrote :

Hi,

this is how I have solved the problem, seems after the upgrade most of the packages got upgraded to python3 but there was missing a package for mysql

Logs showed:

/home/ubuntu# cat /var/log/nova/nova-manage.log

", line 534, in _setup_for_connection
2019-07-02 10:01:14.453 729831 ERROR nova.cmd.manage sql_connection=sql_connection, **engine_kwargs)
2019-07-02 10:01:14.453 729831 ERROR nova.cmd.manage File "/usr/lib/python3/dist-packages/debtcollector/renames.py", line 43, in decorator
2019-07-02 10:01:14.453 729831 ERROR nova.cmd.manage return wrapped(*args, **kwargs)
2019-07-02 10:01:14.453 729831 ERROR nova.cmd.manage File "/usr/lib/python3/dist-packages/oslo_db/sqlalchemy/engines.py", line 177, in create_engine
2019-07-02 10:01:14.453 729831 ERROR nova.cmd.manage engine = sqlalchemy.create_engine(url, **engine_args)
2019-07-02 10:01:14.453 729831 ERROR nova.cmd.manage File "/usr/lib/python3/dist-packages/sqlalchemy/engine/__init__.py", line 425, in create_engine
2019-07-02 10:01:14.453 729831 ERROR nova.cmd.manage return strategy.create(*args, **kwargs)
2019-07-02 10:01:14.453 729831 ERROR nova.cmd.manage File "/usr/lib/python3/dist-packages/sqlalchemy/engine/strategies.py", line 81, in create
2019-07-02 10:01:14.453 729831 ERROR nova.cmd.manage dbapi = dialect_cls.dbapi(**dbapi_args)
2019-07-02 10:01:14.453 729831 ERROR nova.cmd.manage File "/usr/lib/python3/dist-packages/sqlalchemy/dialects/mysql/mysqldb.py", line 102, in dbapi
2019-07-02 10:01:14.453 729831 ERROR nova.cmd.manage return __import__('MySQLdb')
2019-07-02 10:01:14.453 729831 ERROR nova.cmd.manage ModuleNotFoundError: No module named 'MySQLdb'
2019-07-02 10:01:14.453 729831 ERROR nova.cmd.manage
2019-07-02 10:01:14.463 729831 WARNING oslo_db.sqlalchemy.engines [req-42da38ea-f420-4e4c-ab58-e19d68804d10 - - - - -] URL mysql://nova:***@10.10.0.202/nova does not contain a '+drivername' portion, and will make use of a default driver. A full dbname+drivername:// protocol is recommended. For MySQL, it is strongly recommended that mysql+pymysql:// be specified for maximum service compatibility
2019-07-02 10:01:14.464 729831 WARNING nova.objects.instance_mapping [req-42da38ea-f420-4e4c-ab58-e19d68804d10 - - - - -] Encountered exception: "No module named 'MySQLdb'" while querying instances from cell: e5f8f404-9361-40ad-a67a-a0746d4868b0(cell1). Continuing to the next cell.: ModuleNotFoundError: No module named 'MySQLdb'

After see that in the logs, I checked and effectively there wasn't a lib for python - mysql

I did:

sudo apt-get install -y python3-mysqldb

and then all worked fine.

Is this a isolated case or is actually a bug? Why should be this package missing after the upgrade?