# Skipping Galaxy server https://galaxy.ansible.com/api/

**URL:** <https://forum.ansible.com/t/skipping-galaxy-server-https-galaxy-ansible-com-api/1281>\
**Category:** Get Help\
**Tags:** galaxy-ng\
**Created:** [October 2, 2023, 2:52pm UTC](https://forum.ansible.com/t/skipping-galaxy-server-https-galaxy-ansible-com-api/1281 "2023-10-02T14:52:00Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![veritasium](https://avatars.discourse-cdn.com/v4/letter/v/87869e/32.png) [@veritasium](https://forum.ansible.com/u/veritasium)\
**Post date:** [October 2, 2023, 2:52pm UTC](https://forum.ansible.com/t/skipping-galaxy-server-https-galaxy-ansible-com-api/1281/1 "2023-10-02T14:52:00Z")

</div>

Hello,  
since last weekend, suddenly (nothing was changed on our side), we started to get that error, when running “Project Update” in Ansible AWX 23.2.0:

```auto
"[WARNING]: Skipping Galaxy server https://galaxy.ansible.com/api/. Got an",
    "unexpected error when getting available versions of collection",
    "community.general: '/api/v3/plugin/ansible/content/published/collections/index/",
    "community/general/versions/'",
    "ERROR! Unexpected Exception, this is probably a bug: '/api/v3/plugin/ansible/content/published/collections/index/community/general/versions/'"

```

Sample of the `requirements.yml` (different version of the collection were tested and all got the same error):

```auto
collections:
  - name: community.general
    version: 7.0.1
  - name: community.windows
    version: 2.0.0

```

We tried to run the same on a local container build only to troubleshoot the problem and got the same error. We did deploy another different version of AWX and got the same error.

We did check, and the URL `'/api/v3/plugin/ansible/content/published/collections/index/community/general/versions/'` is correct.  
There is no any issue, if we run `ansible-galaxy collection install community.general`. That worked.

Important: the issue is not for **all** collections. For example, when the `community.general` is commented on, the `community.windows` is installed with no issues. If the `community.general` is not commented on, we get that error and the process fails.

Maybe someone knows what is wrong and can help.

---

<div class="post-metadata">

**Author:** ![rochacbruno](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/rochacbruno/32/131_2.png) [@rochacbruno](https://forum.ansible.com/u/rochacbruno)\
**Post date:** [October 2, 2023, 4:00pm UTC](https://forum.ansible.com/t/skipping-galaxy-server-https-galaxy-ansible-com-api/1281/2 "2023-10-02T16:00:10Z")

</div>

Thanks for reporting and giving detailed information, I am investigating this issue.

---

<div class="post-metadata">

**Author:** ![chinochao](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/chinochao/32/928_2.png) [@chinochao](https://forum.ansible.com/u/chinochao)\
**Post date:** [October 2, 2023, 5:33pm UTC](https://forum.ansible.com/t/skipping-galaxy-server-https-galaxy-ansible-com-api/1281/3 "2023-10-02T17:33:31Z")

</div>

@veritasium@rochacbruno We started to notice the same issue on our AWX instance. It seems when we used version: with the latest version everything started to work.

This is the error message we were getting.

```auto
{
    "msg": "non-zero return code",
    "cmd": [
        "ansible-galaxy",
        "collection",
        "install",
        "-r",
        "requirements.yml",
        "-p",
        "/tmp/awx_573370_63xlw131/requirements_collections"
    ],
    "stdout": "Process install dependency map\n|\b/\b-\b\\\b|\b/\b-\b\\\b",
    "stderr": "ERROR! Unknown error when attempting to call Galaxy at '/api/v3/plugin/ansible/content/published/collections/index/theforeman/foreman/versions/?limit=10&offset=10': unknown url type: '/api/v3/plugin/ansible/content/published/collections/index/theforeman/foreman/versions/?limit=10&offset=10'",
    "rc": 1,
    "start": "2023-09-30 16:45:22.247874",
    "end": "2023-09-30 16:45:23.507961",
    "delta": "0:00:01.260087",
    "changed": false,
    "invocation": {
        "module_args": {
            "chdir": "/var/lib/awx/projects/_151__REPO/collections",
            "_raw_params": "ansible-galaxy collection install -r requirements.yml -p /tmp/awx_573370_63xlw131/requirements_collections",
            "warn": true,
            "_uses_shell": false,
            "stdin_add_newline": true,
            "strip_empty_ends": true,
            "argv": null,
            "executable": null,
            "creates": null,
            "removes": null,
            "stdin": null
        }
    },
    "stdout_lines": [
        "Process install dependency map",
        "|\b/\b-\b\\\b|\b/\b-\b\\\b"
    ],
    "stderr_lines": [
        "ERROR! Unknown error when attempting to call Galaxy at '/api/v3/plugin/ansible/content/published/collections/index/theforeman/foreman/versions/?limit=10&offset=10': unknown url type: '/api/v3/plugin/ansible/content/published/collections/index/theforeman/foreman/versions/?limit=10&offset=10'"
    ],
    "_ansible_no_log": false
}

```

I wonder if this issue is related to the New Galaxy that was announced last week. We started to notice this issue on September 30th.

---

<div class="post-metadata">

**Author:** ![veritasium](https://avatars.discourse-cdn.com/v4/letter/v/87869e/32.png) [@veritasium](https://forum.ansible.com/u/veritasium)\
**Post date:** [October 2, 2023, 6:00pm UTC](https://forum.ansible.com/t/skipping-galaxy-server-https-galaxy-ansible-com-api/1281/4 "2023-10-02T18:00:05Z")

</div>

We started to see that error on the last weekend. So, match what you’re describe. Most probably related.

---

<div class="post-metadata">

**Author:** ![tsipsey](https://avatars.discourse-cdn.com/v4/letter/t/e9c0ed/32.png) [@tsipsey](https://forum.ansible.com/u/tsipsey)\
**Post date:** [October 2, 2023, 6:37pm UTC](https://forum.ansible.com/t/skipping-galaxy-server-https-galaxy-ansible-com-api/1281/5 "2023-10-02T18:37:54Z")

</div>

We are having same issue trying to install community.aws. Here is verbose output.

```auto
10:23:58 Initial connection to galaxy_server: https://galaxy.ansible.com
10:23:58 Created /root/.ansible/galaxy_token
10:23:58 Calling Galaxy at https://galaxy.ansible.com/api/
10:23:58 Found API version 'v3, pulp-v3, v1' with Galaxy server default (https://galaxy.ansible.com/api/)
10:23:58 Calling Galaxy at https://galaxy.ansible.com/api/v3/collections/community/aws/
10:23:58 Calling Galaxy at https://galaxy.ansible.com/api/v3/collections/community/aws/versions/?limit=100
10:23:58 Calling Galaxy at https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/index/community/aws/versions/?limit=100&offset=100
10:23:59 [WARNING]: Skipping Galaxy server https://galaxy.ansible.com/api/. Got an
10:23:59 unexpected error when getting available versions of collection community.aws: '
10:23:59 /api/v3/plugin/ansible/content/published/collections/index/community/aws/versio
10:23:59 ns/'
10:23:59 ERROR! Unexpected Exception, this is probably a bug: '/api/v3/plugin/ansible/content/published/collections/index/community/aws/versions/'
10:23:59 the full traceback was:
10:23:59  
10:23:59 Traceback (most recent call last):
10:23:59 File "/usr/local/lib/python3.9/site-packages/resolvelib/resolvers.py", line 171, in _merge_into_criterion
10:23:59 crit = self.state.criteria[name]
10:23:59 KeyError: 'community.aws'
10:23:59  
10:23:59 During handling of the above exception, another exception occurred:
10:23:59  
10:23:59 Traceback (most recent call last):
10:23:59 File "/usr/local/bin/ansible-galaxy", line 135, in <module>
10:23:59 exit_code = cli.run()
10:23:59 File "/usr/local/lib/python3.9/site-packages/ansible/cli/galaxy.py", line 552, in run
10:23:59 return context.CLIARGS['func']()
10:23:59 File "/usr/local/lib/python3.9/site-packages/ansible/cli/galaxy.py", line 75, in method_wrapper
10:23:59 return wrapped_method(*args, **kwargs)
10:23:59 File "/usr/local/lib/python3.9/site-packages/ansible/cli/galaxy.py", line 1186, in execute_install
10:23:59 self._execute_install_collection(
10:23:59 File "/usr/local/lib/python3.9/site-packages/ansible/cli/galaxy.py", line 1213, in _execute_install_collection
10:23:59 install_collections(
10:23:59 File "/usr/local/lib/python3.9/site-packages/ansible/galaxy/collection/ __init__.py", line 512, in install_collections
10:23:59 dependency_map = _resolve_depenency_map(
10:23:59 File "/usr/local/lib/python3.9/site-packages/ansible/galaxy/collection/ __init__.py", line 1326, in _resolve_depenency_map
10:23:59 return collection_dep_resolver.resolve(
10:23:59 File "/usr/local/lib/python3.9/site-packages/resolvelib/resolvers.py", line 453, in resolve
10:23:59 state = resolution.resolve(requirements, max_rounds=max_rounds)
10:23:59 File "/usr/local/lib/python3.9/site-packages/resolvelib/resolvers.py", line 318, in resolve
10:23:59 name, crit = self._merge_into_criterion(r, parent=None)
10:23:59 File "/usr/local/lib/python3.9/site-packages/resolvelib/resolvers.py", line 173, in _merge_into_criterion
10:23:59 crit = Criterion.from_requirement(self._p, requirement, parent)
10:23:59 File "/usr/local/lib/python3.9/site-packages/resolvelib/resolvers.py", line 79, in from_requirement
10:23:59 cands = build_iter_view(provider.find_matches([requirement]))
10:23:59 File "/usr/local/lib/python3.9/site-packages/ansible/galaxy/dependency_resolution/providers.py", line 214, in find_matches
10:23:59 coll_versions = self._api_proxy.get_collection_versions(first_req)
10:23:59 File "/usr/local/lib/python3.9/site-packages/ansible/galaxy/collection/galaxy_api_proxy.py", line 101, in get_collection_versions
10:23:59 return set(
10:23:59 File "/usr/local/lib/python3.9/site-packages/ansible/galaxy/collection/galaxy_api_proxy.py", line 101, in <genexpr>
10:23:59 return set(
10:23:59 File "/usr/local/lib/python3.9/site-packages/ansible/galaxy/collection/galaxy_api_proxy.py", line 82, in _get_collection_versions
10:23:59 raise last_error
10:23:59 File "/usr/local/lib/python3.9/site-packages/ansible/galaxy/collection/galaxy_api_proxy.py", line 61, in _get_collection_versions
10:23:59 versions = api.get_collection_versions(requirement.namespace, requirement.name)
10:23:59 File "/usr/local/lib/python3.9/site-packages/ansible/galaxy/api.py", line 126, in wrapped
10:23:59 return method(self, *args, **kwargs)
10:23:59 File "/usr/local/lib/python3.9/site-packages/ansible/galaxy/api.py", line 867, in get_collection_versions
10:23:59 data = self._call_galaxy(to_native(next_link, errors='surrogate_or_strict'),
10:23:59 File "/usr/local/lib/python3.9/site-packages/ansible/module_utils/api.py", line 157, in run_function
10:23:59 return call_retryable_function()
10:23:59 File "/usr/local/lib/python3.9/site-packages/ansible/galaxy/api.py", line 394, in _call_galaxy
10:23:59 path_cache = self._cache[cache_id][url_info.path]
10:23:59 KeyError: '/api/v3/plugin/ansible/content/published/collections/index/community/aws/versions/'

```

---

<div class="post-metadata">

**Author:** ![aberkvam\_twh](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/aberkvam_twh/32/936_2.png) [@aberkvam\_twh](https://forum.ansible.com/u/aberkvam_twh)\
**Post date:** [October 2, 2023, 8:33pm UTC](https://forum.ansible.com/t/skipping-galaxy-server-https-galaxy-ansible-com-api/1281/6 "2023-10-02T20:33:36Z")

</div>

We’re running an older version of Ansible (core 2.11) and getting these errors. I haven’t seen it stated anywhere explicitly but I suspect older Ansible versions aren’t compatible with Galaxy NG.

I have had luck adding this to our ansible.cfg:

```auto
[galaxy]
server = https://old-galaxy.ansible.com/

```

Not an appealing long-term solution, but it gets things working again and buys us time.

---

<div class="post-metadata">

**Author:** ![veritasium](https://avatars.discourse-cdn.com/v4/letter/v/87869e/32.png) [@veritasium](https://forum.ansible.com/u/veritasium)\
**Post date:** [October 3, 2023, 10:03am UTC](https://forum.ansible.com/t/skipping-galaxy-server-https-galaxy-ansible-com-api/1281/7 "2023-10-03T10:03:03Z")

</div>

So, is it true to say that there is some small incompatibilty between the new Galaxy and AWX? Even the latest one?

---

<div class="post-metadata">

**Author:** ![rochacbruno](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/rochacbruno/32/131_2.png) [@rochacbruno](https://forum.ansible.com/u/rochacbruno)\
**Post date:** [October 3, 2023, 10:36am UTC](https://forum.ansible.com/t/skipping-galaxy-server-https-galaxy-ansible-com-api/1281/8 "2023-10-03T10:36:17Z")

</div>

@veritasium according to [Unexpected exception while installing ansible galaxy collections using Python 3.7 · Issue #81830 · ansible/ansible · GitHub](https://github.com/ansible/ansible/issues/81830)

This issue has been resolved in the following versions of ansible-core:

v2.12.8  
v2.13.3  
v2.14.0 (and all newer versions)

Can you confirm which version of Ansible Core are you running?

---

<div class="post-metadata">

**Author:** ![veritasium](https://avatars.discourse-cdn.com/v4/letter/v/87869e/32.png) [@veritasium](https://forum.ansible.com/u/veritasium)\
**Post date:** [October 3, 2023, 10:39am UTC](https://forum.ansible.com/t/skipping-galaxy-server-https-galaxy-ansible-com-api/1281/9 "2023-10-03T10:39:07Z")

</div>

@rochacbruno, I tried to find a way how to get it within the AWX containers or from the [documentation](https://github.com/ansible/awx), but unfortunately, wasnt able to find such details. Maybe someone here knows…

---

<div class="post-metadata">

**Author:** ![veritasium](https://avatars.discourse-cdn.com/v4/letter/v/87869e/32.png) [@veritasium](https://forum.ansible.com/u/veritasium)\
**Post date:** [October 4, 2023, 8:23am UTC](https://forum.ansible.com/t/skipping-galaxy-server-https-galaxy-ansible-com-api/1281/10 "2023-10-04T08:23:06Z")

</div>

Hi, @aberkvam_twh .  
Can you help me please and tell how did you changed it? There is no way to do via GUI, the API doesnt allow to update built-in credentials… We’re using the AWX deployed by latest AWX Operator. In the operator’s YAML, i didnt find any property, which allows to confgiure it. Probably, i am missing something, but not sure what :).

Appreciate in advance.

---

<div class="post-metadata">

**Author:** ![veritasium](https://avatars.discourse-cdn.com/v4/letter/v/87869e/32.png) [@veritasium](https://forum.ansible.com/u/veritasium)\
**Post date:** [October 4, 2023, 8:37am UTC](https://forum.ansible.com/t/skipping-galaxy-server-https-galaxy-ansible-com-api/1281/11 "2023-10-04T08:37:55Z")

</div>

Ok. I found a way. Adding a new credential of type `Ansible Galaxy` with the `https://old-galaxy.ansible.com/` URL did the job.

Thank you very much.

---

<div class="post-metadata">

**Author:** ![jeromearellano](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jeromearellano/32/999_2.png) [@jeromearellano](https://forum.ansible.com/u/jeromearellano)\
**Post date:** [October 4, 2023, 12:08pm UTC](https://forum.ansible.com/t/skipping-galaxy-server-https-galaxy-ansible-com-api/1281/12 "2023-10-04T12:08:55Z")

</div>

@veritasium,

an option is to create a ansible.cfg file in your project directory.

/my\_project  
|\_ansible.cfg

another option is, if you have a collections folder in your project directory with a requirements.yml.  
you can add a source in it.

## /my\_project | |\_/collections |\_requirements.yml

## requirements.yml

collections:

- name: community.general  
version: 7.4.0  
source: [https://old-galaxy.ansible.com](https://old-galaxy.ansible.com)

it worked for me but not a long-term solution because at some point this [https://old-galaxy.ansible.com](https://old-galaxy.ansible.com) will have EOL.

---

<div class="post-metadata">

**Author:** ![TyraelTLK](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/tyraeltlk/32/1119_2.png) [@TyraelTLK](https://forum.ansible.com/u/TyraelTLK)\
**Post date:** [October 10, 2023, 3:03pm UTC](https://forum.ansible.com/t/skipping-galaxy-server-https-galaxy-ansible-com-api/1281/13 "2023-10-10T15:03:34Z")

</div>

Hi @jeromearellano ,  
how could I set the source in galaxy.yml?

```auto
dependencies:
  freeipa.ansible_freeipa: '1.11.1'
  community.general: '6.3.0'
  ansible.posix: '1.4.0'
  community.crypto: '2.3.4'
  crowdstrike.falcon: '3.3.3'
  community.hashi_vault: '5.0.0'

```

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [October 10, 2023, 4:13pm UTC](https://forum.ansible.com/t/skipping-galaxy-server-https-galaxy-ansible-com-api/1281/14 "2023-10-10T16:13:20Z")

</div>

You can’t. Or rather, you don’t, which feels a lot like “you can’t”, but the difference is subtle.

Dependencies in a published collection’s `galaxy.yml` must reference other published collections. But it’s up to the admin installing a published collection to decide the sources from which to retrieve collections to satisfy dependencies. That’s covered in [Configuring the `ansible-galaxy` client](https://docs.ansible.com/ansible/latest/collections_guide/collections_installing.html#configuring-the-ansible-galaxy-client).

(By the way, the dependencies you listed are quite restrictive. They require the exact versions specified, whereas you probably want those to be version minimums. Consider `">=1.11.1"` rather than `'1.11.1'` for example.)

---

<div class="post-metadata">

**Author:** ![TyraelTLK](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/tyraeltlk/32/1119_2.png) [@TyraelTLK](https://forum.ansible.com/u/TyraelTLK)\
**Post date:** [October 11, 2023, 8:46am UTC](https://forum.ansible.com/t/skipping-galaxy-server-https-galaxy-ansible-com-api/1281/15 "2023-10-11T08:46:26Z")

</div>

I use those in galaxy.yml in order to have the required dependencies automatically installed with one single command when I insall the collection:  
ansible-galaxy collection install collection --force --force-with-deps

(We had cases where an updated dependency broke our use. I have a daily pipeline testing with upstream version, every now and then when I make other changes I bimp the versions…)

---

<div class="post-metadata">

**Author:** ![TyraelTLK](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/tyraeltlk/32/1119_2.png) [@TyraelTLK](https://forum.ansible.com/u/TyraelTLK)\
**Post date:** [October 12, 2023, 4:39pm UTC](https://forum.ansible.com/t/skipping-galaxy-server-https-galaxy-ansible-com-api/1281/16 "2023-10-12T16:39:08Z")

</div>

Fixed for me with the latest AWX, AWX 23.3.0
