# Galaxy import successful but latest versions error to download

**URL:** <https://forum.ansible.com/t/galaxy-import-successful-but-latest-versions-error-to-download/3231>\
**Category:** Get Help\
**Tags:** role, galaxy-ng\
**Created:** [January 9, 2024, 9:06pm UTC](https://forum.ansible.com/t/galaxy-import-successful-but-latest-versions-error-to-download/3231 "2024-01-09T21:06:57Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![staticdev](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/staticdev/32/1582_2.png) [@staticdev](https://forum.ansible.com/u/staticdev)\
**Post date:** [January 9, 2024, 9:06pm UTC](https://forum.ansible.com/t/galaxy-import-successful-but-latest-versions-error-to-download/3231/1 "2024-01-09T21:06:57Z")

</div>

I found a report of this error [[role import] Unexpected behaviour - role missing with inconsistent information · Issue #3303 · ansible/galaxy · GitHub](https://github.com/ansible/galaxy/issues/3303) but it was requested to create a thread here.

Basically, I uploaded version 3.1.0 of [staticdev.python\_developer](https://galaxy.ansible.com/ui/standalone/roles/staticdev/python-developer/) role using GA (as always) and when it try to download it says it doesn’t exist despite I checked in the logs and upload was successful. Also from Galaxy login I can see the successful import.

It seems to be happening with more people and other roles also.

---

<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:** [January 9, 2024, 9:35pm UTC](https://forum.ansible.com/t/galaxy-import-successful-but-latest-versions-error-to-download/3231/2 "2024-01-09T21:35:46Z")

</div>

EDIT: I see what you are saying if I run `ansible-galaxy role install -p roles --force staticdev.python_developer,3.1.0`

---

<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:** [January 9, 2024, 9:49pm UTC](https://forum.ansible.com/t/galaxy-import-successful-but-latest-versions-error-to-download/3231/3 "2024-01-09T21:49:42Z")

</div>

It kind of seems like a CDN issue. When I load the role in the UI, the api response for versions says there are 39 versions.

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

When I curl the role from the API it says 38 versions.

```auto
(venv) [jtanner@p1 deleteme]$ curl -s -L http://galaxy.ansible.com/api/v1/roles/27179/versions/ | jq . | head -n 25
{
  "count": 38,
  "next": null,
  "next_link": null,
  "previous": null,
  "previous_link": null,
  "results": [
    {
      "id": "797f3edb-83b2-4f2b-b010-73449cb10033",
      "name": "0.1.0",
      "version": "0.1.0",
      "created": "2021-06-07T17:12:19.467498Z",
      "modified": "2021-06-07T17:12:19.467530Z",
      "commit_date": "2021-01-05T15:27:59-05:00",
      "commit_sha": "4936e45151ce422e67a75e526fdf7ef65efa37a8",
      "download_url": "https://github.com/staticdev/ansible-role-python-developer/archive/0.1.0.tar.gz"
    },

```

---

<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:** [January 9, 2024, 10:36pm UTC](https://forum.ansible.com/t/galaxy-import-successful-but-latest-versions-error-to-download/3231/4 "2024-01-09T22:36:49Z")

</div>

Ah, there’s two different roles … staticdev.python-developer and staticdev.python\_developer

In the import log, it shows the client passed in python-developer as the alternate\_role\_name which took precedence over any other possibilities…

```auto
==== PARAMETERS ==== 
importer username: staticdev 
matched user: staticdev id:6381 
github_user: staticdev 
github_repo: ansible-role-python-developer 
github_reference: None 
alternate_clone_url: None 
alternate_namespace_name: None 
alternate_role_name: python-developer 

```

So now we have [staticdev.python-developer](https://galaxy.ansible.com/ui/standalone/roles/staticdev/python-developer/versions/) AND [staticdev.python\_developer](https://galaxy.ansible.com/ui/standalone/roles/staticdev/python_developer/versions/)

The latter is the one you have always maintained whereas the former is the new one created by the import.

To get 3.1.0 into staticdev.python\_developer, you need to import with these args …

```auto
ansible-galaxy role import --role-name=python_developer staticdev ansible-role-python-developer

```

Afterwards you can delete the incorrect role by it’s ID …

```auto
curl -X DELETE -H 'Authorization: token <YOUR_GALAXY_TOKEN>' https://galaxy.ansible.com/api/v1/roles/37626/

```

We’ve been discussing these new behaviors in the announcement thread here [Ansible Galaxy’s role import enhancements and fixes for the new year - #9 by githubixx](http://forum.ansible.com/t/ansible-galaxy-s-role-import-enhancements-and-fixes-for-the-new-year/3206/9)

---

<div class="post-metadata">

**Author:** ![staticdev](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/staticdev/32/1582_2.png) [@staticdev](https://forum.ansible.com/u/staticdev)\
**Post date:** [January 10, 2024, 8:51am UTC](https://forum.ansible.com/t/galaxy-import-successful-but-latest-versions-error-to-download/3231/5 "2024-01-10T08:51:58Z")

</div>

@tannerjc thanks for analysing the issue. I will then put my comments on the thread you mentioned.

---

<div class="post-metadata">

**Author:** ![dbrennand](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dbrennand/32/7830_2.png) [@dbrennand](https://forum.ansible.com/u/dbrennand)\
**Post date:** [January 14, 2024, 11:45am UTC](https://forum.ansible.com/t/galaxy-import-successful-but-latest-versions-error-to-download/3231/6 "2024-01-14T11:45:54Z")

</div>

Hey @tannerjc

Thank you for providing steps to resolve this issue. Like @staticdev, I also have an [Ansible role](https://github.com/dbrennand/ansible-role-caddy-docker/tree/main) which just experienced the same problem.

There are now two roles:

- Original role: `dbrennand.caddy_docker`
- Newly imported role: `dbrennand.caddy-docker`

I’ll join discussions in [Ansible Galaxy’s role import enhancements and fixes for the new year - #9 by githubixx](http://forum.ansible.com/t/ansible-galaxy-s-role-import-enhancements-and-fixes-for-the-new-year/3206/9)

---

<div class="post-metadata">

**Author:** ![dbrennand](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dbrennand/32/7830_2.png) [@dbrennand](https://forum.ansible.com/u/dbrennand)\
**Post date:** [January 14, 2024, 2:47pm UTC](https://forum.ansible.com/t/galaxy-import-successful-but-latest-versions-error-to-download/3231/7 "2024-01-14T14:47:14Z")

</div>

For anyone finding this thread and using GitHub Actions to publish their Ansible role, my current workaround is to extract the `galaxy_info.role_name` using `yq` and provide this to the `--role-name` CLI argument.

> <https://github.com/dbrennand/ansible-role-caddy-docker/commit/afb178dd4e0f2e1409df506654445a58809ef769>
>
> https://forum.ansible.com/t/galaxy-import-successful-but-latest-versions-error-t…o-download/3231/3

`yq` is installed by default on `ubuntu-latest` GitHub runner.

---

<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:** [January 15, 2024, 2:07pm UTC](https://forum.ansible.com/t/galaxy-import-successful-but-latest-versions-error-to-download/3231/8 "2024-01-15T14:07:35Z")

</div>

@dbrennand thanks for the update. Can you add it to the other thread also please?

---

<div class="post-metadata">

**Author:** ![chouetz](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/chouetz/32/2007_2.png) [@chouetz](https://forum.ansible.com/u/chouetz)\
**Post date:** [January 25, 2024, 10:55am UTC](https://forum.ansible.com/t/galaxy-import-successful-but-latest-versions-error-to-download/3231/9 "2024-01-25T10:55:19Z")

</div>

Hello!  
As per the initial request which was on the github issue I’d like to say there is still an issue in the display on ansible galaxy. I join a picture here where you can see a difference between the latest version uploaded and the top right of the screen

 ![image](https://us1.discourse-cdn.com/ansible/original/2X/5/536ae94cfe5b884f15f764a2f0b259bea830a361.png)  
Should we create a dedicated thread for this issue?  
Thanks in advance

---

<div class="post-metadata">

**Author:** ![chouetz](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/chouetz/32/2007_2.png) [@chouetz](https://forum.ansible.com/u/chouetz)\
**Post date:** [January 25, 2024, 11:03am UTC](https://forum.ansible.com/t/galaxy-import-successful-but-latest-versions-error-to-download/3231/10 "2024-01-25T11:03:47Z")

</div>

hm, seems this is only transient and the [display is now correct](https://galaxy.ansible.com/ui/standalone/roles/DataDog/datadog/versions/), you might disregard my previous comment, sorry for inconvenience

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [January 25, 2024, 11:54am UTC](https://forum.ansible.com/t/galaxy-import-successful-but-latest-versions-error-to-download/3231/11 "2024-01-25T11:54:47Z")

</div>

It takes a couple of minutes until the new version shows up everywhere. I have no idea how much ‘couple’ is. I guess there is some caching involved.
