ansible / galaxy-issues

This repository exists solely for the tracking of user issues with Ansible Galaxy.
20 stars 3 forks source link

Failed import through command line locks out that role name #266

Closed rahul0705 closed 6 years ago

rahul0705 commented 7 years ago

If you try to import a role through command line and include the --role-name and you provide incorrect arguments it will timeout the import and key the role-name locked

example:

ansible-galaxy import rahul0705 rahul0705/ansible-certbot --role-name certbot

This was a mistake (the extra username in the repo field). This creates the following log:

Starting import 99571: role_name=certbot repo=rahul0705/rahul0705/ansible-certbot

Once that times out we still cannot use the certbot role name in the rahul0705 namespace.

Starting import 99568: role_name=ansible-certbot repo=rahul0705/ansible-certbot
Accessing branch: master
Parsing and validating meta data.
Setting role name to certbot
Parsing galaxy_tags
Parsing platforms
Adding dependencies
Parsing and validating README
Adding repo tags as role versions
Removing old tags
Import completed
Status SUCCESS : warnings=0 errors=0
Error saving role: duplicate key value violates unique constraint "main_role_namespace_36aa1070a7d8dc70_uniq" DETAIL: Key (namespace, name)=(rahul0705, certbot) already exists.
rahul0705 commented 7 years ago

Also if possible, can that role be deleted? looking through the source code it looks like only staff can fix this issue, until a fix to adding roles is made.

rahul0705 commented 6 years ago

Is there a way of deleting an import?

Because when I try to delete the incorrect import I get

% ansible-galaxy delete -vvv rahul0705 rahul0705/ansible-certbot
No config file found; using defaults
Opened /Users/rahul/.ansible_galaxy
https://galaxy.ansible.com/api/v1/removerole/?github_user=rahul0705&github_repo=rahul0705/ansible-certbot
ERROR! Galaxy user rahul does not have access to repo rahul0705/rahul0705/ansible-certbot
chouseknecht commented 6 years ago

@rahul0705

Apologies for not seeing and responding to this. Got your email. I deleted the ansible-certbot role. In theory, you should be able to import it from scratch.

rahul0705 commented 6 years ago

@chouseknecht

I will try the import, but a quick look at my list if imports show that the import rahul0705/rahul0705/ansible-certbot (the repo that does not exist) is still on the list.

After trying to use the slider on https://galaxy.ansible.com/roleadd#/ it seems that the repo rahul0705/ansible-certbot stays in the running state. When I press the running link for more details I only see the rahul0705/rahul0705/ansible-certbot (the repo that does not exist) in the list, no tasks for the new correct repo.

chouseknecht commented 6 years ago

@rahul0705

The imports are now deleted as well. Let me know if that fixes it.

rahul0705 commented 6 years ago

Normal import was successful:

% ansible-galaxy import -vvv rahul0705 ansible-certbot                     
No config file found; using defaults
Opened /Users/rahul/.ansible_galaxy
https://galaxy.ansible.com/api/v1/imports/
Successfully submitted import request 122393
https://galaxy.ansible.com/api/v1/imports/?id=122393
Starting import 122393: role_name=ansible-certbot repo=rahul0705/ansible-certbot
Accessing branch: master
Parsing and validating meta data.
https://galaxy.ansible.com/api/v1/imports/?id=122393
Parsing galaxy_tags
Parsing platforms
Adding dependencies
Parsing and validating README
Adding repo tags as role versions
Removing old tags
Import completed
Status SUCCESS : warnings=0 errors=0

But when renaming it to certbot I get the same conflict as before:

Starting import 122394: role_name=ansible-certbot repo=rahul0705/ansible-certbot
Accessing branch: master
Parsing and validating meta data.
Setting role name to certbot
Parsing galaxy_tags
Parsing platforms
Adding dependencies
Parsing and validating README
Adding repo tags as role versions
Removing old tags
Import completed
Status SUCCESS : warnings=0 errors=0
Error saving role: duplicate key value violates unique constraint "main_role_namespace_36aa1070a7d8dc70_uniq" DETAIL: Key (namespace, name)=(rahul0705, certbot) already exists.

Any suggestions?

chouseknecht commented 6 years ago

OK. There was an ansible-certbot role and a certbot role. I had only deleted the ansible-certbot one. Now they are both deleted. Give it another try.

rahul0705 commented 6 years ago

that worked 👍 thank you so much and sorry for all the trouble! if you want to close this issue I'm good with that (or I can close it if you want) 👍