Satellite upgrade fails with 'Hammer configuration failed: Incorrect credential for <target_ID> user'

Solution Verified - Updated

Environment

  • Red Hat Satellite 6

Issue

  • While running the upgrade check, it fails with the following error:

      [root@satellite ~]# satellite-maintain upgrade check --target-version 6.11.z
      Checking for new version of satellite-maintain...
      Nothing to update, can't find new version of satellite-maintain.
      Running preparation steps required to run the next scenarios
      ================================================================================
      Setup hammer:
      Configuring Hammer CLI...
      Hammer admin password:
                                                                          [FAIL]
      Hammer configuration failed: Incorrect credential for <target_ID> user.
      --------------------------------------------------------------------------------`
      Check whether system has any non Red Hat repositories (e.g.: EPEL) enabled:
      \ Checking repositories enabled on the system                         [OK]
      --------------------------------------------------------------------------------`
      Scenario [preparation steps required to run the next scenarios] failed.
    
      The following steps ended up in failing state:
    
        [hammer-setup]
    
      Resolve the failed steps and rerun the command.
    
      If the situation persists and, you are unclear what to do next,
      contact Red Hat Technical Support.
    
      In case the failures are false positives, use
      --whitelist="hammer-setup"
    

Resolution

  • Ensure the target ID exists (see the Diag Step in the bottom) and if not, create it:

    # hammer user create --admin True --login <target_ID> --password <password> --auth-source Internal --mail <Email>
    User <target_id> created.
    
  • Ensure the same target ID exists in /root/.hammer/cli.modules.d/foreman.yml (see the Diag step in the bottom) and if not, modify the file

  • Ensure the password entered in /root/.hammer/cli.modules.d/foreman.yml is the same as the password used to login the Satellite web UI.

  • Ensure that the /etc/hosts file contains the correct entry for the Satellite server. Verify that the IP address specified is accurate.

  • If it does not work, reset the Satellite admin password and ensure /root/.hammer/cli.modules.d/foreman.yml file updated with the latest password.

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

Root Cause

  • When reviewing the /root/.hammer/cli.modules.d/foreman.yml file, there is an existing admin and password that does not match the one that was created during the Satellite installer.
  • If there are any special characters in the password, it can also cause this error sometimes.
  • If the target ID is inadvertently removed.
  • An incorrect entry in the /etc/hosts file for the Satellite server can lead to this issue.

Diagnostic Steps

  • Check if the target ID exists within the Satellite - Replace 'admin' if the target id is different:

    # hammer --csv user list | grep admin
    1,admin,Admin User,email,true,false,2023/08/22 17:27:22,Internal
    
  • Check if the same target ID and password are shown in /root/.hammer/cli.modules.d/foreman.yml

    # grep username -A1 /root/.hammer/cli.modules.d/foreman.yml 
      :username: 'admin'
      :password: 'xxxxxx'
    
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.