Project

Profile

Help

Issue #9360

Cleanup doesn't work when import_content raises exception

Added by yuzheng about 1 month ago. Updated about 1 month ago.

Status:
MODIFIED
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

A repo sync task failed with error:

Content import of /var/lib/pulp/working/reserved_resource_worker-4@pulp-docker04.web.prod.ext.phx2.redhat.com/005cfc84-9b50-42d2-8a04-28e60b16f5e5/sha256:801e265f146090ed6045b2d673922e7aef38bebecaeb65dba770ea84b351c6b2 failed - must be an existing file

But the unit sha256:801e265f146090ed6045b2d673922e7aef38bebecaeb65dba770ea84b351c6b2 should be removed in the task, but it's not.

Associated revisions

Revision e85f2b95 View on GitHub
Added by yuzheng about 1 month ago

Fix clean_orphans

delete_orphan_content_units_by_type requires a list of unit ids.

Closes #9360

History

#1 Updated by gerrod about 1 month ago

Can you list some steps you took to produce this error and which version of pulp and its plugins you were using?

#2 Updated by yuzheng about 1 month ago

Version: pulp-2.17

Reproducing steps:

  1. Make pulp raise error PLP0037 (Content import of %(path)s failed - must be an existing file"). It could happen when there's a bad network connection. The easiest way to reproduce the issue is updating pulp to always raise it in importing content:

https://github.com/pulp/pulp/blob/2-master/server/pulp/server/db/model/__init__.py#L921

-        if not os.path.isfile(path):
+        if True:
             raise exceptions.PulpCodedException(error_code=error_codes.PLP0037, path=path)
  1. Make a repo sync request via repositories/{REPO_ID}/actions/sync/

Expected result: repo sync task fails and no new unit is create.

Actual result: repo sync task fails as expected, but an orphan unit is created in db.

#3 Updated by yuzheng about 1 month ago

#4 Updated by ipanova@redhat.com about 1 month ago

  • Tags Pulp 2 added

#5 Updated by dkliban@redhat.com about 1 month ago

  • Triaged changed from No to Yes

#6 Updated by yuzheng about 1 month ago

  • Status changed from NEW to MODIFIED

Please register to edit this issue

Also available in: Atom PDF