Database migration 'make pool.lb_algorithm larger' fails on DevStack

Bug #1536876 reported by Gerard Braad
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
octavia
Fix Released
Undecided
Banashankar

Bug Description

When deploying DevStack with neutron-lbaas and octavia it fails on the alembic database migrations of octavia.

The output reads:
  File "/opt/stack/octavia/octavia/db/migration/alembic_migrations/versions/43287cd10fef_make_pool_lb_algorithm_larger.py", line 33, in upgrade
    existing_type=sa.String(255))
  File "<string>", line 8, in alter_column
  File "<string>", line 3, in alter_column
  File "/usr/lib/python2.7/site-packages/alembic/operations/ops.py", line 1414, in alter_column
  File "<string>", line 8, in alter_column

sqlalchemy.exc.InternalError: (pymysql.err.InternalError) (1832, u"Cannot change column 'lb_algorithm': used in a foreign key constraint 'fk_pool_algorithm_name'") [SQL: u'ALTER TABLE pool MODIFY lb_algorithm VARCHAR(255) NOT NULL']

The issue is reproducible after ./unstack.sh and after removing the mysql databases and rerunning ./stack.sh

Current versions of components:
  octavia 820829d36baf23cfc502fe20929687fb4ae44d4e
  neutron-lbaas 860d7b73b315227cf993cb81ac5ed66e964bd4e4
  neutron c068c3f3c115fde79b8a9aec9e13838744c85ad1

Tags: database
Revision history for this message
Gerard Braad (gbraad) wrote :
Revision history for this message
Gerard Braad (gbraad) wrote :

configuration used to deploy devstack

Revision history for this message
Gerard Braad (gbraad) wrote :

alembic error

Revision history for this message
Gerard Braad (gbraad) wrote :

sqlalchemy.exc.InternalError: (pymysql.err.InternalError) (1832, u"Cannot change column 'lb_algorithm': used in a foreign key constraint 'fk_pool_algorithm_name'") [SQL: u'ALTER TABLE pool MODIFY lb_algorithm VARCHAR(255) NOT NULL']

description: updated
description: updated
Gerard Braad (gbraad)
description: updated
Banashankar (bkalebe)
Changed in octavia:
assignee: nobody → Banashankar (bkalebe)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to octavia (master)

Fix proposed to branch: master
Review: https://review.openstack.org/271178

Changed in octavia:
status: New → In Progress
Revision history for this message
Gerard Braad (gbraad) wrote :

Fetching the changeset to see if this fixes it.

Revision history for this message
Gerard Braad (gbraad) wrote :

[stack@devstack migration]$ alembic upgrade head
INFO [alembic.runtime.migration] Context impl MySQLImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
INFO [alembic.runtime.migration] Running upgrade 6abb04f24c5 -> 43287cd10fef, Make pool.lb_algorithm larger

Fixed

Revision history for this message
Banashankar (bkalebe) wrote :

Devstack seems to be working fine without this change now. I am not sure what got changed.

Revision history for this message
Gerard Braad (gbraad) wrote :

It consistently fails on both Fedora and CentOS, using mariadb. I was going to try it out on Ubuntu to compare this.

Revision history for this message
Banashankar (bkalebe) wrote :

Yes I see, For me too it worked fine on ubuntu and gave the same kind of error on Centos.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to octavia (master)

Reviewed: https://review.openstack.org/271178
Committed: https://git.openstack.org/cgit/openstack/octavia/commit/?id=259538d92f05e923c54dcb6791b3f4ed2753fc28
Submitter: Jenkins
Branch: master

commit 259538d92f05e923c54dcb6791b3f4ed2753fc28
Author: BANASHANKAR KALEBELAGUNDI VEERA <email address hidden>
Date: Fri Jan 22 00:13:04 2016 -0800

    Change the length of name in the algorithm

    since we are updating the lenght of the
    lb_algorithm in pool table we need to change
    the name column in algorithm table as its a FK

    Closes-Bug:1536876
    Change-Id: I1183da8e4effbf84c55618aa22b82dcc359b8623

Changed in octavia:
status: In Progress → Fix Released
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.