Bug 1317787 - if the OS version has only major version, the REST logs an exception
Summary: if the OS version has only major version, the REST logs an exception
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: RestAPI
Version: 3.6.3
Hardware: Unspecified
OS: Unspecified
unspecified
high vote
Target Milestone: ovirt-3.6.4
: 3.6.4
Assignee: Juan Hernández
QA Contact: Petr Matyáš
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-15 08:35 UTC by Tomas Jelinek
Modified: 2016-04-05 13:54 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-04-05 13:54:06 UTC
oVirt Team: Infra
rule-engine: ovirt-3.6.z+
mgoldboi: planning_ack+
juan.hernandez: devel_ack+
pstehlik: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 54423 0 None MERGED restapi: Don't fail with unexpected version numbers 2021-02-09 19:01:16 UTC

Description Tomas Jelinek 2016-03-15 08:35:30 UTC
If the OS version reported by guest agent does not contain a minor version, the /api/vms prints a stack trace to the logs containing:

2016-03-15 10:03:42,945 ERROR [org.ovirt.engine.api.restapi.types.VersionMapper] (ajp-/127.0.0.1:8702-104) [] Failed to map version string minor component: java.lang.NumberFormatException: For input string: ""
         at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) [rt.jar:1.7.0_95]
         at java.lang.Integer.parseInt(Integer.java:504) [rt.jar:1.7.0_95]
         at java.lang.Integer.parseInt(Integer.java:527) [rt.jar:1.7.0_95]
         at org.ovirt.engine.api.restapi.types.VersionMapper.fromVersionString(VersionMapper.java:82) [restapi-types.jar:]
         at org.ovirt.engine.api.restapi.types.VmMapper.map(VmMapper.java:457) [restapi-types.jar:]
         at org.ovirt.engine.api.restapi.types.VmMapper.map(VmMapper.java:330) [restapi-types.jar:]
         at sun.reflect.GeneratedMethodAccessor274.invoke(Unknown Source) [:1.7.0_95]
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_95]
         at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_95]
         at org.ovirt.engine.api.restapi.types.MappingLocator$MethodInvokerMapper.map(MappingLocator.java:150) [restapi-types.jar:]

The problem is that all the Fedora have only major versions (e.g. 23). If you have lots of VMs in the system like this, the log is than full of this stack traces.

It is not a functional mistake since the returned version is correct (e.g. <version major="23" full_version="23"/>" but if you have couple of hundreds of VMs like this, the log becomes unreadable.

Comment 1 Juan Hernández 2016-03-15 08:43:26 UTC
This is very similar to bug 1311616, which will be fixed in 3.6.4. However the solution includes sending a warning to the log, something like this:

---8<---
The version string "23" doesn't match the expected pattern, only the full version will be reported.
--->8---

Maybe we should make that a debug message instead of a warning.

Comment 2 Juan Hernández 2016-03-15 08:47:28 UTC
Well, actually a number like "23" won't produce the warning, but other things like "v23" will. I think we can close this bug open, just to verify that.

Comment 3 Petr Matyáš 2016-03-17 16:01:23 UTC
Verified on 3.6.4-1


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