Bug 1724632

Summary: When setting high custom compatibility version with ovirt_vm, java exception is returned
Product: [oVirt] ovirt-engine Reporter: Jan Zmeskal <jzmeskal>
Component: RestAPIAssignee: Ori Liel <oliel>
Status: CLOSED CURRENTRELEASE QA Contact: Pavol Brilla <pbrilla>
Severity: low Docs Contact:
Priority: unspecified    
Version: 4.3.0CC: bugs, dfodor, lleistne, mperina
Target Milestone: ovirt-4.4.0Flags: pm-rhel: ovirt-4.4+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rhv-4.4.0-29 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-16 10:36:55 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jan Zmeskal 2019-06-27 12:53:54 UTC
Description of problem:
I was using custom_compatibility_version parameter of ovirt_vm module to set custom compatibility version of a VM to value higher than engine's version. I had engine of version 4.3 and set custom compatibility version to 4.4. This of course shouldn't work and that's all right. However, if use attempts it, they should get back some sensible error message from Ansible. Meanwhile, I got this:

fatal: [localhost]: FAILED! => {"changed": false, "msg": "Fault reason is \"Operation Failed\". Fault detail is \"java.lang.NullPointerException\". HTTP response code is 500."}


Version-Release number of selected component (if applicable):
ansible 2.8.1
rhvm-4.3.5.1-0.1.el7.noarch

How reproducible:
100 %

Steps to Reproduce:
1. Have a VM in your 4.3 engine (test_vm in our case)
2. Run this playbook:

- name: Try setting too high custom compatibility version
  hosts: localhost
  tasks:
    
    - name: Obtain SSO token with using username/password credentials
      ovirt_auth:
        url: https://<your_engine>/ovirt-engine/api
        username: admin@internal
        password: '<your_pass>'
        insecure: yes 

    - name: Set custom compatibility version
      ovirt_vm:
        auth: "{{ ovirt_auth }}"
        name: test_vm
        custom_compatibility_version: 4.4 

Actual results:
java.lang.NullPointerException is returned

Expected results:
Some informative, user-friendly message should be returned

Comment 1 Martin Perina 2019-06-28 08:37:35 UTC
Could you please add engine logs? NPE looks like there is issue in the engine rather than Ansible modules ...

Comment 3 Martin Perina 2019-06-28 11:40:35 UTC
It's RESTAPI issue moving to engine

Comment 5 Lukas Svaty 2020-04-16 10:36:55 UTC
Closing low severity bugs, based on QE capacity, if you would like to still verify this issue please reopen.