Bug #34373

Importing content fails if an importer with same name already exists

Added by Partha Aji 5 months ago. Updated 5 months ago.

Inter Server Sync
Target version:
Bugzilla link:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:


Description of problem:

If a previous import attempt left an importer created on pulp and a new import task is created with the same source tarball, the new task fails complaining about the importer already being created.

There's no easy way to cleanup the importer (from a user perspective).

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Start an import task
2. make the import task fail unexpectedly (kill the worker importing it, for example)
3. cancel/cleanup the task (if you skip the failed step and resume, the importer will be removed)
4. Cleanup the imported CV on Foreman Server
5. Try importing again

Actual results:

  1. hammer content-import version --organization-id 5 --path /var/lib/pulp/imports/test3_kickstart_rhel7/1.0/2022-01-14T11-34-09-05-00/
    [............................. ] [13%]
    Error: Error message: the server returns an error
    HTTP status code: 400
    Response headers: {"Date"=>"Thu, 20 Jan 2022 21:48:48 GMT", "Server"=>"gunicorn", "Content-Type"=>"application/json", "Vary"=>"Accept,Cookie", "Allow"=>"GET, POST, HEAD, OPTIONS", "X-Frame-Options"=>"SAMEORIGIN", "Content-Length"=>"39", "Correlation-ID"=>"28a90f8e-405b-444c-ba13-c80d62b06632", "Access-Control-Expose-Headers"=>"Correlation-ID", "Via"=>"1.1", "Connection"=>"close"}
    Response body: {"name":["This field must be unique."]}

Expected results:

Import should work anyway or at least return a more meaningful error.

Additional info:

Associated revisions

Revision 76333391 (diff)
Added by Partha Aji 5 months ago

Fixes #34373 - Delete importer if import fails (#9916)

If the import action from pulp fails for whatever reason, dynflow goes
in the paused state expecting user to resume/skip the action. Some users
have used foreman-task cleanup to delete tasks which removes tasks and
leaves the created importer alive instead of cleaning up.

This commit skips the import action and automatically deletes the
importer if the import fails. So if pulp fails we will skip this action
and run through all the other steps and then leave it to the user to
delete the version .


#1 Updated by The Foreman Bot 5 months ago

  • Assignee set to Partha Aji
  • Status changed from New to Ready For Testing
  • Pull request added

#2 Updated by Partha Aji 5 months ago

  • Bugzilla link set to 2043248

#3 Updated by Ryan Verdile 5 months ago

  • Triaged changed from No to Yes
  • Target version changed from Katello 4.4.0 to Katello 4.3.1

#4 Updated by The Foreman Bot 5 months ago

  • Fixed in Releases Katello 4.5.0 added

#5 Updated by Partha Aji 5 months ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF