[Galaxy] Unable to get access token (HTTP Code: 400, Message: Bad Request)

ansible-core: 2.21.5
ansible-builder: 3.2.0

Since a few days, I am unable to build new execution environments with the command

ansible-builder build --container-runtime=docker --context="/ee/context" --file="/ee/files/definition/file.yml" --tag="tag_name:version" -v3
...
#29 [galaxy 6/6] RUN ANSIBLE_GALAXY_DISABLE_GPG_VERIFY=1 ansible-galaxy collection install  -r requirements.yml --collections-path "/usr/share/ansible/collections"
#29 0.641 [WARNING]: Deprecation warnings can be disabled by setting `deprecation_warnings=False` in ansible.cfg.
#29 0.641 [DEPRECATION WARNING]: PARAMIKO_HOST_KEY_AUTO_ADD option. Reason: This option was moved to the plugin itself
#29 0.641 Alternatives: Use the option from the plugin itself. This feature will be removed from ansible-core version 2.20.
#29 0.641 
#29 1.238 [ERROR]: Unable to get access token (HTTP Code: 400, Message: Bad Request)
#29 1.238 
#29 1.238 Traceback (most recent call last):
#29 1.238   File "/usr/local/lib/python3.11/site-packages/ansible/galaxy/token.py", line 91, in get
#29 1.238     resp = open_url(to_native(self.auth_url),
#29 1.238            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#29 1.238   File "/usr/local/lib/python3.11/site-packages/ansible/module_utils/urls.py", line 1018, in open_url
#29 1.238     return Request().open(method, url, data=data, headers=headers, use_proxy=use_proxy,
#29 1.238            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#29 1.238   File "/usr/local/lib/python3.11/site-packages/ansible/module_utils/urls.py", line 922, in open
#29 1.238     r = urllib.request.urlopen(request, None, timeout)
#29 1.238         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#29 1.238   File "/usr/lib64/python3.11/urllib/request.py", line 216, in urlopen
#29 1.238     return opener.open(url, data, timeout)
#29 1.238            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#29 1.238   File "/usr/lib64/python3.11/urllib/request.py", line 525, in open
#29 1.238     response = meth(req, response)
#29 1.238                ^^^^^^^^^^^^^^^^^^^
#29 1.238   File "/usr/lib64/python3.11/urllib/request.py", line 634, in http_response
#29 1.238     response = self.parent.error(
#29 1.238                ^^^^^^^^^^^^^^^^^^
#29 1.238   File "/usr/lib64/python3.11/urllib/request.py", line 563, in error
#29 1.238     return self._call_chain(*args)
#29 1.238            ^^^^^^^^^^^^^^^^^^^^^^^
#29 1.238   File "/usr/lib64/python3.11/urllib/request.py", line 496, in _call_chain
#29 1.238     result = func(*args)
#29 1.238              ^^^^^^^^^^^
#29 1.238   File "/usr/lib64/python3.11/urllib/request.py", line 643, in http_error_default
#29 1.238     raise HTTPError(req.full_url, code, msg, hdrs, fp)
#29 1.238 urllib.error.HTTPError: HTTP Error 400: Bad Request
#29 1.238 
#29 1.238 During handling of the above exception, another exception occurred:
#29 1.238 
#29 1.238 Traceback (most recent call last):
#29 1.238   File "/usr/local/lib/python3.11/site-packages/ansible/galaxy/api.py", line 93, in wrapped
#29 1.238     data = self._call_galaxy(n_url, method='GET', error_context_msg=error_context_msg, cache=True)
#29 1.238            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#29 1.238   File "/usr/local/lib/python3.11/site-packages/ansible/module_utils/api.py", line 168, in run_function
#29 1.238     return call_retryable_function()
#29 1.238            ^^^^^^^^^^^^^^^^^^^^^^^^^
#29 1.238   File "/usr/local/lib/python3.11/site-packages/ansible/galaxy/api.py", line 400, in _call_galaxy
#29 1.238     self._add_auth_token(headers, url, required=auth_required)
#29 1.238   File "/usr/local/lib/python3.11/site-packages/ansible/galaxy/api.py", line 449, in _add_auth_token
#29 1.238     headers.update(self.token.headers())
#29 1.238                    ^^^^^^^^^^^^^^^^^^^^
#29 1.238   File "/usr/local/lib/python3.11/site-packages/ansible/galaxy/token.py", line 115, in headers
#29 1.238     headers['Authorization'] = '%s %s' % (self.token_type, self.get())
#29 1.238                                                            ^^^^^^^^^^
#29 1.238   File "/usr/local/lib/python3.11/site-packages/ansible/galaxy/token.py", line 97, in get
#29 1.238     raise GalaxyError(e, 'Unable to get access token')
#29 1.238 ansible.galaxy.api.GalaxyError: Unable to get access token (HTTP Code: 400, Message: Bad Request)
#29 1.238 
#29 1.238 During handling of the above exception, another exception occurred:
#29 1.238 
#29 1.238 Traceback (most recent call last):
#29 1.238   File "/usr/local/lib/python3.11/site-packages/ansible/galaxy/token.py", line 91, in get
#29 1.238     resp = open_url(to_native(self.auth_url),
#29 1.238            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#29 1.238   File "/usr/local/lib/python3.11/site-packages/ansible/module_utils/urls.py", line 1018, in open_url
#29 1.238     return Request().open(method, url, data=data, headers=headers, use_proxy=use_proxy,
#29 1.238            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#29 1.238   File "/usr/local/lib/python3.11/site-packages/ansible/module_utils/urls.py", line 922, in open
#29 1.238     r = urllib.request.urlopen(request, None, timeout)
#29 1.238         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#29 1.238   File "/usr/lib64/python3.11/urllib/request.py", line 216, in urlopen
#29 1.238     return opener.open(url, data, timeout)
#29 1.238            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#29 1.238   File "/usr/lib64/python3.11/urllib/request.py", line 525, in open
#29 1.238     response = meth(req, response)
#29 1.238                ^^^^^^^^^^^^^^^^^^^
#29 1.238   File "/usr/lib64/python3.11/urllib/request.py", line 634, in http_response
#29 1.238     response = self.parent.error(
#29 1.238                ^^^^^^^^^^^^^^^^^^
#29 1.238   File "/usr/lib64/python3.11/urllib/request.py", line 563, in error
#29 1.238     return self._call_chain(*args)
#29 1.238            ^^^^^^^^^^^^^^^^^^^^^^^
#29 1.238   File "/usr/lib64/python3.11/urllib/request.py", line 496, in _call_chain
#29 1.238     result = func(*args)
#29 1.238              ^^^^^^^^^^^
#29 1.238   File "/usr/lib64/python3.11/urllib/request.py", line 643, in http_error_default
#29 1.238     raise HTTPError(req.full_url, code, msg, hdrs, fp)
#29 1.238 urllib.error.HTTPError: HTTP Error 400: Bad Request
#29 1.238 
#29 1.238 During handling of the above exception, another exception occurred:
#29 1.238 
#29 1.238 Traceback (most recent call last):
#29 1.238   File "/usr/local/lib/python3.11/site-packages/ansible/cli/__init__.py", line 660, in cli_executor
#29 1.238     exit_code = cli.run()
#29 1.238                 ^^^^^^^^^
#29 1.238   File "/usr/local/lib/python3.11/site-packages/ansible/cli/galaxy.py", line 734, in run
#29 1.238     return context.CLIARGS['func']()
#29 1.238            ^^^^^^^^^^^^^^^^^^^^^^^^^
#29 1.238   File "/usr/local/lib/python3.11/site-packages/ansible/cli/galaxy.py", line 102, in method_wrapper
#29 1.238     return wrapped_method(*args, **kwargs)
#29 1.238            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#29 1.238   File "/usr/local/lib/python3.11/site-packages/ansible/cli/galaxy.py", line 1399, in execute_install
#29 1.238     self._execute_install_collection(
#29 1.238   File "/usr/local/lib/python3.11/site-packages/ansible/cli/galaxy.py", line 1448, in _execute_install_collection
#29 1.238     install_collections(
#29 1.238   File "/usr/local/lib/python3.11/site-packages/ansible/galaxy/collection/__init__.py", line 735, in install_collections
#29 1.238     dependency_map = _resolve_depenency_map(
#29 1.238                      ^^^^^^^^^^^^^^^^^^^^^^^
#29 1.238   File "/usr/local/lib/python3.11/site-packages/ansible/galaxy/collection/__init__.py", line 1855, in _resolve_depenency_map
#29 1.238     return collection_dep_resolver.resolve(
#29 1.238            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#29 1.238   File "/usr/local/lib/python3.11/site-packages/resolvelib/resolvers/resolution.py", line 601, in resolve
#29 1.238     state = resolution.resolve(requirements, max_rounds=max_rounds)
#29 1.238             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#29 1.238   File "/usr/local/lib/python3.11/site-packages/resolvelib/resolvers/resolution.py", line 434, in resolve
#29 1.238     self._add_to_criteria(self.state.criteria, r, parent=None)
#29 1.238   File "/usr/local/lib/python3.11/site-packages/resolvelib/resolvers/resolution.py", line 125, in _add_to_criteria
#29 1.238     matches = self._p.find_matches(
#29 1.238               ^^^^^^^^^^^^^^^^^^^^^
#29 1.238   File "/usr/local/lib/python3.11/site-packages/ansible/galaxy/dependency_resolution/providers.py", line 477, in find_matches
#29 1.238     match for match in self._find_matches(list(requirements[identifier]))
#29 1.238                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#29 1.238   File "/usr/local/lib/python3.11/site-packages/ansible/galaxy/dependency_resolution/providers.py", line 253, in _find_matches
#29 1.238     coll_versions = [] if preinstalled_candidates else self._api_proxy.get_collection_versions(first_req)  # type: t.Iterable[t.Tuple[str, GalaxyAPI]]
#29 1.238                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#29 1.238   File "/usr/local/lib/python3.11/site-packages/ansible/galaxy/collection/galaxy_api_proxy.py", line 103, in get_collection_versions
#29 1.238     return set(
#29 1.238            ^^^^
#29 1.238   File "/usr/local/lib/python3.11/site-packages/ansible/galaxy/collection/galaxy_api_proxy.py", line 103, in <genexpr>
#29 1.238     return set(
#29 1.238               ^
#29 1.238   File "/usr/local/lib/python3.11/site-packages/ansible/galaxy/collection/galaxy_api_proxy.py", line 85, in _get_collection_versions
#29 1.238     raise last_error
#29 1.238   File "/usr/local/lib/python3.11/site-packages/ansible/galaxy/collection/galaxy_api_proxy.py", line 64, in _get_collection_versions
#29 1.238     versions = api.get_collection_versions(requirement.namespace, requirement.name)
#29 1.238                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#29 1.238   File "/usr/local/lib/python3.11/site-packages/ansible/galaxy/api.py", line 103, in wrapped
#29 1.238     data = self._call_galaxy(n_url, method='GET', error_context_msg=error_context_msg, cache=True)
#29 1.238            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#29 1.238   File "/usr/local/lib/python3.11/site-packages/ansible/module_utils/api.py", line 168, in run_function
#29 1.238     return call_retryable_function()
#29 1.238            ^^^^^^^^^^^^^^^^^^^^^^^^^
#29 1.238   File "/usr/local/lib/python3.11/site-packages/ansible/galaxy/api.py", line 400, in _call_galaxy
#29 1.238     self._add_auth_token(headers, url, required=auth_required)
#29 1.238   File "/usr/local/lib/python3.11/site-packages/ansible/galaxy/api.py", line 449, in _add_auth_token
#29 1.238     headers.update(self.token.headers())
#29 1.238                    ^^^^^^^^^^^^^^^^^^^^
#29 1.238   File "/usr/local/lib/python3.11/site-packages/ansible/galaxy/token.py", line 115, in headers
#29 1.238     headers['Authorization'] = '%s %s' % (self.token_type, self.get())
#29 1.238                                                            ^^^^^^^^^^
#29 1.238   File "/usr/local/lib/python3.11/site-packages/ansible/galaxy/token.py", line 97, in get
#29 1.238     raise GalaxyError(e, 'Unable to get access token')
#29 1.238 ansible.galaxy.api.GalaxyError: Unable to get access token (HTTP Code: 400, Message: Bad Request)
#29 1.238 
#29 1.238 Starting galaxy collection install process
#29 1.238 Process install dependency map
#29 ERROR: process "/bin/sh -c ANSIBLE_GALAXY_DISABLE_GPG_VERIFY=1 ansible-galaxy collection install $ANSIBLE_GALAXY_CLI_COLLECTION_OPTS -r requirements.yml --collections-path \"/usr/share/ansible/collections\"" did not complete successfully: exit code: 1
------
 > [galaxy 6/6] RUN ANSIBLE_GALAXY_DISABLE_GPG_VERIFY=1 ansible-galaxy collection install  -r requirements.yml --collections-path "/usr/share/ansible/collections":
