# Unable to fetch collections, HTTP Error 403: Forbidden

**URL:** <https://forum.ansible.com/t/unable-to-fetch-collections-http-error-403-forbidden/1565>\
**Category:** Get Help\
**Tags:** forbidden, galaxy-ng, ansible-core\
**Created:** [October 9, 2023, 4:00pm UTC](https://forum.ansible.com/t/unable-to-fetch-collections-http-error-403-forbidden/1565 "2023-10-09T16:00:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmpo1](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dmpo1/32/1104_2.png) [@dmpo1](https://forum.ansible.com/u/dmpo1)\
**Post date:** [October 9, 2023, 4:00pm UTC](https://forum.ansible.com/t/unable-to-fetch-collections-http-error-403-forbidden/1565/1 "2023-10-09T16:00:38Z")

</div>

Hi,  
I’m using ansible-core 2.14.6 and have few collections in requirements.yml which I need to download. Everything was working fine until upgrade of ansible galaxy web site 🙂

I’ve seen that there were changes and tried to remove old token files, tried to generate new token, but always getting 403 error when I’m trying to fetch the collections.

Here is how it looks:

**ansible.cfg v1 Not working**

```auto
[galaxy]
server_list = release_galaxy

[galaxy_server.release_galaxy]
url=https://galaxy.ansible.com/api/
token=xxxx

```

**ansible.cfg v2 Not working**

```auto
[galaxy]
server_list = release_galaxy

[galaxy_server.release_galaxy]
url=https://galaxy.ansible.com/api/
#token=xxxx

```

\*\*ansible.cfg v3 Not working \*\*

```auto
#[galaxy]
#server_list = release_galaxy

#[galaxy_server.release_galaxy]
#url=https://galaxy.ansible.com/api/
#token=xxxx

```

**requirements.yml**

```auto
---
collections:
  # Install collections from Ansible Galaxy.
  - name: community.hashi_vault
    # source: https://galaxy.ansible.com
    version: 1.3.2
  - name: kubernetes.core
    # source: https://galaxy.ansible.com
    version: 2.2.0
  - name: community.general
    version: 3.6.0
  - name: community.vmware
    version: 1.14.0

```

**ansible-galaxy install -vvv -c -r requirements.yml --force-with-deps**

```auto
ansible-galaxy install -vvv -c -r requirements.yml --force-with-deps
ansible-galaxy [core 2.14.6]
  config file = /home/xxxx/git/xxxx-ansible-repo/ansible.cfg
  configured module search path = ['/home/xxxx/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/xxxx/.local/share/virtualenvs/xxxx-ansible-repo-NHoHQRrD/lib/python3.9/site-packages/ansible
  ansible collection location = /home/xxxx/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/xxxx/.local/share/virtualenvs/xxxx-ansible-repo-NHoHQRrD/bin/ansible-galaxy
  python version = 3.9.16 (main, May 22 2023, 18:14:50) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] (/home/xxxx/.local/share/virtualenvs/xxxx-ansible-repo-NHoHQRrD/bin/python)
  jinja version = 3.1.2
  libyaml = True
Using /home/xxxx/git/xxxx-ansible-repo/ansible.cfg as config file
Reading requirement file at '/home/xxxx/git/xxxx-ansible-repo/requirements.yml'
Starting galaxy collection install process
Found installed collection community.hashi_vault:1.3.2 at '/home/xxxx/.ansible/collections/ansible_collections/community/hashi_vault'
Found installed collection kubernetes.core:2.2.0 at '/home/xxxx/.ansible/collections/ansible_collections/kubernetes/core'
Process install dependency map
Opened /home/xxxx/.ansible/galaxy_token
Starting collection install process
Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/community-hashi_vault-1.3.2.tar.gz to /home/xxxx/.ansible/tmp/ansible-local-99203leaae8xv/tmp29be6vo4/community-hashi_vault-1.3.2-gxs1z5yc
ERROR! Failed to download collection tar from 'release_galaxy' due to the following unforeseen error: HTTP Error 403: Forbidden. HTTP Error 403: Forbidden

```

If I point ansible.cfg to the old galaxy, I don’t get 403 errors :

```auto
[galaxy]
server_list = release_galaxy

[galaxy_server.release_galaxy]
url=https://old-galaxy.ansible.com/api/

```

What am I doing wrong?

---

<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, 4:50pm UTC](https://forum.ansible.com/t/unable-to-fetch-collections-http-error-403-forbidden/1565/2 "2023-10-11T16:50:48Z")

</div>

I’m getting a similar error but with AWX 23.3.0

ERROR! Error when finding available api versions from server0 ([https://galaxy.ansible.com/](https://galaxy.ansible.com/)) (HTTP Code: 403, Message: Forbidden)

---

<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:38pm UTC](https://forum.ansible.com/t/unable-to-fetch-collections-http-error-403-forbidden/1565/3 "2023-10-12T16:38:24Z")

</div>

To fix the 403 error I had to get a new token from: [Galaxy NG](https://galaxy.ansible.com/ui/token/)

and put it in the registry credential that is set in the AWX “organization” (#/organizations ) Galaxy credential, the problem is that I didn’t had the permission to see that credential… After fixing that I ended up in this issue, [Skipping Galaxy server https://galaxy.ansible.com/api/](http://forum.ansible.com/t/skipping-galaxy-server-https-galaxy-ansible-com-api/1281) , that has been fixed updating to the latest AWX.
