fao89 / pulp_ansible

A Pulp plugin that manages Ansible content, i.e. roles, collections
https://pulp-ansible.readthedocs.io/en/latest/
GNU General Public License v2.0
0 stars 0 forks source link

Failed imports leave orphaned artifacts blocking subsequent attempts #24

Open fao89 opened 2 years ago

fao89 commented 2 years ago

Author: ironfroggy (ironfroggy)

Redmine Issue: 5666, https://pulp.plan.io/issues/5666


When an imported is begun and fails, after uploading the artifact and attempting to spawn the import task, the artifact itself is still present. As such, any attempt to publish the same artifact again fails with "Artifact already exists", even though it was never completed successfully and is not available.

fao89 commented 2 years ago

From: ironfroggy (ironfroggy) Date: 2019-11-05T18:47:37Z


{"errors":[{"status":"400","code":"invalid","title":"Invalid input.","detail":"Artifact already exists."}]}
fao89 commented 2 years ago

From: daviddavis (daviddavis) Date: 2019-11-12T12:28:24Z


I confirmed that this problem is specific to pulp_ansible. In pulpcore, we reuse any existing artifact:

https://github.com/pulp/pulpcore/blob/2161bf71ddce76394933fe0d52b09194a2153501/pulpcore/plugin/viewsets/content.py#L47-L51

It looks like the behavior is different for pulp_ansible:

https://github.com/pulp/pulp_ansible/blob/e8a9176cef731b7646aa770608ec2276802ccd10/pulp_ansible/app/galaxy/v3/views.py#L147-L150