1.238                    ^^^^^^^^^^^^^^^^^^^^
1.238   File "/usr/local/lib/python3.11/site-packages/ansible/galaxy/token.py", line 115, in headers
1.238     headers['Authorization'] = '%s %s' % (self.token_type, self.get())
1.238                                                            ^^^^^^^^^^
1.238   File "/usr/local/lib/python3.11/site-packages/ansible/galaxy/token.py", line 97, in get
1.238     raise GalaxyError(e, 'Unable to get access token')
1.238 ansible.galaxy.api.GalaxyError: Unable to get access token (HTTP Code: 400, Message: Bad Request)
1.238 
1.238 Starting galaxy collection install process
1.238 Process install dependency map
------
Dockerfile:54
--------------------
  52 |     RUN mkdir -p /usr/share/ansible
  53 |     RUN ansible-galaxy role install $ANSIBLE_GALAXY_CLI_ROLE_OPTS -r requirements.yml --roles-path "/usr/share/ansible/roles"
  54 | >>> RUN ANSIBLE_GALAXY_DISABLE_GPG_VERIFY=1 ansible-galaxy collection install $ANSIBLE_GALAXY_CLI_COLLECTION_OPTS -r requirements.yml --collections-path "/usr/share/ansible/collections"
  55 |     
  56 |     # Builder build stage
