Bug 2067104 - NullPointerException while attempt to add a host using wrong affinity group ID
Summary: NullPointerException while attempt to add a host using wrong affinity group ID
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Virt
Version: 4.5.0
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: ovirt-4.5.2
: 4.5.2
Assignee: Shmuel Melamud
QA Contact: Polina
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-03-23 10:23 UTC by Polina
Modified: 2022-08-30 08:47 UTC (History)
3 users (show)

Fixed In Version: ovirt-engine-4.5.2
Clone Of:
Environment:
Last Closed: 2022-08-30 08:47:42 UTC
oVirt Team: Virt
Embargoed:
sbonazzo: ovirt-4.5+


Attachments (Terms of Use)
engine log (430.41 KB, application/gzip)
2022-03-23 10:23 UTC, Polina
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github oVirt ovirt-engine pull 552 0 None open core: Fix NPE on invalid affinity group ID 2022-07-25 03:01:35 UTC
Red Hat Issue Tracker RHV-45415 0 None None None 2022-03-23 10:43:31 UTC

Description Polina 2022-03-23 10:23:41 UTC
Created attachment 1867750 [details]
engine log

Description of problem:
Adding host by REST API to the affinity group with wrong ID fails with NullPointerException trace instead of normal error (400 or 404) saying about wrong affinity group id

Version-Release number of selected component (if applicable):
ovirt-engine-4.5.0.1-601.f26e9ea8cac5.3.el8ev.noarch

How reproducible:100%


Steps to Reproduce:
POST https://{{host}}/ovirt-engine/api/clusters/{clusterId}/affinitygroups/{affinitygroupID_WRONG}/hosts
body:
<host><name>host_mixed_2</name></host>

Actual results: 500 Internal error with NullPointerException trace in log
Error during ValidateFailure.: java.lang.NullPointerException
        at deployment.engine.ear.bll.jar//org.ovirt.engine.core.bll.scheduling.commands.AffinityGroupCRUDCommand.getClusterId(AffinityGroupCRUDCommand.java:205)
......


Expected results: either 404 (entity not found) or 400 (bad request )


Additional info:

Comment 1 Polina 2022-08-02 11:06:52 UTC
verified on ovirt-engine-4.5.2-0.3.el8ev.noarch
now we get 404 response on such request and no NullPointerException.

Comment 2 Sandro Bonazzola 2022-08-30 08:47:42 UTC
This bugzilla is included in oVirt 4.5.2 release, published on August 10th 2022.
Since the problem described in this bug report should be resolved in oVirt 4.5.2 release, it has been closed with a resolution of CURRENT RELEASE.
If the solution does not work for you, please open a new bug report.


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