LMA alerting plugin fails to deploy because vip_namespace/vip_name is too long

Bug #1551320 reported by Simon Pasquier on 2016-02-29
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
High
Artem Roma

Bug Description

Tested with MOS 9 ISO #48.

After installing the LMA alerting plugin [1] (and tweaking the metadata.yaml file to support liberty-9.0...), I get this error when deploying a fresh environment:

 [7f7b1d137880] (base) Error during execution of deployment task on environment '2': This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (psycopg2.DataError) value too long for type character varying(25)
 [SQL: 'INSERT INTO ip_addrs (network, node, ip_addr, vip_name, vip_namespace, is_user_defined) VALUES (%(network)s, %(node)s, %(ip_addr)s, %(vip_name)s, %(vip_namespace)s, %(is_user_defined)s) RETURNING ip_addrs.id'] [parameters: {'node': None, 'ip_addr': '10.109.1.6', 'network': 7, 'is_user_defined': False, 'vip_namespace': None, 'vip_name': u'infrastructure_alerting_mgmt_vip'}]
[pid: 23104|app: 0|req: 167/743] 10.109.0.1 () {48 vars in 863 bytes} [Mon Feb 29 16:11:38 2016] PUT /api/clusters/2/changes => generated 642 bytes in 311 msecs (HTTP/1.1 500) 4 headers in 197 bytes (2 switches on core 0)
[pid: 23102|app: 0|req: 329/744] 10.109.0.1 () {44 vars in 824 bytes} [Mon Feb 29 16:11:42 2016] GET /api/nodes/allocation/stats?_=1456762099006 => generated 30 bytes in 26 msecs (HTTP/1.1 200) 4 headers in 185 bytes (2 switches on core 0)
[pid: 23102|app: 0|req: 330/745] 10.109.0.1 () {44 vars in 806 bytes} [Mon Feb 29 16:11:43 2016] GET /api/notifications?_=1456762099007 => generated 4967 bytes in 10 msecs (HTTP/1.1 200) 4 headers in 185 bytes (2 switches on core 0)
[pid: 23102|app: 0|req: 331/746] 10.109.0.1 () {44 vars in 804 bytes} [Mon Feb 29 16:11:46 2016] GET /api/logs/sources?_=1456762099008 => generated 46292 bytes in 6 msecs (HTTP/1.1 200) 4 headers in 185 bytes (2 switches on core 0)

As I understand it, there was no limit on this field in MOS 8...

[1] https://github.com/openstack/fuel-plugin-lma-infrastructure-alerting

Éric Lemoine (elemoine) wrote :

The bug title refers to vip_namespace as the too long name. Isn't it vip_name instead?

Nastya Urlapova (aurlapova) wrote :

@Simon, are you sure that this issue should be in Fuel space?

Changed in fuel:
status: New → Incomplete
Simon Pasquier (simon-pasquier) wrote :

@Eric, you're correct.

@Nastya, yes this is a Fuel bug IMO. Here is the link [1] to the code that introduces the regression.

[1] https://github.com/openstack/fuel-web/blob/72499871b7a0c89915d4fa5d91d12b332e0c9624/nailgun/nailgun/db/migration/alembic_migrations/versions/fuel_9_0.py#L488-L493

summary: - LMA alerting plugin fails to deploy because vip_namespace is too long
+ LMA alerting plugin fails to deploy because vip_namespace/vip_name is
+ too long
Simon Pasquier (simon-pasquier) wrote :

@Eric but the same issue can arise for the vip_namespace field.

Swann Croiset (swann-w) wrote :

Whatever the resolution/state of this issue, this bug must be linked to fuel-plugins project to align plugin check validation with the length restriction

tags: added: feature-plugins
Dmitry Pyzhov (dpyzhov) on 2016-03-10
Changed in fuel:
milestone: none → 9.0
assignee: nobody → Fuel Python Team (fuel-python)
tags: added: area-python
tags: added: team-network
Aleksandr Didenko (adidenko) wrote :

Confirmed.
8.0 - vip_type | character varying(50) |
9.0 - vip_name | character varying(25) |

Changed in fuel:
importance: Undecided → High
status: Incomplete → Confirmed
assignee: Fuel Python Team (fuel-python) → Artem Roma (aroma-x)
Aleksey Kasatkin (alekseyk-ru) wrote :

In 7.0, 8.0 DB was created with vip_type: character varying(50). In 9.0 - with vip_type: character varying(25). It is a result of messing with vip_type length in model: https://github.com/openstack/fuel-web/blob/stable/7.0/nailgun/nailgun/db/sqlalchemy/models/network.py#L35 It was always set to 25 in model.
In 9.0 migration was written on the base of length that is present in model. So, it became 25 both in DB and in model. Now we can set it to 50 in both places if it makes sense or leave it as is (25 in both places).

Aleksey Kasatkin (alekseyk-ru) wrote :

* "vip_type" was changed to "vip_name" in 9.0

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

Changed in fuel:
status: Confirmed → In Progress

Reviewed: https://review.openstack.org/292501
Committed: https://git.openstack.org/cgit/openstack/fuel-web/commit/?id=b71c751debdec117d431446b2add03c5d0e5f933
Submitter: Jenkins
Branch: master

commit b71c751debdec117d431446b2add03c5d0e5f933
Author: Artem Roma <email address hidden>
Date: Mon Mar 14 18:43:13 2016 +0200

    Extend length of vip_name and vip_namespace fields of IPAddr entity

    Change-Id: If7b239873cdf520936e46f994dc7750ea8ca8610
    Closes-Bug: #1551320

Changed in fuel:
status: In Progress → Fix Committed
tags: added: on-verification
tags: removed: on-verification
no longer affects: fuel-plugins
Maksym Strukov (unbelll) wrote :

Verified by Simon

Changed in fuel:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers