[OSA][Bobcat] Masakari DB Sync Error

Bug #2052378 reported by Mr.R
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack-Ansible
Fix Committed
High
Unassigned

Bug Description

Masakari deployment fails on a fresh install on Debian 12 with the following:

fatal: [host01_masakari_api_container-6b045078]: FAILED! => {"changed": false, "cmd": ["/openstack/venvs/masakari-28.0.1/bin/masakari-manage", "db", "sync"], "delta": "0:00:00.302855", "end": "2024-02-04 11:
04:42.245634", "msg": "non-zero return code", "rc": 1, "start": "2024-02-04 11:04:41.942779", "stderr": "Traceback (most recent call last):\n File \"/openstack/venvs/masakari-28.0.1/bin/masakari-manage\", l
ine 5, in <module>\n from masakari.cmd.manage import main\n File \"/openstack/venvs/masakari-28.0.1/lib/python3.11/site-packages/masakari/cmd/manage.py\", line 27, in <module>\n from oslo_db.sqlalchem
y import migration\n File \"/openstack/venvs/masakari-28.0.1/lib/python3.11/site-packages/oslo_db/sqlalchemy/migration.py\", line 45, in <module>\n from migrate import exceptions as versioning_exceptions
\nModuleNotFoundError: No module named 'migrate'", "stderr_lines": ["Traceback (most recent call last):", " File \"/openstack/venvs/masakari-28.0.1/bin/masakari-manage\", line 5, in <module>", " from mas
akari.cmd.manage import main", " File \"/openstack/venvs/masakari-28.0.1/lib/python3.11/site-packages/masakari/cmd/manage.py\", line 27, in <module>", " from oslo_db.sqlalchemy import migration", " File
 \"/openstack/venvs/masakari-28.0.1/lib/python3.11/site-packages/oslo_db/sqlalchemy/migration.py\", line 45, in <module>", " from migrate import exceptions as versioning_exceptions", "ModuleNotFoundError:
 No module named 'migrate'"], "stdout": "", "stdout_lines": []}

This is because sqlalchemy-migrate isn't installed to the venv.
Adding sqlalchemy-migrate to pip packages fixes the issue:

/etc/ansible/roles/os_masakari/defaults/main.yml
masakari_pip_packages:
  - .....
  - sqlalchemy-migrate

Haven't submitted a fix as not sure if this affects other os's etc...
Apologies if this isn't set out right, my first bug report :)

Revision history for this message
Dmitriy Rabotyagov (noonedeadpunk) wrote (last edit ):

Hey,

From what I can recall there's a bug in masakari related to incompatibility with sqlalchemy version, which also was hitting masakari ci, and fixes of that were merged only for master.

We will triage this bug report accordingly during the week, but highly likely that the best way would be just to using "master" (future 2024.1) version of masakari.

For that you can define a variable under user_variables.yml:

masakari_git_install_branch: 6b38affa154f82f885190a70770581aadf6d7dd4

PS: oh, ok, indeed adding sqlalchemy-migrate would be more trivial fix, I will verify it works and propose patch shortly

Changed in openstack-ansible:
status: New → Triaged
Revision history for this message
Dmitriy Rabotyagov (noonedeadpunk) wrote :

Ok, so I did run bunch of tests, and both these solutions can exists.

But you're right that adding sqlalchemy-migrate to the list of requirements is more proper solution. It is also needed only for 2023.2 branch, since neither current master nor 2023.1 are not affected by the issue.
SO it's more or less masakari bug on 2023.2 branch.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible-os_masakari (stable/2023.2)
Changed in openstack-ansible:
status: Triaged → In Progress
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible-os_masakari (stable/2023.2)

Reviewed: https://review.opendev.org/c/openstack/openstack-ansible-os_masakari/+/907722
Committed: https://opendev.org/openstack/openstack-ansible-os_masakari/commit/12d0deee3aec3a958d4b77dff1a0700fac2d32fc
Submitter: "Zuul (22348)"
Branch: stable/2023.2

commit 12d0deee3aec3a958d4b77dff1a0700fac2d32fc
Author: Dmitriy Rabotyagov <email address hidden>
Date: Mon Feb 5 12:25:29 2024 +0100

    Add sqlalchemy-migrate to workaround masakari issues

    For 2023.2 branch specifically, masakari fails to interact with SQLalchemy
    version that's being used in u-c. While needed patches were merged,
    this was done after branching, leaving 2023.2 in a broken shape.

    So we add sqlalchemy-migrate package to list of requirements
    for 2023.2 solely, as it's not required neither in previous nor in next releases.

    Closes-Bug: #2052378
    Change-Id: I1883c935144ab5c3a578b4d98945e3bc78a02ad1

Changed in openstack-ansible:
status: In Progress → Fix Committed
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.