Project

Profile

Help

Issue #9360

closed

Cleanup doesn't work when import_content raises exception

Added by yuzheng over 3 years ago. Updated over 3 years 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//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.

Actions #1

Updated by gerrod over 3 years ago

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

Actions #2

Updated by yuzheng over 3 years 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.

Actions #3

Updated by yuzheng over 3 years ago

Actions #4

Updated by ipanova@redhat.com over 3 years ago

  • Tags Pulp 2 added
Actions #5

Updated by dkliban@redhat.com over 3 years ago

  • Triaged changed from No to Yes

Added by yuzheng over 3 years ago

Revision e85f2b95 | View on GitHub

Fix clean_orphans

delete_orphan_content_units_by_type requires a list of unit ids.

Closes #9360

Actions #6

Updated by yuzheng over 3 years ago

  • Status changed from NEW to MODIFIED

Also available in: Atom PDF