# 403 for Galaxy API when publishing collection to galaxy.ansible.com

**URL:** <https://forum.ansible.com/t/403-for-galaxy-api-when-publishing-collection-to-galaxy-ansible-com/1445>\
**Category:** Get Help\
**Tags:** api, bug, token, galaxy-ng\
**Created:** [October 5, 2023, 3:12pm UTC](https://forum.ansible.com/t/403-for-galaxy-api-when-publishing-collection-to-galaxy-ansible-com/1445 "2023-10-05T15:12:41Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![jholland](https://avatars.discourse-cdn.com/v4/letter/j/f14d63/32.png) [@jholland](https://forum.ansible.com/u/jholland)\
**Post date:** [October 5, 2023, 3:12pm UTC](https://forum.ansible.com/t/403-for-galaxy-api-when-publishing-collection-to-galaxy-ansible-com/1445/1 "2023-10-05T15:12:41Z")

</div>

Publishing for our collection to Galaxy is broken. It has been working fine for years, so this is presumably since the 30 Sep 2023 changes to “new Galaxy”. What do we need to change?

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

Thank you 🙂

---

<div class="post-metadata">

**Author:** ![kso512](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kso512/32/1030_2.png) [@kso512](https://forum.ansible.com/u/kso512)\
**Post date:** [October 5, 2023, 6:03pm UTC](https://forum.ansible.com/t/403-for-galaxy-api-when-publishing-collection-to-galaxy-ansible-com/1445/2 "2023-10-05T18:03:32Z")

</div>

I’m seeing the same 403 error trying to publish my role as well, using GitHub Actions:

> <https://github.com/kso512/checkmk_server/actions/runs/6422662391/job/17439623029>

---

<div class="post-metadata">

**Author:** ![displague](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/displague/32/1032_2.png) [@displague](https://forum.ansible.com/u/displague)\
**Post date:** [October 5, 2023, 7:02pm UTC](https://forum.ansible.com/t/403-for-galaxy-api-when-publishing-collection-to-galaxy-ansible-com/1445/3 "2023-10-05T19:02:42Z")

</div>

It also appears that links to published collections are broken.

`https://galaxy.ansible.com/equinix/cloud/` no longer works, but  
`https://galaxy.ansible.com/ui/repo/published/equinix/cloud/` does.

(the forum embed behavior is interesting too)

[https://galaxy.ansible.com/equinix/cloud/](https://galaxy.ansible.com/equinix/cloud/)

[https://galaxy.ansible.com/ui/repo/published/equinix/cloud/](https://galaxy.ansible.com/ui/repo/published/equinix/cloud/)

If the URL structure has to change, redirects should be put in place.

---

<div class="post-metadata">

**Author:** ![geerlingguy](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/geerlingguy/32/11288_2.png) [@geerlingguy](https://forum.ansible.com/u/geerlingguy)\
**Post date:** [October 5, 2023, 7:09pm UTC](https://forum.ansible.com/t/403-for-galaxy-api-when-publishing-collection-to-galaxy-ansible-com/1445/4 "2023-10-05T19:09:20Z")

</div>

I’m hitting the same errors as well. Tried publishing two updates to my roles today, and both failed:

> <https://github.com/geerlingguy/ansible-role-filebeat/actions/runs/6423196065/job/17441197291>

and

> <https://github.com/geerlingguy/ansible-role-solr/actions/runs/6423371161>

```auto
Run ansible-galaxy role import --api-key *** $(echo geerlingguy/ansible-role-solr | cut -d/ -f1) $(echo geerlingguy/ansible-role-solr | cut -d/ -f2)
  ansible-galaxy role import --api-key *** $(echo geerlingguy/ansible-role-solr | cut -d/ -f1) $(echo geerlingguy/ansible-role-solr | cut -d/ -f2)
  shell: /usr/bin/bash -e {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.11.5/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.11.5/x64/lib
ERROR! Error when finding available api versions from default (https://galaxy.ansible.com) (HTTP Code: 403, Message: Forbidden)
Error: Process completed with exit code 1.

```

---

<div class="post-metadata">

**Author:** ![freemanlatrell](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/freemanlatrell/32/1034_2.png) [@freemanlatrell](https://forum.ansible.com/u/freemanlatrell)\
**Post date:** [October 5, 2023, 7:32pm UTC](https://forum.ansible.com/t/403-for-galaxy-api-when-publishing-collection-to-galaxy-ansible-com/1445/5 "2023-10-05T19:32:20Z")

</div>

I’m assuming this is also related, but when logging into the UI, it looks like I’m no longer the owner of my previous namespace `freemanlatrell`, and now only have access to a new namespace called `freemanlatrell1` that I didn’t create.

 ![image](https://us1.discourse-cdn.com/ansible/original/2X/b/b2bcdcb208effd370e71f5609a0c9e2895e8f9a6.png)

---

<div class="post-metadata">

**Author:** ![jholland](https://avatars.discourse-cdn.com/v4/letter/j/f14d63/32.png) [@jholland](https://forum.ansible.com/u/jholland)\
**Post date:** [October 5, 2023, 8:05pm UTC](https://forum.ansible.com/t/403-for-galaxy-api-when-publishing-collection-to-galaxy-ansible-com/1445/6 "2023-10-05T20:05:17Z")

</div>

Sounds similar to this: [Namespace changed and collection upload not working](http://forum.ansible.com/t/namespace-changed-and-collection-upload-not-working/1314)

---

<div class="post-metadata">

**Author:** ![jholland](https://avatars.discourse-cdn.com/v4/letter/j/f14d63/32.png) [@jholland](https://forum.ansible.com/u/jholland)\
**Post date:** [October 5, 2023, 8:05pm UTC](https://forum.ansible.com/t/403-for-galaxy-api-when-publishing-collection-to-galaxy-ansible-com/1445/7 "2023-10-05T20:05:51Z")

</div>

That’s expected: [New Ansible Galaxy codebase, URLs to collections on Galaxy change · Issue #59 · ansible-collections/news-for-maintainers · GitHub](https://github.com/ansible-collections/news-for-maintainers/issues/59)

The 403 was not expected

---

<div class="post-metadata">

**Author:** ![jholland](https://avatars.discourse-cdn.com/v4/letter/j/f14d63/32.png) [@jholland](https://forum.ansible.com/u/jholland)\
**Post date:** [October 5, 2023, 8:07pm UTC](https://forum.ansible.com/t/403-for-galaxy-api-when-publishing-collection-to-galaxy-ansible-com/1445/8 "2023-10-05T20:07:25Z")

</div>

I’ve since heard that API keys need to be regenerated due to the move to Galaxy NG on 30 Sept 2023. I can’t test this until someone in my team gets back to me to get me access to regen the keys…

---

<div class="post-metadata">

**Author:** ![geerlingguy](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/geerlingguy/32/11288_2.png) [@geerlingguy](https://forum.ansible.com/u/geerlingguy)\
**Post date:** [October 5, 2023, 8:22pm UTC](https://forum.ansible.com/t/403-for-galaxy-api-when-publishing-collection-to-galaxy-ansible-com/1445/9 "2023-10-05T20:22:35Z")

</div>

Where can that be done? I haven’t been able to find a place to generate or regenerate keys…

---

<div class="post-metadata">

**Author:** ![jholland](https://avatars.discourse-cdn.com/v4/letter/j/f14d63/32.png) [@jholland](https://forum.ansible.com/u/jholland)\
**Post date:** [October 5, 2023, 8:37pm UTC](https://forum.ansible.com/t/403-for-galaxy-api-when-publishing-collection-to-galaxy-ansible-com/1445/10 "2023-10-05T20:37:29Z")

</div>

Can you do it [here](https://galaxy.ansible.com/ui/token/)?

---

<div class="post-metadata">

**Author:** ![tannerjc](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/tannerjc/32/985_2.png) [@tannerjc](https://forum.ansible.com/u/tannerjc)\
**Post date:** [October 6, 2023, 1:46am UTC](https://forum.ansible.com/t/403-for-galaxy-api-when-publishing-collection-to-galaxy-ansible-com/1445/11 "2023-10-06T01:46:22Z")

</div>

The freemanlatrell namespace should be fixed now.

---

<div class="post-metadata">

**Author:** ![jholland](https://avatars.discourse-cdn.com/v4/letter/j/f14d63/32.png) [@jholland](https://forum.ansible.com/u/jholland)\
**Post date:** [October 6, 2023, 8:36am UTC](https://forum.ansible.com/t/403-for-galaxy-api-when-publishing-collection-to-galaxy-ansible-com/1445/12 "2023-10-06T08:36:31Z")

</div>

Ok, looks like a newly regenerated API key (obtainable from [Galaxy NG](https://galaxy.ansible.com/ui/token)) has done the trick. I saw many posts about things that would change with Galaxy NG, but this was not one of them. I hope this post helps others who get the same error 🙂

---

<div class="post-metadata">

**Author:** ![freemanlatrell](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/freemanlatrell/32/1034_2.png) [@freemanlatrell](https://forum.ansible.com/u/freemanlatrell)\
**Post date:** [October 6, 2023, 3:12pm UTC](https://forum.ansible.com/t/403-for-galaxy-api-when-publishing-collection-to-galaxy-ansible-com/1445/13 "2023-10-06T15:12:25Z")

</div>

All good now. Thanks

---

<div class="post-metadata">

**Author:** ![geerlingguy](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/geerlingguy/32/11288_2.png) [@geerlingguy](https://forum.ansible.com/u/geerlingguy)\
**Post date:** [October 8, 2023, 4:26am UTC](https://forum.ansible.com/t/403-for-galaxy-api-when-publishing-collection-to-galaxy-ansible-com/1445/14 "2023-10-08T04:26:14Z")

</div>

Looks like that page (Collections \> API Token) was the ticket for my `GALAXY_API_TOKEN`; how does one find that page outside of going to Collections? I tried finding it under my account, and couldn’t. I only visit the collections tab once in a blue moon…

---

<div class="post-metadata">

**Author:** ![jholland](https://avatars.discourse-cdn.com/v4/letter/j/f14d63/32.png) [@jholland](https://forum.ansible.com/u/jholland)\
**Post date:** [October 9, 2023, 8:10am UTC](https://forum.ansible.com/t/403-for-galaxy-api-when-publishing-collection-to-galaxy-ansible-com/1445/15 "2023-10-09T08:10:12Z")

</div>

I hear you, makes more sense to be in the My Profile area, but don’t shoot the messenger 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [November 8, 2023, 8:10am UTC](https://forum.ansible.com/t/403-for-galaxy-api-when-publishing-collection-to-galaxy-ansible-com/1445/16 "2023-11-08T08:10:23Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
