[SRU] alembic database migrations missing from package

Bug #2090992 reported by James Page
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Cloud Archive
Fix Released
Undecided
Unassigned
Caracal
Fix Committed
High
Unassigned
neutron-dynamic-routing (Ubuntu)
Status tracked in Plucky
Noble
Fix Committed
High
Unassigned
Oracular
Fix Released
Undecided
Unassigned
Plucky
Fix Released
Undecided
Unassigned

Bug Description

[Impact]
DB schema is missing, extension driver is not functional.

[Test Case]
sudo apt install mysql-server neutron-server python3-neutron-dynamic-routing
sudo mysql -u root << EOF
CREATE DATABASE neutron;
CREATE USER 'neutron'@'localhost' IDENTIFIED BY 'changeme';
CREATE USER 'neutron'@'%' IDENTIFIED BY 'changeme';
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost';
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%';
EOF
sudo sed -i -e 's!connection = sqlite.*!connection = mysql+pymysql://neutron:changeme@localhost/neutron!g' /etc/neutron/neutron.conf
sudo neutron-db-manage upgrade head

No DB migrations will be applied for neutron-dynamic-routing:

  Running upgrade for neutron-dynamic-routing ...
INFO [alembic.runtime.migration] Context impl MySQLImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
  OK

this should look like:

  Running upgrade for neutron-dynamic-routing ...
INFO [alembic.runtime.migration] Context impl MySQLImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
INFO [alembic.runtime.migration] Running upgrade -> start_neutron_dynamic_routing, start neutron-dynamic-routing chain
INFO [alembic.runtime.migration] Running upgrade start_neutron_dynamic_routing -> 61cc795e43e8, initial
INFO [alembic.runtime.migration] Running upgrade 61cc795e43e8 -> 4cf8bc3edb66, rename tenant to project
INFO [alembic.runtime.migration] Running upgrade 4cf8bc3edb66 -> a589fdb5724c, change size of as number
INFO [alembic.runtime.migration] Running upgrade start_neutron_dynamic_routing -> f399fa0f5f25, initial
  OK

Check that DB migrations are installed after upgrade:

dpkg -L python3-neutron-dynamic-routing > befort.txt
[upgrade]
dpkg -L python3-neutron-dynamic-routing > after.txt

diff before.txt after.txt

35a36
> /usr/lib/python3/dist-packages/neutron_dynamic_routing/db/migration/README
39a41,54
> /usr/lib/python3/dist-packages/neutron_dynamic_routing/db/migration/alembic_migrations/script.py.mako
> /usr/lib/python3/dist-packages/neutron_dynamic_routing/db/migration/alembic_migrations/versions
> /usr/lib/python3/dist-packages/neutron_dynamic_routing/db/migration/alembic_migrations/versions/CONTRACT_HEAD
> /usr/lib/python3/dist-packages/neutron_dynamic_routing/db/migration/alembic_migrations/versions/EXPAND_HEAD
> /usr/lib/python3/dist-packages/neutron_dynamic_routing/db/migration/alembic_migrations/versions/newton
> /usr/lib/python3/dist-packages/neutron_dynamic_routing/db/migration/alembic_migrations/versions/newton/contract
> /usr/lib/python3/dist-packages/neutron_dynamic_routing/db/migration/alembic_migrations/versions/newton/contract/4cf8bc3edb66_rename_tenant_to_project.py
> /usr/lib/python3/dist-packages/neutron_dynamic_routing/db/migration/alembic_migrations/versions/newton/contract/61cc795e43e8_initial.py
> /usr/lib/python3/dist-packages/neutron_dynamic_routing/db/migration/alembic_migrations/versions/newton/expand
> /usr/lib/python3/dist-packages/neutron_dynamic_routing/db/migration/alembic_migrations/versions/newton/expand/f399fa0f5f25_initial.py
> /usr/lib/python3/dist-packages/neutron_dynamic_routing/db/migration/alembic_migrations/versions/queens
> /usr/lib/python3/dist-packages/neutron_dynamic_routing/db/migration/alembic_migrations/versions/queens/contract
> /usr/lib/python3/dist-packages/neutron_dynamic_routing/db/migration/alembic_migrations/versions/queens/contract/a589fdb5724c_change_size_of_as_number.py
> /usr/lib/python3/dist-packages/neutron_dynamic_routing/db/migration/alembic_migrations/versions/start_neutron_dynamic_routing.py

[What could go wrong]
This fix was applied for Oracular onwards; the fix simply ensures that python files that are not true python modules are included in the package.

[Original Bug Report]
This package is not shipping alembic database migrations

