Bug 1852897

Summary: API - ISE when using invalid status type
Product: Red Hat Satellite Reporter: Lukáš Hellebrandt <lhellebr>
Component: HostsAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: tstrych
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.8.0CC: apatel, inecas, oezr, pcreech
Target Milestone: 6.11.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-07-05 14:28:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Lukáš Hellebrandt 2020-07-01 14:30:53 UTC
Description of problem:
"/api/hosts/:id/status" endpoints have been removed in bug 1791656. They were replaced by "/api/hosts/:id/status/:type" where type is either "configuration" or "build". When anything other is used for type, ISE occurs.

Version-Release number of selected component (if applicable):
Sat 6.8 snap 6.0.

How reproducible:
Deterministic

Steps to Reproduce:
1. # curl -H "Content-Type:application/json" -X GET -k -u admin:<password> https://<fqdn>/api/hosts/1/status/nonexistent
{"status":500,"error":"Internal Server Error"}

Actual results:
ISE

Expected results:
Sanely handled error or 404

Comment 1 Ondřej Ezr 2021-05-06 08:55:26 UTC
Created redmine issue https://projects.theforeman.org/issues/32536 from this bug

Comment 2 Bryan Kearney 2021-05-31 16:04:53 UTC
Upstream bug assigned to ymakias

Comment 3 Bryan Kearney 2021-05-31 16:04:56 UTC
Upstream bug assigned to ymakias

Comment 4 Bryan Kearney 2021-06-01 16:05:03 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/32536 has been resolved.

Comment 6 tstrych 2022-02-01 14:05:04 UTC
Verified with sat 7.0 with snap 7.0 

# curl -H "Content-Type:application/json" -X GET -k -u admin:<password> https://<fqdn>/api/hosts/1/status/nonexistent
result: {"error":"Status nonexistent does not exist."}

Comment 9 errata-xmlrpc 2022-07-05 14:28:21 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: Satellite 6.11 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:5498