--------------------
ERROR: failed to build: failed to solve: process "/bin/sh -c ANSIBLE_GALAXY_DISABLE_GPG_VERIFY=1 ansible-galaxy collection install $ANSIBLE_GALAXY_CLI_COLLECTION_OPTS -r requirements.yml --collections-path \"/usr/share/ansible/collections\"" did not complete successfully: exit code: 1

ansible-builder

same issue with ansible-builder 3.1.0

That error can only happening when attempting to authenticate against console.redhat.com via the ansible-galaxy cli.

The only thing I can recommend is to verify your credentials and that builder is configured to properly inject them.

Except that I don’t use console.redhat.com, at least not knowingly:

version: 3

dependencies:
  ansible_core:
    # Require minimum of 2.15 to get ansible-inventory --limit option
    package_pip: ansible-core
  ansible_runner:
    package_pip: ansible-runner
  galaxy:
    collections:
      - name: ansible.mysql
        ...
  python_interpreter:
    package_system: python311
    python_path: /usr/bin/python3.11
  python:
    - wheel
      ...
  system:
    - bash [platform:rpm]
      ...

additional_build_steps:
  append_base:
    - RUN $PYCMD -m pip install -U pip
    - RUN dnf -y install dnf-plugins-core
    - RUN dnf -y install epel-release epel-next-release
    - RUN dnf -y config-manager --set-enabled crb
    - RUN mkdir -p /etc/ansible
    - COPY --chmod=644 ./etc/ansible/ansible.cfg /etc/ansible/
    - COPY --chmod=444 ./etc/resolv.conf /etc/
    - COPY --chmod=600 ./root/.gitconfig /root/
  append_final:
    - COPY --from=quay.io/ansible/receptor:devel /usr/bin/receptor /usr/bin/receptor
    - RUN mkdir -p /var/run/receptor
    - RUN git lfs install --system

