# Role import from GitHub results in "master" release, not the tag release, breaking installs

**URL:** <https://forum.ansible.com/t/role-import-from-github-results-in-master-release-not-the-tag-release-breaking-installs/1856>\
**Category:** Get Help\
**Tags:** role, galaxy-ng\
**Created:** [October 22, 2023, 4:09am UTC](https://forum.ansible.com/t/role-import-from-github-results-in-master-release-not-the-tag-release-breaking-installs/1856 "2023-10-22T04:09:01Z")\
**Posts on this page:** 18\
**Page:** 1

<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 22, 2023, 4:09am UTC](https://forum.ansible.com/t/role-import-from-github-results-in-master-release-not-the-tag-release-breaking-installs/1856/1 "2023-10-22T04:09:01Z")

</div>

For my latest release of the `geerlingguy.pip` role on Galaxy, it should be `3.0.0` (that’s the latest tag on GitHub—see GitHub Actions run here: [Role versions doesn't match the GitHub releases](http://forum.ansible.com/t/role-versions-doesnt-match-the-github-releases/1693)

But when the action ran:

```auto
ansible-galaxy role import --api-key *** $(echo geerlingguy/ansible-role-pip | cut -d/ -f1) $(echo geerlingguy/ansible-role-pip | cut -d/ -f2)
  shell: /usr/bin/bash -e {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.11.6/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.11.6/x64/lib
Successfully submitted import request 2052579235646249945729608737351613182
running
role imported successfully

```

It resulted in a `master` release, but no tag `3.0.0`.

This has resulted in users of the role getting the following error upon trying to install the role:

```auto
[WARNING]: - geerlingguy.pip was NOT installed successfully: Unable to compare
role versions (1.0.0, 1.1.0, 1.2.0, 1.2.1, 1.2.2, 1.3.0, 2.0.0, 2.1.0, 2.2.0,
master) to determine the most recent version due to incompatible version
formats. Please contact the role author to resolve versioning conflicts, or
specify an explicit role version to install.
ERROR! - you can use --ignore-errors to skip failed roles and finish processing the list.

```

See: [error: unable to compare role versions · Issue #60 · geerlingguy/ansible-role-pip · GitHub](https://github.com/geerlingguy/ansible-role-pip/issues/60)

I think [Role versions doesn't match the GitHub releases](http://forum.ansible.com/t/role-versions-doesnt-match-the-github-releases/1693) might be related, but wasn’t exactly this problem AFAICT, so I thought I’d open a new issue.

When I try viewing the role page on Galaxy NG, it appears to show _no_ versions at all now: [Galaxy NG](https://galaxy.ansible.com/ui/standalone/roles/geerlingguy/pip/)

---

<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 22, 2023, 4:10am UTC](https://forum.ansible.com/t/role-import-from-github-results-in-master-release-not-the-tag-release-breaking-installs/1856/2 "2023-10-22T04:10:40Z")

</div>

Looking around in the Galaxy UI, it seems like all my roles have “No versions”, maybe some database connection or UI issue?

---

<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 22, 2023, 4:26am UTC](https://forum.ansible.com/t/role-import-from-github-results-in-master-release-not-the-tag-release-breaking-installs/1856/3 "2023-10-22T04:26:23Z")

</div>

Some similar issues were mentioned in:

> [@The new Galaxy is completely broken](http://forum.ansible.com/t/the-new-galaxy-is-completely-broken/1518/9):
>
> Thanks for posting this Greg. I see the communication here as passion (although there is well appreciated frustration), but I also honestly struggle with clear and respectful communication when I get upset about something. We are all human, so assume that folks have good intent on all sides of the argument. It is up to all of us to always be respectful and just be nice to each other, Greg shouldn’t have to even pipe up IMHO, it is sad he had to. One of the things I do… you are gonna laugh, i…

Just posting for reference.

---

<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 23, 2023, 3:41am UTC](https://forum.ansible.com/t/role-import-from-github-results-in-master-release-not-the-tag-release-breaking-installs/1856/4 "2023-10-23T03:41:54Z")

</div>

The missing versions in the UI should be resolved by [Remove duplicate trailing slash on fetching legacy role versions and content by jctanner · Pull Request #4424 · ansible/ansible-hub-ui · GitHub](https://github.com/ansible/ansible-hub-ui/pull/4424) once merged and deployed.

The tag versus branches issue should be resolved by [Revamp legacyrole versions. by jctanner · Pull Request #1946 · ansible/galaxy\_ng · GitHub](https://github.com/ansible/galaxy_ng/pull/1946) but still needs some more work and testing.

---

<div class="post-metadata">

**Author:** ![L3D](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/l3d/32/911_2.png) [@L3D](https://forum.ansible.com/u/L3D)\
**Post date:** [October 26, 2023, 11:40am UTC](https://forum.ansible.com/t/role-import-from-github-results-in-master-release-not-the-tag-release-breaking-installs/1856/5 "2023-10-26T11:40:27Z")

</div>

I figured out, the `--branch` option is used for the galaxy-ng version. So if you are on your latest release tag on the `main` or `master` branch, you can run:

```bash
ansible-galaxy role import \
  --api-key <GalaxyAPIKey> \
  --branch <YourGitReleaseTag> \
  github_username github_repo

```

I created a github action, that can import new ansible role release with the correct set version to galaxy.ng: [Action Ansible Galaxy Release · Actions · GitHub Marketplace · GitHub](https://github.com/marketplace/actions/action-ansible-galaxy-release)  
It is using the `GITHUB_REF_NAME` enviroment variable as version name.

I created a post about this topic here:

> [@What is the purpose of the --branch on galaxy role import](http://forum.ansible.com/t/what-is-the-purpose-of-the-branch-on-galaxy-role-import/1974):
>
> Hello all, Now that showing the version on galaxy-ng is working again, I am a bit confused. Because my imported roles suddenly have the option “main” several times. This can be seen, for example, in the test role roles-ansible.test that I made to test the import on galaxy-ng in more detail: [[image]](https://galaxy.ansible.com/ui/standalone/roles/roles-ansible/test/) I created a github action to import ansible-roles to galaxy-ng: [Action Ansible Galaxy Release · Actions · GitHub Marketplace · GitHub](https://github.com/marketplace/actions/action-ansible-galaxy-release) And I noticed, the string in the “–branch” version is used as…

---

<div class="post-metadata">

**Author:** ![githubixx](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/githubixx/32/1007_2.png) [@githubixx](https://forum.ansible.com/u/githubixx)\
**Post date:** [October 26, 2023, 6:33pm UTC](https://forum.ansible.com/t/role-import-from-github-results-in-master-release-not-the-tag-release-breaking-installs/1856/6 "2023-10-26T18:33:19Z")

</div>

Also tried that **–branch** option. But basically got the same error that I always got (besides one try):

```auto
Successfully submitted import request 2053172058356991462981303515328567548
running
git clone for https://github.com/githubixx/etcd failed
  File "/venv/lib64/python3.11/site-packages/pulpcore/tasking/tasks.py", line 66, in _execute_task
    result = func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
  File "/app/galaxy_ng/app/api/v1/tasks.py", line 167, in legacy_role_import
    raise Exception(f'git clone for {clone_url} failed')

```

So 🤷 😉

---

<div class="post-metadata">

**Author:** ![L3D](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/l3d/32/911_2.png) [@L3D](https://forum.ansible.com/u/L3D)\
**Post date:** [October 26, 2023, 9:56pm UTC](https://forum.ansible.com/t/role-import-from-github-results-in-master-release-not-the-tag-release-breaking-installs/1856/7 "2023-10-26T21:56:56Z")

</div>

Sorry it die not worked for you.

Looks like a gagaxy dev should look at it.

@tannerjc maybe?

---

<div class="post-metadata">

**Author:** ![andrewrothstein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/andrewrothstein/32/1144_2.png) [@andrewrothstein](https://forum.ansible.com/u/andrewrothstein)\
**Post date:** [October 27, 2023, 6:10pm UTC](https://forum.ansible.com/t/role-import-from-github-results-in-master-release-not-the-tag-release-breaking-installs/1856/8 "2023-10-27T18:10:12Z")

</div>

I’m having the same problem. I deleted andrewrothstein.kubelogin and re-imported it. Now I only have a “main” version. I’m expecting the `ansible-galaxy role import --branch main --role-name kubelogin andrewrothstein ansible-kubelogin` to bring in all the semver [tags](https://github.com/andrewrothstein/ansible-kubelogin/tags) hanging off any commits in the main branch. It’s not working as the documentation suggests.

---

<div class="post-metadata">

**Author:** ![L3D](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/l3d/32/911_2.png) [@L3D](https://forum.ansible.com/u/L3D)\
**Post date:** [October 27, 2023, 7:10pm UTC](https://forum.ansible.com/t/role-import-from-github-results-in-master-release-not-the-tag-release-breaking-installs/1856/9 "2023-10-27T19:10:45Z")

</div>

Oh yes, it would be nice if Dokumentation and reality could be merged Plesse!

It is anoying to discovery in a trial an error Basis how it is Wirkung now.

---

<div class="post-metadata">

**Author:** ![xolyu](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/xolyu/32/1360_2.png) [@xolyu](https://forum.ansible.com/u/xolyu)\
**Post date:** [October 30, 2023, 9:22am UTC](https://forum.ansible.com/t/role-import-from-github-results-in-master-release-not-the-tag-release-breaking-installs/1856/10 "2023-10-30T09:22:36Z")

</div>

Since yesterday evening I was able to successfully import a role again. The tags are visible as versions, _main_ is gone.

> role imported successfully

---

<div class="post-metadata">

**Author:** ![githubixx](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/githubixx/32/1007_2.png) [@githubixx](https://forum.ansible.com/u/githubixx)\
**Post date:** [October 30, 2023, 11:37am UTC](https://forum.ansible.com/t/role-import-from-github-results-in-master-release-not-the-tag-release-breaking-installs/1856/11 "2023-10-30T11:37:35Z")

</div>

For me it’s still not working. Still same error as mentioned in my post above.

---

<div class="post-metadata">

**Author:** ![xolyu](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/xolyu/32/1360_2.png) [@xolyu](https://forum.ansible.com/u/xolyu)\
**Post date:** [October 30, 2023, 12:47pm UTC](https://forum.ansible.com/t/role-import-from-github-results-in-master-release-not-the-tag-release-breaking-installs/1856/12 "2023-10-30T12:47:08Z")

</div>

What does your import command look like?

> git clone for [https://github.com/githubixx/etcd](https://github.com/githubixx/etcd) failed

It sounds like the repository name you passed as a parameter is wrong.

I think the correct command should be as follows:  
`ansible-galaxy role import githubixx ansible-role-etcd`

---

<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 30, 2023, 1:21pm UTC](https://forum.ansible.com/t/role-import-from-github-results-in-master-release-not-the-tag-release-breaking-installs/1856/13 "2023-10-30T13:21:16Z")

</div>

The big patch(es) that I wrote for revamping role versions and imports went live into production this weekend.

@geerlingguy when get a moment can you validate imports for your roles please?

---

<div class="post-metadata">

**Author:** ![githubixx](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/githubixx/32/1007_2.png) [@githubixx](https://forum.ansible.com/u/githubixx)\
**Post date:** [October 30, 2023, 1:30pm UTC](https://forum.ansible.com/t/role-import-from-github-results-in-master-release-not-the-tag-release-breaking-installs/1856/14 "2023-10-30T13:30:32Z")

</div>

Oh man… How blind one can be 🤦‍♂️ You’re right. It’s working now. Thanks a lot for the hint! 👍 Versions are also looking good now.

---

<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 30, 2023, 1:40pm UTC](https://forum.ansible.com/t/role-import-from-github-results-in-master-release-not-the-tag-release-breaking-installs/1856/15 "2023-10-30T13:40:11Z")

</div>

@andrewrothstein if you could retest again too please, that would be helpful

---

<div class="post-metadata">

**Author:** ![leeovery](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/leeovery/32/1370_2.png) [@leeovery](https://forum.ansible.com/u/leeovery)\
**Post date:** [October 30, 2023, 2:11pm UTC](https://forum.ansible.com/t/role-import-from-github-results-in-master-release-not-the-tag-release-breaking-installs/1856/16 "2023-10-30T14:11:37Z")

</div>

If this is in prod its still failing it seems. Im getting a failure with “geerlingguy.java”:

[WARNING]: - geerlingguy.java was NOT installed successfully: Unable to compare…

---

<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 30, 2023, 2:12pm UTC](https://forum.ansible.com/t/role-import-from-github-results-in-master-release-not-the-tag-release-breaking-installs/1856/17 "2023-10-30T14:12:37Z")

</div>

`geerlingguy.pip` is working now: [Galaxy NG](https://galaxy.ansible.com/ui/standalone/roles/geerlingguy/pip/)

`geerlingguy.java` is not yet: [Galaxy NG](https://galaxy.ansible.com/ui/standalone/roles/geerlingguy/java/)

I’m running the GitHub Actions release job right now, will see if that fixes it…

`geerlingguy.java` latest release is now “Released in 5 hours” 🙂 maybe timezone thing

---

<div class="post-metadata">

**Author:** ![leeovery](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/leeovery/32/1370_2.png) [@leeovery](https://forum.ansible.com/u/leeovery)\
**Post date:** [October 30, 2023, 2:54pm UTC](https://forum.ansible.com/t/role-import-from-github-results-in-master-release-not-the-tag-release-breaking-installs/1856/18 "2023-10-30T14:54:47Z")

</div>

All working for me, cheers! I think a few were failing earlier but all good now:

- src: geerlingguy.firewall
- src: geerlingguy.php-versions
- src: geerlingguy.php-redis
- src: geerlingguy.composer
- src: geerlingguy.java
- src: geerlingguy.elasticsearch
