Hammer fails with Association not found for location in Red Hat Satellite 6.

Solution Verified - Updated

Environment

  • Red Hat Satellite 6.x.
  • Hammer.

Issue

  • When trying to execute a Hammer command it fails with:
[root@satellite6 ~]# hammer virt-who-config deploy --id 1 --organization-id 1
Could not deploy the Virt Who configuration:
       Association not found for location

Resolution

  • Verify if there are any defaults set for Hammer specifically relating to Organizations and Locations:
[root@satellite6 ~]# hammer defaults list
[root@satellite6 ~]# cat ~/.hammer/defaults.yml
  • After making appropriate changes with regards to the default Organization/Location set in ~/.hammer/defaults.yml the Hammer utility works just fine.

  • Red Hat Satellite 6.5 provides a --no-use-defaults switch to by-pass the default settings:

[root@satellite6.5 ~]# hammer --no-use-defaults virt-who-config deploy --id 1 --organization-id 1

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

Root Cause

  • Hammer has a default Organization(depending on the situation) or Location set which it reads every time while executing a command.
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.