Ansible Automation controller fails to download collections from Private Automation hub web UI
Environment
- Red Hat Ansible Automation Platform 2.5
Issue
- In Ansible Automation Platform 2.5, Automation Controller fails to download collections from Private Automation hub web UI with
HTTP Error 401: Unauthorized error
Resolution
-
The existing or pre-populated Galaxy Server URL will point to Automation Hub fqdn. Modify the galaxy credentials to point platform gateway fqdn.
Platform Gateway Web UI -> Infrastructure -> Credentials -> Modify the Galaxy Server URL to point `Gateway fqdn` for Ansible Galaxy/Automation Hub API Token credential
-
There is already an internal JIRA (AAP-35782) raised for the issue and it has been highlighted to Engineering team. Meanwhile the above workaround can be followed in order to fetch the PAH collection for controller project sync.
Root Cause
- The installer code creates the credentials with the PAH URL, which results in a project sync failure while downloading the collection dynamically from PAH web UI.
Diagnostic Steps
-
The following error can be observed while syncing the project at Automation Controller web UI as the installer creates the credentials with the PAH URL:
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["ansible-galaxy", "install", "-r", "/var/lib/awx/projects/_8__motd_git/requirements.yml"], "delta": "0:00:01.673411", "end": "2024-11-01 04:49:13.797971", "msg": "non-zero return code", "rc": 1, "start": "2024-11-01 04:49:12.124560", "stderr": "[DEPRECATION WARNING]: ANSIBLE_COLLECTIONS_PATHS option, does not fit var \nnaming standard, use the singular form ANSIBLE_COLLECTIONS_PATH instead. This \nfeature will be removed from ansible-core in version 2.19. Deprecation warnings\n can be disabled by setting deprecation_warnings=False in ansible.cfg.\nERROR! Failed to download collection tar from 'server0' due to the following unforeseen error: HTTP Error 401: Unauthorized. HTTP Error 401:
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.
Comments