FWaaS DB schema migration in not applied due to empty Enum definition

Bug #1207805 reported by Roman Podoliaka
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Roman Podoliaka

Bug Description

When applying migration 39cf3f799352_fwaas_havana_2_model on MySQL I receive the following error:

sqlalchemy.exc.ProgrammingError: (ProgrammingError) (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '), \n\tenabled BOOL, \n\tposition INTEGER, \n\tPRIMARY KEY (id), \n\tCONSTRAINT firewall' at line 16") '\nCREATE TABLE firewall_rules (\n\ttenant_id VARCHAR(255), \n\tid VARCHAR(36) NOT NULL, \n\tname VARCHAR(255), \n\tdescription VARCHAR(1024), \n\tfirewall_policy_id VARCHAR(36), \n\tshared BOOL, \n\tprotocol VARCHAR(24), \n\tip_version INTEGER NOT NULL, \n\tsource_ip_address VARCHAR(46), \n\tdestination_ip_address VARCHAR(46), \n\tsource_port_range_min INTEGER, \n\tsource_port_range_max INTEGER, \n\tdestination_port_range_min INTEGER, \n\tdestination_port_range_max INTEGER, \n\taction ENUM(), \n\tenabled BOOL, \n\tposition INTEGER, \n\tPRIMARY KEY (id), \n\tCONSTRAINT firewall_rules_ibfk_1 FOREIGN KEY(firewall_policy_id) REFERENCES firewall_policies (id), \n\tCHECK (shared IN (0, 1)), \n\tCHECK (enabled IN (0, 1))\n)\n\n' ()

The error is caused by empty Enum() definition in 39cf3f799352_fwaas_havana_2_model.py:
        sa.Column('action', sa.Enum(), nullable=True),

While neutron/db/firewall/firewall_db.py contains:
      action = sa.Column(sa.Enum('allow', 'deny', name='firewallrules_action'))

So the table is created successfully, if the initial DB schema is generated based on models definitions, but it's not possible to upgrade existing Neutron installation to the latest commit.

Tags: db
Changed in neutron:
assignee: nobody → Roman Podolyaka (rpodolyaka)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

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

Changed in neutron:
status: New → In Progress
Changed in neutron:
importance: Undecided → High
Changed in neutron:
status: In Progress → Triaged
milestone: none → havana-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/39982
Committed: http://github.com/openstack/neutron/commit/ac1c9005e90d0ad65d7078e0e1604ca0ff2c7431
Submitter: Jenkins
Branch: master

commit ac1c9005e90d0ad65d7078e0e1604ca0ff2c7431
Author: Roman Podolyaka <email address hidden>
Date: Fri Aug 2 18:00:04 2013 +0300

    Fix enum definition in FWaaS DB schema migration

    Applying of migration 39cf3f799352 fails due to the error
    in definiton of action Enum type (values are not passed).

    Fixes bug 1207805

    Change-Id: Ibfdc268b400433c9013ca4c475f6b1fa32d338fb

Changed in neutron:
status: Triaged → Fix Committed
Thierry Carrez (ttx)
Changed in neutron:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: havana-3 → 2013.2
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.