Closed artis3n closed 3 years ago
I fixed this by deleting the role and re-importing it from GitHub. I have lost all downloads metrics :(
I've also found this issue, changing branches from master
to main
will break import into galaxy.ansible.com
I'm keen not to have to re-import the role, it seems a bit of a faff.
Starting import: task_id=745477, repository=PyratLabs/ansible-role-k3s
Task "745477" failed: Command '['git', 'clone', '--quiet', '--depth', '1', '--branch', 'master', 'https://github.com/PyratLabs/ansible-role-k3s.git', '/var/tmp/galaxy/imports/tmp_g6r_d13']' returned non-zero exit status 128.
Try setting galaxy_info.github_branch
to the branch name in the metadata file.
I can confirm this works for me @chouseknecht - thank you.
I will forever mourn my lost download metrics, but perfect, thanks @chouseknecht . Is there documentation for that setting I missed, or was that added?
Hi @artis3n It is mentioned in https://galaxy.ansible.com/docs/contributing/creating_role.html#role-metadata
Woops, definitely read straight over that. Thanks for linking.
Hi folks
We are facing exactly the same problem when trying to import https://github.com/hifis-net/ansible-role-gitlab (hifis.gitlab) into Galaxy.
As recommended by @chouseknecht I set galaxy_info.github_branch
to main
(https://github.com/hifis-net/ansible-role-gitlab/commit/cc4526335192126648686628e3191d7fe48b7e87).
But Galaxy still uses the non-existent master
branch:
Starting import: task_id=783214, repository=hifis-net/ansible-role-gitlab
Task "783214" failed: Command '['git', 'clone', '--quiet', '--depth', '1', '--branch', 'master', 'https://github.com/hifis-net/ansible-role-gitlab.git', '/var/tmp/galaxy/imports/tmpfl4v_t8d']' returned non-zero exit status 128.
Are we doing anything wrong here?
I temporarily recreated the master
branch from main
. Ensured that got ingested by Ansible Galaxy (which then picked up the new config change setting the branch to main
). When you confirm that Galaxy is correctly ingesting from main
you can delete the master
branch permanently.
@dallinb Thank you for your support. Unfortunately Galaxy still tries to import the master
branch.
I also recreated the master
branch and triggered an import which worked fine. But after removing the master
branch, the import failed again:
Starting import: task_id=783870, repository=hifis-net/ansible-role-gitlab
Task "783870" failed: Command '['git', 'clone', '--quiet', '--depth', '1', '--branch', 'master', 'https://github.com/hifis-net/ansible-role-gitlab.git', '/var/tmp/galaxy/imports/tmp70hgo983']' returned non-zero exit status 128.
Is there anything else we can try?
I can confirm the behavior @Normo has reported. I have the same setup as them for the painless.software role, explicitly pointing Galaxy to the main
branch (with the same configuration on master
for transitioning).
When triggering an import from the Galaxy Web UI imports continue to pull from master
. Consequently, as soon as the master
branch is deleted imports fail.
@chouseknecht Could this behavior ^^^ be, specifically with the painless author, maybe related to the fact that the GitHub namespace is not the same as the one on Ansible Galaxy? Remember, you configured that manually on my request (#1414).
This also happens to datadog.datadog
when we rename master
to main
even after we have changed the metadata. Any chance someone can help us with that?
Same with hamburger_software.vmware_ubuntu_cloud_image
. Both branches exist and point to the same commit with the updated metadata.
But galaxy keeps importing from master.
I had to revert.
From td2's comment you can import with a different branch via the command line. Get your token from your galaxy preferences.
ansible-galaxy role import -vvv --branch main --token SECRET github_user github_repo
@thermistor this is the best solution so far. You just put this argument and everything will be corrected on Ansible Galaxy.. no need to recreate master branch!
@artis3n this way you would not have lost anything.
2 years later, I agree there are better options available :)
More than 1.5 years later I'm still stuck with the same problem. Probably related to the custom configuration of my account. Any help possible, @chouseknecht?
This used to work with just the main
branch for roughly the last year (without an additional master
branch) until the new Galaxy site was released a few days day ago. Now there seems to be a regression. The following error is reported:
$ ansible-galaxy install painless.software
Starting galaxy role install process
- downloading role 'software', owned by painless
- downloading role from https://github.com/painless/ansible-role-software/archive/master.tar.gz
[ERROR]: failed to download the file: HTTP Error 404: Not Found
[WARNING]: - painless.software was NOT installed successfully.
ERROR! - you can use --ignore-errors to skip failed roles and finish processing the list.
Obviously, the repository painless/ansible-role-software
doesn't exist on GitHub. It should be painless-software/ansible-role-software
, which suggests that Galaxy NG enforces the default mapping (Ansible namespace = GitHub namespace) again.
I reported this with other details in the new Ansible Community forum.
Bug Report
SUMMARY
I am trying to release a new version of https://github.com/artis3n/ansible-role-tailscale. I used to use
master
, but moved over tomain
as the default branch.Galaxy fails to import the role - it is looking for a
master
branch. I am not sure whether this is configurable when I first sync the repo to Galaxy, but it does not look like I can force a re-sync of the role without deleting the role from Galaxy, which I do not want to do.STEPS TO REPRODUCE
master
as the default branch.main
.EXPECTED RESULTS
Galaxy always uses the default branch on the repo, or provides a method to force a re-sync to update the default branch stored by Galaxy for the role's repo.
ACTUAL RESULTS
Galaxy looked for
master
to exist on the repo and the role failed to import and update on Ansible Galaxy.