Bug 962666 - Wrong user-defined custom properties prevent engine from loading
Wrong user-defined custom properties prevent engine from loading
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine (Show other bugs)
3.2.0
Unspecified Unspecified
unspecified Severity unspecified
: ---
: 3.3.0
Assigned To: Martin Perina
Artyom
infra
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-14 04:06 EDT by Gilad Chaplik
Modified: 2016-02-10 14:43 EST (History)
13 users (show)

See Also:
Fixed In Version: is2
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-01-21 17:17:00 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Infra
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 14914 None None None Never

  None (edit)
Description Gilad Chaplik 2013-05-14 04:06:28 EDT
Description of problem:
Wrong user-defined custom properties prevent engine from loading

How reproducible:
100%

Steps to Reproduce:
Enter UserDefinedVMProperties containing chars other then ';', '=', ,[a-z_A-Z0-9]
  
Actual results:
Backend fail to load

Expected results:
Proper error, or ignoring that property.
Comment 1 Gilad Chaplik 2013-05-14 04:36:22 EDT
> Enter UserDefinedVMProperties containing chars other then ';', '=',
> ,[a-z_A-Z0-9]
>   

other than... :/
Comment 3 Martin Perina 2013-05-14 07:22:49 EDT
Moti told me, that there's no UserDefinedVMProperties validator defined in engine-config tool. I will create such validator for UserDefinedVMProperties (so only valid properties could be entered) as soon as device custom properties patch will be ready, because it changes many things in VMPropertiesUtils class.
Comment 4 Yair Zaslavsky 2013-05-19 04:56:04 EDT
(In reply to comment #3)
> Moti told me, that there's no UserDefinedVMProperties validator defined in
> engine-config tool. I will create such validator for UserDefinedVMProperties
> (so only valid properties could be entered) as soon as device custom
> properties patch will be ready, because it changes many things in
> VMPropertiesUtils class.

I agree with this path.
Can you please asses how long it will take you to come up with such validator (based on the fact you need to require a validator for custom device properties)
Comment 6 Artyom 2013-08-25 07:56:32 EDT
Please write exactly what you write under UserDefinedVMProperties, that after this engine stack?
Enter special characters, also tried Russian symbols, engine work fine and do restart without problem  
rhevm-config -s UserDefinedVMProperties='test=$%2as'
Please select a version:
1. 3.0
2. 3.1
3. 3.2
4. 3.3
4
[root@artyom-rhevm-33 ~]# rhevm-config -g UserDefinedVMProperties
UserDefinedVMProperties:  version: 3.0
UserDefinedVMProperties:  version: 3.1
UserDefinedVMProperties:  version: 3.2
UserDefinedVMProperties: test=$%2as version: 3.3
[root@artyom-rhevm-33 ~]# service ovirt-engine restart
Stopping oVirt Engine:                                     [  OK  ]
Starting oVirt Engine:                                     [  OK  ]
[root@artyom-rhevm-33 ~]# rhevm-config -s UserDefinedVMProperties='test=фыв'
Please select a version:
1. 3.0
2. 3.1
3. 3.2
4. 3.3
4
[root@artyom-rhevm-33 ~]# service ovirt-engine restart
Stopping oVirt Engine:                                     [  OK  ]
Starting oVirt Engine:                                     [  OK  ]
[root@artyom-rhevm-33 ~]# rhevm-config -g UserDefinedVMProperties
UserDefinedVMProperties:  version: 3.0
UserDefinedVMProperties:  version: 3.1
UserDefinedVMProperties:  version: 3.2
UserDefinedVMProperties: test=фыв version: 3.3

also create vm with this custom parameter

about patch, still no any validation on input for rhevm-config -s UserDefinedVMProperties
Comment 7 Martin Perina 2013-08-27 05:53:18 EDT
All your tests contains only valid characters for property definition. Currently there are these rules for properties:

1) Property name can contain only upper/lower case, number or underscore
2) Property value can contain every characters except semicolon

So if you try following examples, you will receive validation errors, but before patch 14914, those values would be ok, but engine wouldn't start:

engine-config -s UserDefinedVMProperties='te#st=1'
engine-config -s UserDefinedVMProperties='test=1;3'


But watch out for this example:

engine-config -s UserDefinedVMProperties='test=1;'

This one will not throw an error, because semicolon is used as property definition delimiter, so property with name 'test' and value '1' will be created.
Comment 8 Artyom 2013-09-01 02:34:53 EDT
Trying examples from comment above receive message:
"Cannot set value test=1;3 to key UserDefinedVMProperties. Invalid syntax, user defined VM properties specification should conform to (([a-z_A-Z0-9])+)=(([^;])+)(;(([a-z_A-Z0-9])+)=(([^;])+))*;?"
Verified on is12
Comment 9 Itamar Heim 2014-01-21 17:17:00 EST
Closing - RHEV 3.3 Released
Comment 10 Itamar Heim 2014-01-21 17:23:40 EST
Closing - RHEV 3.3 Released

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