James Page (james-page)
Changed in neutron-dynamic-routing (Ubuntu Oracular):
status: New → Fix Released
Changed in neutron-dynamic-routing (Ubuntu Plucky):
status: New → Fix Released
Changed in cloud-archive:
status: New → Fix Released
Changed in neutron-dynamic-routing (Ubuntu Noble):
status: New → Triaged
importance: Undecided → High
James Page (james-page)
description: updated
description: updated
description: updated
James Page (james-page)
description: updated
James Page (james-page)
description: updated
Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello James, or anyone else affected,

Accepted neutron-dynamic-routing into noble-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/neutron-dynamic-routing/2:24.0.0-0ubuntu1.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-noble to verification-done-noble. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-noble. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in neutron-dynamic-routing (Ubuntu Noble):
status: Triaged → Fix Committed
tags: added: verification-needed verification-needed-noble
Revision history for this message
James Page (james-page) wrote :

Hello James, or anyone else affected,

Accepted neutron-dynamic-routing into caracal-proposed. The package will build now and be available in the Ubuntu Cloud Archive in a few hours, and then in the -proposed repository.

Please help us by testing this new package. To enable the -proposed repository:

  sudo add-apt-repository cloud-archive:caracal-proposed
  sudo apt-get update

Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-caracal-needed to verification-caracal-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-caracal-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-caracal-needed
Revision history for this message
Juan Pablo Noreña (jpablo-norena) wrote (last edit ):
Download full text (3.5 KiB)

Hi James, or anyone else affected :),

Charmed neutron-api 2024.1/candidate 603 with the neutron_dynamic_routing.services.bgp.bgp_plugin.BgpPlugin enabled in Jammy installs neutron-dynamic-routing_24.0.0-0ubuntu1.

Running openstack bgp commands like:

$ openstack bgp speaker list
HttpException: 500: Server Error for url: https://<neutron-api-url>:9696/v2.0/bgp-speakers, Request Failed: internal server error while processing your request.

Results in neutron-server errors related to the db migration:

2025-02-26 16:03:37.001 2160977 ERROR neutron.api.v2.resource [None req-521be947-1151-4c91-8f1d-e10221dce71d 74c58b5bb8b545899d86a2b85c0ea155 274e915f24ff4547a2571b67bd404083 - - 990c9869587
44b8295fa51f5c6bf41cb 990c986958744b8295fa51f5c6bf41cb] index failed: No details.: sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (1054, "Unknown column 'bgp_speakers.project_id' in 'field list'")
[SQL: SELECT bgp_speakers.project_id AS bgp_speakers_project_id, bgp_speakers.id AS bgp_speakers_id, bgp_speakers.name AS bgp_speakers_name, bgp_speakers.local_as AS bgp_speakers_local_as, b
gp_speakers.advertise_floating_ip_host_routes AS bgp_speakers_advertise_floating_ip_host_routes, bgp_speakers.advertise_tenant_networks AS bgp_speakers_advertise_tenant_networks, bgp_speaker
s.ip_version AS bgp_speakers_ip_version, bgp_speaker_peer_bindings_1.bgp_speaker_id AS bgp_speaker_peer_bindings_1_bgp_speaker_id, bgp_speaker_peer_bindings_1.bgp_peer_id AS bgp_speaker_peer
_bindings_1_bgp_peer_id, bgp_speaker_network_bindings_1.bgp_speaker_id AS bgp_speaker_network_bindings_1_bgp_speaker_id, bgp_speaker_network_bindings_1.network_id AS bgp_speaker_network_bind
ings_1_network_id, bgp_speaker_network_bindings_1.ip_version AS bgp_speaker_network_bindings_1_ip_version
FROM bgp_speakers LEFT OUTER JOIN bgp_speaker_peer_bindings AS bgp_speaker_peer_bindings_1 ON bgp_speakers.id = bgp_speaker_peer_bindings_1.bgp_speaker_id LEFT OUTER JOIN bgp_speaker_network
_bindings AS bgp_speaker_network_bindings_1 ON bgp_speakers.id = bgp_speaker_network_bindings_1.bgp_speaker_id]

full traceback in: https://paste.ubuntu.com/p/v5rvnNZmvJ/

The workaround:

1. SSH into all neutron-api units.

2. install the 2:24.0.0-0ubuntu1.1~cloud0 version of the package
$ sudo add-apt-repository cloud-archive:caracal-proposed
$ sudo apt-get install --only-upgrade python3-neutron-dynamic-routing

3. Apply the migration in one of the units.
$ sudo neutron-db-manage upgrade head
INFO [alembic.runtime.migration] Context impl MySQLImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
  Running upgrade for neutron ...
INFO [alembic.runtime.migration] Context impl MySQLImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
  OK
INFO [alembic.runtime.migration] Context impl MySQLImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
  Running upgrade for neutron-dynamic-routing ...
INFO [alembic.runtime.migration] Context impl MySQLImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
INFO [alembic.runtime.migration] Running upgrade -> start_neutron_dynamic_routing, start neutron-dynamic-routing chain
INFO [alembic.runti...

Read more...

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.