Unknown error when attempting to call Galaxy at 'https://galaxy.ansible.com/api/'

Since yesterday I’m unable to install any galaxy component. Below is the erro being reported, the content of my requirements.yml is

collections:
  - name: ansible.windows
    source: https://galaxy.ansible.com
  - name: ansible.posix
    source: https://galaxy.ansible.com
  - name: community.windows
    source: https://galaxy.ansible.com
  - name: community.general
    source: https://galaxy.ansible.com
ansible-galaxy collection install -vv -r requirements.yml

ansible-galaxy [core 2.14.14]
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /az-hop/miniconda/lib/python3.12/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /az-hop/miniconda/bin/ansible-galaxy
  python version = 3.12.1 | packaged by Anaconda, Inc. | (main, Jan 19 2024, 15:51:05) [GCC 11.2.0] (/az-hop/miniconda/bin/python3)
  jinja version = 3.1.3
  libyaml = True
No config file found; using defaults
Reading requirement file at '/az-hop/toolset/scripts/requirements.yml'
Starting galaxy collection install process
Process install dependency map
Initial connection to galaxy_server: https://galaxy.ansible.com
Opened /root/.ansible/galaxy_token
Calling Galaxy at https://galaxy.ansible.com/api/
[WARNING]: Skipping Galaxy server https://galaxy.ansible.com. Got an unexpected error when getting available versions of collection ansible.windows: Unknown error when attempting to call Galaxy
at 'https://galaxy.ansible.com/api/': HTTPSConnection.__init__() got an unexpected keyword argument 'cert_file'. HTTPSConnection.__init__() got an unexpected keyword argument 'cert_file'
ERROR! Unknown error when attempting to call Galaxy at 'https://galaxy.ansible.com/api/': HTTPSConnection.__init__() got an unexpected keyword argument 'cert_file'. HTTPSConnection.__init__() got an unexpected keyword argument 'cert_file'

Any idea how to fix this issue ?
Thank you
Xavier

1 Like

This has been solved as we were using an old ansible version in our requirements.txt file, we were on 7.6. Moving to 8.5.0 and later fixed this issue.

For others arriving here: I faced this error with ansible 2.14.17 - using 2.16.11 worked fine. Not sure which version exactly is the cutoff point.