Describe the bug
On a fresh install, magnum-db-sync fails with:
sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError)
(1060, "Duplicate column name 'stack_id'")
[SQL: ALTER TABLE nodegroup ADD COLUMN stack_id VARCHAR(255)]
Has anyone else encountered this issue?
To Reproduce
- Fresh Genestack deployment (no previous Magnum data)
- Run install-magnum.sh
- magnum-db-sync Job enters CrashLoopBackOff
Expected behavior
magnum-db-manage upgrade completes successfully.
Server
- OS: Ubuntu 22.04
- Magnum image: ghcr.io/rackerlabs/genestack-images/magnum:2025.1-latest
- MariaDB: Galera cluster via mariadb-operator
Additional context
Reproducible on two independent baremetal environments. We believe migration ac92cbae311c imports from magnum.db.sqlalchemy import models which loads the current model metadata, causing op.create_table to
create the nodegroup table with extra columns that a later migration (c04e925e65c2) tries to add again.
Current workaround:
magnum-db-manage stamp head
Describe the bug
On a fresh install, magnum-db-sync fails with:
sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError)
(1060, "Duplicate column name 'stack_id'")
[SQL: ALTER TABLE nodegroup ADD COLUMN stack_id VARCHAR(255)]
Has anyone else encountered this issue?
To Reproduce
Expected behavior
magnum-db-manage upgrade completes successfully.
Server
Additional context
Reproducible on two independent baremetal environments. We believe migration ac92cbae311c imports from magnum.db.sqlalchemy import models which loads the current model metadata, causing op.create_table to
create the nodegroup table with extra columns that a later migration (c04e925e65c2) tries to add again.
Current workaround:
magnum-db-manage stamp head