images:
  base_image:
    name: quay.io/centos/centos:stream9

I’ve been building ees with the same quay.io/centos/centos:stream9 base image and collections for years without any such incident before.
The only things that I’ve changed recently are:

  • the order of the entries in the yml definition file
  • the COPY cmds in the append_base: section which were before in the append_final: section, which I was hoping to test to prevent the builder from modifying the copied /etc/resolv.conf file (which it did when applied in the append_final: section)

Something seems to have changed on your side: do I need credentials now to install collections into the ee?

Also, I have these settings in /etc/ansible/ansible.cfg, but I do not think they matter in this context:

[galaxy]
# Separated by ', '
server_list = release_galaxy, test_galaxy, local_https, local_ssh, local_file, automation_hub

[galaxy_server.release_galaxy]
url=https://galaxy.ansible.com/
token=<private_token>

[galaxy_server.test_galaxy]
url=https://galaxy-dev.ansible.com/
token=<another_private_token>

...

[galaxy_server.automation_hub]
url=https://cloud.redhat.com/api/automation-hub/
auth_url=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
token=my_ah_token

I tried again, but things are getting worse:

...
#10 [base  4/14] RUN /usr/bin/dnf install python311 -y ; if [ -z  ]; then /usr/bin/dnf clean all; fi
#10 12.59 CentOS Stream 9 - BaseOS                        176  B/s | 2.1 kB     00:12    
#10 12.59 Errors during downloading metadata for repository 'baseos':
#10 12.59   - Downloading successful, but checksum doesn't match. Calculated: 346a4df8ef6e4a3e7baf64301c6d5ecd3d9360a0f10f7dea03e7c5a57c507cbfaf85a0ccb61acc6bbde21ee80056bf322b87c6dfa445fde2e47b55fb77852cd5(sha512)  Expected: d940094d3cb3502b74cd089b5adc5645d5835288a77b578d47e687a5b3e5f6c9301dee50f6be613bf9242c0bfbc521666ae03f2ea0d2303dd636f4d5c74caaab(sha512) 
#10 12.60 Error: Failed to download metadata for repo 'baseos': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
#10 12.72 0 files removed
#10 DONE 12.8s

