[SRU] Missing sqlalchemy-utils dep on ussuri

Bug #1882900 reported by Liam Young
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-taskflow (Ubuntu)
Fix Released
High
Unassigned
Focal
Incomplete
High
Unassigned
Groovy
Fix Released
High
Unassigned

Bug Description

[Impact]
Package seems to be missing a dependency on sqlalchemy-utils *1. The issue shows itself when running masakari-manage with the new 'taskflow' section enabled *2

*1 https://opendev.org/openstack/masakari/src/branch/stable/ussuri/requirements.txt#L29
*2 https://review.opendev.org/734450

I saw this with bionic ussuri but I assume affects focal too.

[Test Case]
apt install --install-suggests python3-masakari
ensure this installs python3-sqlalchemy-utils
ensure "su -s /bin/sh -c 'masakari-manage db sync' masakari" no longer fails

[Regression Potential]
This is just adding a new Suggested package so really can't think of any way this would regress any current functionality.

Revision history for this message
Liam Young (gnuoy) wrote :
Revision history for this message
Corey Bryant (corey.bryant) wrote :

Thanks for reporting this Liam. I think I was able to recreate the same issue (focal ussuri):

root@f1:~# grep -A 1 "\[taskflow\]" /etc/masakari/masakari.conf
[taskflow]
connection = sqlite:////var/lib/masakari/masakari.sqlite
root@f1:~# su -s /bin/sh -c 'masakari-manage db sync' masakari
2020-06-10 12:38:48.164 9027 INFO migrate.versioning.api [-] 5 -> 6...
2020-06-10 12:38:48.166 9027 INFO masakari.engine.driver [-] Loading masakari notification driver 'taskflow_driver'
2020-06-10 12:38:48.333 9027 INFO keyring.backend [-] Loading KWallet
2020-06-10 12:38:48.342 9027 INFO keyring.backend [-] Loading SecretService
2020-06-10 12:38:48.345 9027 INFO keyring.backend [-] Loading Windows
2020-06-10 12:38:48.346 9027 INFO keyring.backend [-] Loading chainer
2020-06-10 12:38:48.346 9027 INFO keyring.backend [-] Loading macOS
Invalid input received: No module named 'sqlalchemy_utils'
root@f1:~# apt policy masakari-common
masakari-common:
  Installed: 9.0.0-0ubuntu0.20.04.2
  Candidate: 9.0.0-0ubuntu0.20.04.2
  Version table:
 *** 9.0.0-0ubuntu0.20.04.2 500

Revision history for this message
Corey Bryant (corey.bryant) wrote :

And error goes away after install python3-sqlalchemy-utils:

root@f1:~# sudo apt install python3-sqlalchemy-utils
root@f1:~# su -s /bin/sh -c 'masakari-manage db sync' masakari
2020-06-10 12:41:48.709 9204 INFO migrate.versioning.api [-] 5 -> 6...
2020-06-10 12:41:48.712 9204 INFO masakari.engine.driver [-] Loading masakari notification driver 'taskflow_driver'
2020-06-10 12:41:49.022 9204 INFO keyring.backend [-] Loading KWallet
2020-06-10 12:41:49.032 9204 INFO keyring.backend [-] Loading SecretService
2020-06-10 12:41:49.036 9204 INFO keyring.backend [-] Loading Windows
2020-06-10 12:41:49.037 9204 INFO keyring.backend [-] Loading chainer
2020-06-10 12:41:49.038 9204 INFO keyring.backend [-] Loading macOS
2020-06-10 12:41:49.845 9204 INFO migrate.versioning.api [-] done

Revision history for this message
Corey Bryant (corey.bryant) wrote :

It looks like sqlalchemy-utils should be a run-time dependency of taskflow:

https://opendev.org/openstack/taskflow/src/branch/master/taskflow/persistence/backends/sqlalchemy/tables.py#L22

I'm not sure why but all of the sqlalchemy dependencies for taskflow are listed in test-requirements.txt. So it looks like it could use a fix upstream as well.

Changed in python-taskflow (Ubuntu):
status: New → Triaged
importance: Undecided → High
Changed in python-taskflow (Ubuntu Focal):
status: New → Triaged
importance: Undecided → High
Revision history for this message
Corey Bryant (corey.bryant) wrote :

Ok nevermind, they are listed in setup.cfg [extras] in the upstream source. Dropping upstream from this bug.

no longer affects: taskflow
Changed in masakari (Ubuntu Groovy):
status: New → Triaged
Changed in masakari (Ubuntu Focal):
status: New → Triaged
importance: Undecided → High
Changed in masakari (Ubuntu Groovy):
importance: Undecided → High
no longer affects: masakari (Ubuntu Focal)
no longer affects: masakari (Ubuntu Groovy)
no longer affects: masakari (Ubuntu)
Revision history for this message
Corey Bryant (corey.bryant) wrote :

Removing masakari, never know how to handle that. Bug affects masakari but is not in masakari. Feel free to add back if you want.

Revision history for this message
Liam Young (gnuoy) wrote :
Download full text (4.3 KiB)

Yep thats the traceback I'm seeing.

Charm shows:

