Bug 1294334

Summary: [PreFix] - There is no validation for "/" string in the Netmask filed in UI and it ends up with 'Internal engine error' and exception in engine log
Product: [oVirt] ovirt-engine Reporter: Michael Burman <mburman>
Component: BLL.NetworkAssignee: Marcin Mirecki <mmirecki>
Status: CLOSED CURRENTRELEASE QA Contact: Michael Burman <mburman>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.6.2CC: bugs, danken, myakove, ylavi
Target Milestone: ovirt-4.0.6Flags: rule-engine: ovirt-4.0.z+
rule-engine: ovirt-4.1+
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-01-18 07:25:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Network RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
engine log none

Description Michael Burman 2015-12-27 08:54:35 UTC
Created attachment 1109786 [details]
engine log

Description of problem:
[PreFix] - There is no validation for "/" string in the Netmask field in UI and it ends up with 'Internal engine error' and exception in engine log.

"Error while executing action HostSetupNetworks: Internal Engine Error"

engine.log -->

2015-12-27 10:40:58,444 ERROR [org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand] (ajp-/127.0.0.1:8702-13) [4f1f75fb] Command 'org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand' failed:
 For input string: "/25"
2015-12-27 10:40:58,444 ERROR [org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand] (ajp-/127.0.0.1:8702-13) [4f1f75fb] Exception: java.lang.NumberFormatException: For input string: "/25"
        at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) [rt.jar:1.8.0_51]

- "/" was a valid string for the new RFE - 1012881
for example, it was valid to enter /24 or /32 in the Netmask field in the network's edit dialog in Setup network, but now, because it was a valid string, there is no validation for this string, but in the last 3.6.2 build it ends up with internal engine error and exceptions in engine log ^^ 

- "/" should not be a valid string any more, there should be a validation for this string, like we have for all other non-valid strings in this field and the field should be marked in red. 
- We should no see any engine errors and exceptions in engine log.  

Version-Release number of selected component (if applicable):
3.6.2-0.1.el6

How reproducible:
100

Steps to Reproduce:
1. Create network and attach to host via Setup networks dialog
2. Edit the network and enter /24 in the Netmask / Routing Prefix: field
3. Approve operation

Actual results:
Exception in engine log ends up with internal engine error
No validation for '/' string, because it used to be a valid value in older 3.6.z versions.
See BZ - 1012881

Expected results:
There should be validation for '/' string and it shouldn't be a valid value any more for prefix. Only 0-32
In case of '/' string, the field should be colored in red.

Additional info:

Comment 1 Red Hat Bugzilla Rules Engine 2015-12-27 15:18:07 UTC
Bug tickets must have version flags set prior to targeting them to a release. Please ask maintainer to set the correct version flags and only then set the target milestone.

Comment 2 Dan Kenigsberg 2016-03-27 09:35:42 UTC
The bugs do not really depend, but they are confusingly similar

Comment 3 Yaniv Lavi 2016-03-27 12:26:36 UTC
(In reply to Dan Kenigsberg from comment #2)
> The bugs do not really depend, but they are confusingly similar

So moving to see also

Comment 4 Sandro Bonazzola 2016-05-02 09:49:47 UTC
Moving from 4.0 alpha to 4.0 beta since 4.0 alpha has been already released and bug is not ON_QA.

Comment 5 Yaniv Lavi 2016-05-23 13:14:01 UTC
oVirt 4.0 beta has been released, moving to RC milestone.

Comment 6 Michael Burman 2016-12-08 09:04:58 UTC
It is now optional to use the '/' string again.
Engine will accept '/24' and '24' in the Routing Prefix filed in the edit network dialog.

Verified on - 4.0.6.2-0.1.el7ev