The dnf metadata issue is something different.

In any case you do have this in your EE definition:

additional_build_steps:
  append_base:
[...]
    - COPY --chmod=644 ./etc/ansible/ansible.cfg /etc/ansible/
[...]
  1. BaseOS is accessible again.
  2. I modified the definition file; I thought the commands were compatible with dockerfile commands. Strangely enough, it does solve this issue but not mine:

with:

additional_build_steps:
  append_base:
    - RUN $PYCMD -m pip install -U pip
    - RUN dnf -y install dnf-plugins-core
    - RUN dnf -y install epel-release epel-next-release
    - RUN dnf -y config-manager --set-enabled crb
    - RUN mkdir -p /etc/ansible
    - COPY ./etc/ansible/ansible.cfg /etc/ansible/
    - COPY ./etc/resolv.conf /etc/
    - COPY ./root/.gitconfig /root/
    - RUN chmod 644 /etc/ansible/ansible.cfg
    - RUN chmod 444 /etc/resolv.conf
    - RUN chmod 600 /root/.gitconfig
  append_final:
    - COPY --from=quay.io/ansible/receptor:devel /usr/bin/receptor /usr/bin/receptor
    - RUN mkdir -p /var/run/receptor
    - RUN git lfs install --system
    - RUN alternatives --install /usr/bin/python python /usr/bin/python3.11 311

I get:

...
#17 [base 11/17] RUN mkdir -p /etc/ansible
#17 DONE 0.2s

#18 [base 12/17] COPY ./etc/ansible/ansible.cfg /etc/ansible/
#18 DONE 0.0s

#19 [base 13/17] COPY ./etc/resolv.conf /etc/
#19 DONE 0.0s

#20 [base 14/17] COPY ./root/.gitconfig /root/
#20 DONE 0.0s

#21 [base 15/17] RUN chmod 644 /etc/ansible/ansible.cfg
#21 DONE 0.2s

#22 [base 16/17] RUN chmod 444 /etc/resolv.conf
#22 0.170 chmod: changing permissions of '/etc/resolv.conf': Read-only file system
#22 ERROR: process "/bin/sh -c chmod 444 /etc/resolv.conf" did not complete successfully: exit code: 1
------
 > [base 16/17] RUN chmod 444 /etc/resolv.conf:
0.170 chmod: changing permissions of '/etc/resolv.conf': Read-only file system
------
Dockerfile:37
--------------------
  35 |     COPY ./root/.gitconfig /root/
  36 |     RUN chmod 644 /etc/ansible/ansible.cfg
  37 | >>> RUN chmod 444 /etc/resolv.conf
  38 |     RUN chmod 600 /root/.gitconfig
  39 |     
--------------------
ERROR: failed to build: failed to solve: process "/bin/sh -c chmod 444 /etc/resolv.conf" did not complete successfully: exit code: 1

An error occurred (rc=1). Use -vvv for full details.

How is it possible to copy a file and then be unable to change its permissions due to a " shell Read-only file system"?

Actually, the issue is still there if I remove RUN chmod 444 /etc/resolv.conf and replace it with RUN chattr +i /etc/resolv.conf in the append_final: section (which I suspect won’t work either):

