Bug 1350230 - Define to long name to the affinity label raise exception under engine.log
Summary: Define to long name to the affinity label raise exception under engine.log
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: Backend.Core
Version: 4.0.0
Hardware: x86_64
OS: Linux
high
medium
Target Milestone: ovirt-4.1.0-alpha
: 4.1.0.2
Assignee: Jenny Tokar
QA Contact: Artyom
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-06-26 15:18 UTC by Artyom
Modified: 2017-02-01 14:38 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: The label length was not checked. Consequence: The label save action would fail on the database commit with an unclear error, since the name was too long for what was defined. Fix: Add validation for the length in the code. Result: When trying to add label with a name that is too long the action fails with a clear error.
Clone Of:
Environment:
Last Closed: 2017-02-01 14:38:56 UTC
oVirt Team: SLA
Embargoed:
rule-engine: ovirt-4.1+
mgoldboi: planning_ack+
rgolan: devel_ack+
mavital: testing_ack+


Attachments (Terms of Use)
engine log (5.15 MB, text/plain)
2016-06-26 15:18 UTC, Artyom
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 60477 0 master MERGED core: Validate affinity label name length 2016-07-28 09:42:21 UTC

Description Artyom 2016-06-26 15:18:17 UTC
Created attachment 1172587 [details]
engine log

Description of problem:
Define to long name to the affinity label raise exception under engine.log

Version-Release number of selected component (if applicable):
rhevm-4.0.0.6-0.1.el7ev.noarch

How reproducible:
Always

Steps to Reproduce:
1. Create affinity label with name bigger than 50 characters
2.
3.

Actual results:
[Internal Engine Error]
2016-06-26 11:15:03,301 ERROR [org.ovirt.engine.core.bll.AddLabelCommand] (default task-15) [774b037d] Exception: org.springframework.dao.DataIntegrityViolationException: CallableStatementCallback; SQL [{call createlabel(?, ?, ?, ?, ?)}]; ERROR: value too long for type character varying(50)


Expected results:
Validation error under engine and no exceptions under engine log

Additional info:

Comment 1 Sandro Bonazzola 2016-12-12 13:57:52 UTC
The fix for this issue should be included in oVirt 4.1.0 beta 1 released on December 1st. If not included please move back to modified.

Comment 2 Artyom 2016-12-13 14:43:44 UTC
Verified ovirt-engine-4.1.0-0.2.master.20161212172238.gitea103bd.el7.centos.noarch

Error message:
<fault>
<detail>[An affinity label name must be 1-50 characters long., Attribute: label.name]</detail>
<reason>Operation Failed</reason>
 </fault>

No exception under the engine log


Note You need to log in before you can comment on or make changes to this bug.