Provider PTG creation failed due to name lenght restriction in DB

Bug #1519747 reported by Sireesha
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Group Based Policy
Fix Released
High
Sumit Naiksatam

Bug Description

While launching the FW(Vyos) in East-West, the provider Ptg creation failed due to DBError .

On debugging further observed that the issue is caused while updating DB (sc_instances). The error seen was "Data too long for column 'name'".
The 'name' field in sc_instances table is 50 characters long. The name that is given while createing PTG is less than 50 characters.
The problem is seen as gbp is pre-pending some extra characters to the ptg name before updating the DB.

MariaDB [neutron]> desc sc_instances;
+---------------------+---------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------------+---------------+------+-----+---------+-------+
| tenant_id | varchar(255) | YES | | NULL | |
| id | varchar(36) | NO | PRI | NULL | |
| name | varchar(50) | YES | | NULL | |
| description | varchar(255) | YES | | NULL | |
| config_param_values | varchar(4096) | YES | | NULL | |
| provider_ptg_id | varchar(36) | YES | | NULL | |
| consumer_ptg_id | varchar(36) | YES | | NULL | |
| classifier_id | varchar(36) | YES | | NULL | |
| management_ptg_id | varchar(36) | YES | | NULL | |
+---------------------+---------------+------+-----+---------+-------+
9 rows in set (0.00 sec)

Snapshot of neutron server log
--------------------------------
2015-11-25 01:58:10.531 26974 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager self.errorhandler(self, exc, value)
2015-11-25 01:58:10.531 26974 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager File "/usr/lib64/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
2015-11-25 01:58:10.531 26974 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager raise errorclass, errorvalue
2015-11-25 01:58:10.531 26974 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager DBError: (DataError) (1406, "Data too long for column 'name' at row 1") 'INSERT INTO sc_instances (tenant_id, id, name, description, config_param_values, provider_ptg_id, consumer_ptg_id, management_ptg_id, classifier_id) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)' ('1eeb8711c9e94db2b5864e7689c565a2', '738cc6da-be49-4464-9013-47d1917cd48b', 'gbp_sungard-project-test-prs_test-provider-policy-target-group', '', '{}', '793ed549-437a-4a7f-bdcb-c2e5c7e58b0e', 'N/A', None, '01561fcd-3f38-4f3f-95fd-0da0027b745b')

Note:
gbp is prefixing the following string format to names before updating db.
    gbp_<prs-name>_<ptg-name>
Eg: In the above error 'gbp_sungard-project-test-prs_test-provider-policy-target-group' is the name of the ptg after modification by gbp.
 In this case prs name is 'sungard-project-test-prs' and ptg name is 'test-provider-policy-target-group'

Changed in group-based-policy:
milestone: none → liberty-1
assignee: nobody → Sumit Naiksatam (snaiksat)
importance: Undecided → High
status: New → Confirmed
Changed in group-based-policy:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to group-based-policy (stable/kilo)

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/251094

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to group-based-policy (stable/juno)

Fix proposed to branch: stable/juno
Review: https://review.openstack.org/251095

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

Reviewed: https://review.openstack.org/251084
Committed: https://git.openstack.org/cgit/openstack/group-based-policy/commit/?id=071add821835e8c1b338d8ce0cb177518201eaef
Submitter: Jenkins
Branch: master

commit 071add821835e8c1b338d8ce0cb177518201eaef
Author: Sumit Naiksatam <email address hidden>
Date: Sat Nov 28 21:38:44 2015 -0800

    Increase name attr len to 128 in API and 255 in DB

    Current length of 50 characters is too restrictive,
    and also internally derived names are sometimes even
    longer since they are derived from other names.

    Closes-bug: 1519747
    Change-Id: I76267be6deb61c60e7ada9d9c0bee4c58dee6dec

Changed in group-based-policy:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to group-based-policy (stable/kilo)

Reviewed: https://review.openstack.org/251094
Committed: https://git.openstack.org/cgit/openstack/group-based-policy/commit/?id=c6a0bc6f7ee7d48d5950c4458a0329b63a9f1544
Submitter: Jenkins
Branch: stable/kilo

commit c6a0bc6f7ee7d48d5950c4458a0329b63a9f1544
Author: Sumit Naiksatam <email address hidden>
Date: Sat Nov 28 21:38:44 2015 -0800

    Increase name attr len to 128 in API and 255 in DB

    Current length of 50 characters is too restrictive,
    and also internally derived names are sometimes even
    longer since they are derived from other names.

    Closes-bug: 1519747
    Change-Id: I76267be6deb61c60e7ada9d9c0bee4c58dee6dec
    (cherry picked from commit 071add821835e8c1b338d8ce0cb177518201eaef)

tags: added: in-stable-kilo
tags: added: in-stable-juno
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to group-based-policy (stable/juno)

Reviewed: https://review.openstack.org/251095
Committed: https://git.openstack.org/cgit/openstack/group-based-policy/commit/?id=0b0e6ad9bab6cd0510040389a10d4ccc4479213f
Submitter: Jenkins
Branch: stable/juno

commit 0b0e6ad9bab6cd0510040389a10d4ccc4479213f
Author: Sumit Naiksatam <email address hidden>
Date: Sat Nov 28 21:38:44 2015 -0800

    Increase name attr len to 128 in API and 255 in DB

    Current length of 50 characters is too restrictive,
    and also internally derived names are sometimes even
    longer since they are derived from other names.

    Closes-bug: 1519747
    Change-Id: I76267be6deb61c60e7ada9d9c0bee4c58dee6dec
    (cherry picked from commit 071add821835e8c1b338d8ce0cb177518201eaef)
    (cherry picked from commit c6a0bc6f7ee7d48d5950c4458a0329b63a9f1544)

Changed in group-based-policy:
status: Fix Committed → 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.