"hammer auth-source ldap list" shows "404 Resource Not Found"

Solution Verified - Updated

Environment

  • Red Hat Satellite 6.3

Issue

  • Attempting to return a list of the authentication sources using the hammer command as below results in:
# hammer auth-source ldap list

404 Resource Not Found

Resolution


[root@satellite ~]# hammer defaults list
-

PARAMETER       | VALUE
-|-
organization_id | 1    

location_id     | 1    
-|-

[root@satellite ~]# hammer defaults delete --param-name organization_id
[root@satellite ~]# hammer defaults delete --param-name location_id

NOTE: Remove all the defaults that are listed with hammer defaults list command output.

For more KB articles/solutions related to Red Hat Satellite 6.x hammer Issues, please refer to the Consolidated Troubleshooting Article for Red Hat Satellite 6.x hammer-related Issues

For more KB articles/solutions related to Red Hat Satellite 6.x Authentication Issues, please refer to the Consolidated Troubleshooting Article for Red Hat Satellite 6.x Authentication Issues

Root Cause

  • The below API is being called when running the command hammer auth-source ldap list :
GET /api/organizations/1/auth_source_ldaps 

This API call is incorrect, it should be /api/auth_source_ldaps

  • Default values set with hammer is the root cause of this issue.

Diagnostic Steps

  • Executing hammer command with debug option :
# hammer -d auth-source ldap list

[ INFO 2018-05-21 13:23:19 API] Server: https://satellite.example.com
[ INFO 2018-05-21 13:23:19 API] **GET /api/organizations/1/auth_source_ldaps**
[DEBUG 2018-05-21 13:23:19 API] Params: {
        "page" => 1,
    "per_page" => 1000
}
[DEBUG 2018-05-21 13:23:19 API] Headers: {
    :params => {
            "page" => 1,
        "per_page" => 1000
    }
}
[DEBUG 2018-05-21 13:23:19 API] Using authenticator: HammerCLIForeman::Api::InteractiveBasicAuth
[ERROR 2018-05-21 13:23:19 API] 404 Resource Not Found
[DEBUG 2018-05-21 13:23:19 API] {
    "status" => "404",
     "error" => "Not Found"
}
[DEBUG 2018-05-21 13:23:19 Exception] Using exception handler HammerCLIForeman::ExceptionHandler#handle_not_found
[ERROR 2018-05-21 13:23:19 Exception] 404 Resource Not Found
404 Resource Not Found
[ERROR 2018-05-21 13:23:19 Exception] 
SBR
Product(s)
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.