[Bug 2090992] Re: [SRU] alembic database migrations missing from package

James Page 2090992 at bugs.launchpad.net
Wed Dec 4 09:45:50 UTC 2024


** Description changed:

  [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

-- 
You received this bug notification because you are a member of Ubuntu
OpenStack, which is subscribed to Ubuntu Cloud Archive.
https://bugs.launchpad.net/bugs/2090992

Title:
  [SRU] alembic database migrations missing from package

Status in Ubuntu Cloud Archive:
  Fix Released
Status in Ubuntu Cloud Archive caracal series:
  Triaged
Status in neutron-dynamic-routing package in Ubuntu:
  Fix Released
Status in neutron-dynamic-routing source package in Noble:
  Triaged
Status in neutron-dynamic-routing source package in Oracular:
  Fix Released
Status in neutron-dynamic-routing source package in Plucky:
  Fix Released

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-archive/+bug/2090992/+subscriptions




More information about the Ubuntu-openstack-bugs mailing list