2020-06-10 12:45:57 ERROR juju-log amqp:40: Hook error:
Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-masakari-0/.venv/lib/python3.6/site-packages/charms/reactive/__init__.py", line 74, in main
    bus.dispatch(restricted=restricted_mode)
  File "/var/lib/juju/agents/unit-masakari-0/.venv/lib/python3.6/site-packages/charms/reactive/bus.py", line 390, in dispatch
    _invoke(other_handlers)
  File "/var/lib/juju/agents/unit-masakari-0/.venv/lib/python3.6/site-packages/charms/reactive/bus.py", line 359, in _invoke
    handler.invoke()
  File "/var/lib/juju/agents/unit-masakari-0/.venv/lib/python3.6/site-packages/charms/reactive/bus.py", line 181, in invoke
    self._action(*args)
  File "/var/lib/juju/agents/unit-masakari-0/charm/reactive/masakari_handlers.py", line 50, in init_db
    charm_class.db_sync()
  File "/var/lib/juju/agents/unit-masakari-0/.venv/lib/python3.6/site-packages/charms_openstack/charm/core.py", line 849, in db_sync
    subprocess.check_call(self.sync_cmd)
  File "/usr/lib/python3.6/subprocess.py", line 311, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['masakari-manage', '--config-file', '/etc/masakari/masakari.conf', 'db', 'sync']' returned non-zero exit status 1.

2020-06-10 12:45:57 DEBUG amqp-relation-changed Traceback (most recent call last):
2020-06-10 12:45:57 DEBUG amqp-relation-changed File "/var/lib/juju/agents/unit-masakari-0/charm/hooks/amqp-relation-changed", line 22, in <module>
2020-06-10 12:45:57 DEBUG amqp-relation-changed main()
2020-06-10 12:45:57 DEBUG amqp-relation-changed File "/var/lib/juju/agents/unit-masakari-0/.venv/lib/python3.6/site-packages/charms/reactive/__init__.py", line 74, in main
2020-06-10 12:45:57 DEBUG amqp-relation-changed bus.dispatch(restricted=restricted_mode)
2020-06-10 12:45:57 DEBUG amqp-relation-changed File "/var/lib/juju/agents/unit-masakari-0/.venv/lib/python3.6/site-packages/charms/reactive/bus.py", line 390, in dispatch
2020-06-10 12:45:57 DEBUG amqp-relation-changed _invoke(other_handlers)
2020-06-10 12:45:57 DEBUG amqp-relation-changed File "/var/lib/juju/agents/unit-masakari-0/.venv/lib/python3.6/site-packages/charms/reactive/bus.py", line 359, in _invoke
2020-06-10 12:45:57 DEBUG amqp-relation-changed handler.invoke()
2020-06-10 12:45:57 DEBUG amqp-relation-changed File "/var/lib/juju/agents/unit-masakari-0/.venv/lib/python3.6/site-packages/charms/reactive/bus.py", line 181, in invoke
2020-06-10 12:45:57 DEBUG amqp-relation-changed self._action(*args)
2020-06-10 12:45:57 DEBUG amqp-relation-changed File "/var/lib/juju/agents/unit-masakari-0/charm/reactive/masakari_handlers.py", line 50, in init_db
2020-06-10 12:45:57 DEBUG amqp-relation-changed charm_class.db_sync()
2020-06-10 12:45:57 DEBUG amqp-relation-changed File "/var/lib/juju/agents/unit-masakari-0/.venv/lib/python3.6/site-packages/charms_openstack/charm/core.py", line 849, in db_sync
2020-06-10 12:45:57 DEBUG amqp-relation-changed subprocess.check_call(self.sync_cmd)
2020-06-10 12:45:57 DEBUG amqp-relation-changed File "/usr/lib/python3.6/subp...

Read more...

Revision history for this message
Corey Bryant (corey.bryant) wrote :

We may need to revive the MIR bug for sqlalchemy-utils: pad.lv/1543641

The problem we have now is sqlalchemy-utils is in universe still and tasklfow is in main.

Revision history for this message
Corey Bryant (corey.bryant) wrote :
Revision history for this message
Corey Bryant (corey.bryant) wrote :

We'll try to pursue the MIR for groovy and get this added as a dependency. For prior releases we can add it as a 'Suggests' dependency as they don't need to be in main.

summary: - Missing sqlalchemy-utils dep on ussuri
+ [SRU] Missing sqlalchemy-utils dep on ussuri
description: updated
description: updated
Revision history for this message
Corey Bryant (corey.bryant) wrote :

This is fixed in python-taskflow 4.2.0-0ubuntu2 for groovy.

Revision history for this message
Corey Bryant (corey.bryant) wrote :

Uploaded to focal unapproved queue.

Revision history for this message
Robie Basak (racb) wrote :

I don't understand how adding a Suggests to the package in Focal will make any difference to the user impact. Please could you explain? What problem that the user is facing will adding a Suggests solve, and how?

Changed in python-taskflow (Ubuntu Focal):
status: Triaged → Incomplete
Revision history for this message
Chris MacNaughton (chris.macnaughton) wrote :

I think that the core of the issue is that has a runtime depends on sqlalchemy-utils but sqlalchemy-utils isn't yet in main. A MIR has been re-opened for Groovy but sqlalchemy-utils (likely) won't get pushed into main for Focal.

Timo Aaltonen (tjaalton)
Changed in python-taskflow (Ubuntu Groovy):
status: Triaged → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote :

Robie's question was how does adding python3-sqlachemy-utils to "Suggests" actually help users? They can still install python-taskflow (without --install-suggests) and not have python3-sqlalchemy-utils installed and still encounter the original crash.

Revision history for this message
Brian Murray (brian-murray) wrote : Proposed package upload rejected

An upload of python-taskflow to focal-proposed has been rejected from the upload queue for the following reason: "This has been rejected due to unanswered questions about the utility of providing this change as an update.".

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.