...
#30 [galaxy 5/6] RUN ansible-galaxy role install  -r requirements.yml --roles-path "/usr/share/ansible/roles"
#30 0.287 [DEPRECATION WARNING]: PARAMIKO_HOST_KEY_AUTO_ADD option. Reason: This option 
#30 0.287 was moved to the plugin itself Alternatives: Use the option from the plugin 
#30 0.287 itself. This feature will be removed in version 2.20. Deprecation warnings can 
#30 0.287 be disabled by setting deprecation_warnings=False in ansible.cfg.
#30 0.386 Skipping install, no requirements found
#30 DONE 0.4s

#31 [galaxy 6/6] RUN ANSIBLE_GALAXY_DISABLE_GPG_VERIFY=1 ansible-galaxy collection install  -r requirements.yml --collections-path "/usr/share/ansible/collections"
#31 0.261 [DEPRECATION WARNING]: PARAMIKO_HOST_KEY_AUTO_ADD option. Reason: This option 
#31 0.261 was moved to the plugin itself Alternatives: Use the option from the plugin 
#31 0.261 itself. This feature will be removed in version 2.20. Deprecation warnings can 
#31 0.261 be disabled by setting deprecation_warnings=False in ansible.cfg.
#31 0.796 ERROR! Unable to get access token (HTTP Code: 400, Message: Bad Request)
#31 0.796 Starting galaxy collection install process
#31 0.796 Process install dependency map
#31 ERROR: process "/bin/sh -c ANSIBLE_GALAXY_DISABLE_GPG_VERIFY=1 ansible-galaxy collection install $ANSIBLE_GALAXY_CLI_COLLECTION_OPTS -r requirements.yml --collections-path \"/usr/share/ansible/collections\"" did not complete successfully: exit code: 1
------
 > [galaxy 6/6] RUN ANSIBLE_GALAXY_DISABLE_GPG_VERIFY=1 ansible-galaxy collection install  -r requirements.yml --collections-path "/usr/share/ansible/collections":
0.261 [DEPRECATION WARNING]: PARAMIKO_HOST_KEY_AUTO_ADD option. Reason: This option 
0.261 was moved to the plugin itself Alternatives: Use the option from the plugin 
0.261 itself. This feature will be removed in version 2.20. Deprecation warnings can 
0.261 be disabled by setting deprecation_warnings=False in ansible.cfg.
0.796 ERROR! Unable to get access token (HTTP Code: 400, Message: Bad Request)
0.796 Starting galaxy collection install process
0.796 Process install dependency map
------
Dockerfile:56
--------------------
  54 |     RUN mkdir -p /usr/share/ansible
  55 |     RUN ansible-galaxy role install $ANSIBLE_GALAXY_CLI_ROLE_OPTS -r requirements.yml --roles-path "/usr/share/ansible/roles"
  56 | >>> RUN ANSIBLE_GALAXY_DISABLE_GPG_VERIFY=1 ansible-galaxy collection install $ANSIBLE_GALAXY_CLI_COLLECTION_OPTS -r requirements.yml --collections-path "/usr/share/ansible/collections"
  57 |     
  58 |     # Builder build stage
--------------------
ERROR: failed to build: failed to solve: process "/bin/sh -c ANSIBLE_GALAXY_DISABLE_GPG_VERIFY=1 ansible-galaxy collection install $ANSIBLE_GALAXY_CLI_COLLECTION_OPTS -r requirements.yml --collections-path \"/usr/share/ansible/collections\"" did not complete successfully: exit code: 1

An error occurred (rc=1). Use -vvv for full details.

It seems this issue has been solved:

...
#26 [galaxy 6/6] RUN ANSIBLE_GALAXY_DISABLE_GPG_VERIFY=1 ansible-galaxy collection install  -r requirements.yml --collections-path "/usr/share/ansible/collections"
#26 92.47 Starting galaxy collection install process
#26 92.47 Process install dependency map
#26 92.47 Starting collection install process
#26 92.47 Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/ansible-mysql-5.2.0.tar.gz to /root/.ansible/tmp/ansible-local-1odk_q6jz/tmphsc1x7i9/ansible-mysql-5.2.0-cd01hna6
...

Although I’m still unable to modify /etc/resolv.conf in the ee, so I’ll open another report here:

[galaxy_server.automation_hub]
url=https://cloud.redhat.com/api/automation-hub/
auth_url=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
token=my_ah_token

Just an FYI cloud.redhat.com and console.redhat.com are the same thing. Sivel’s comment around this only happens when attempting to authenticate against console.redhat.com means the OAuth/Keycloak exchange used with the auth_url entry here.