Bug #30498
closedAPI PING request return "status": "ok" even if there is a service in state failed
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1835122
Description of problem:
When requesting information in the API PING to check the status of the satellite on resources:
- GET /api/ping Shows status of Satellite system and it's subcomponents
- GET /api/statuses Shows status and version information of Satellite system and it's subcomponents
- GET /katello/api/ping Shows status of Katello system and it's subcomponents
Return Status "OK", and it shouldn't.
Version-Release number of selected component (if applicable):
Satellite 6.6 and 6.7
How reproducible:
Check API ping with a curl o accessing in a browser.
Steps to Reproduce:
---Sat 6.7---- curl --request GET --insecure --user sat_username:sat_password https://satellite.example.com/api/statuses | python -m json.tool
- curl --request GET --insecure --user sat_username:sat_password https://satellite.example.com/api/ping | python -m json.tool
- curl --request GET --insecure https://satellite.example.com/katello/api/ping | python -m json.tool
- curl --request GET --insecure https://satellite.example.com/katello/api/status | python -m json.tool
Actual results:
{
"services": {
"candlepin": {
"duration_ms": "26",
"status": "ok"
},
"candlepin_auth": {
"duration_ms": "20",
"status": "ok"
},
"candlepin_events": {
"duration_ms": "0",
"message": "0 Processed, 0 Failed",
"status": "ok"
},
"foreman_tasks": {
"duration_ms": "6",
"status": "ok"
},
"katello_events": {
"duration_ms": "0",
"message": "5 Processed, 0 Failed",
"status": "ok"
},
"pulp": {
"message": "Not all necessary pulp workers running at https://satellite.example.com/pulp/api/v2.",
"status": "FAIL"
},
"pulp_auth": {
"message": "Skipped pulp_auth check after failed pulp check",
"status": "FAIL"
}
},
"status": "ok"
}
Expected results:
{
"services": {
"candlepin": {
"duration_ms": "26",
"status": "ok"
},
"candlepin_auth": {
"duration_ms": "20",
"status": "ok"
},
"candlepin_events": {
"duration_ms": "0",
"message": "0 Processed, 0 Failed",
"status": "ok"
},
"foreman_tasks": {
"duration_ms": "6",
"status": "ok"
},
"katello_events": {
"duration_ms": "0",
"message": "5 Processed, 0 Failed",
"status": "ok"
},
"pulp": {
"message": "Not all necessary pulp workers running at https://satellite.example.com/pulp/api/v2.",
"status": "FAIL"
},
"pulp_auth": {
"message": "Skipped pulp_auth check after failed pulp check",
"status": "FAIL"
}
},
"status": "Nok"
}
Additional info: