Bug 1382124

Summary: Better handle 404 from Pulp and 410 GONE from Candlepin when removing objects
Product: Red Hat Satellite Reporter: Mike McCune <mmccune>
Component: RepositoriesAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED WONTFIX QA Contact: Katello QA List <katello-qa-list>
Severity: high Docs Contact:
Priority: high    
Version: 6.3.0CC: adprice, bbuckingham, bkearney, cduryee, ehelms, inecas, j.bittner, peter.vreman, sthirugn, wburrows
Target Milestone: UnspecifiedKeywords: FieldEngineering, PrioBumpField, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-09-04 18:01:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1122832    

Description Mike McCune 2016-10-05 19:29:16 UTC
Whenever we try to delete an object in Pulp and Candlepin, there are situations where there is a pre-existing data mismatch because a user skipped a paused step or Force Unlocked a stuck task.

This leads customers to having to resort to KCS rake solutions such as:

https://access.redhat.com/solutions/1453313

where we forcibly mass-recreate objects in Pulp.

There are also situations where you try to delete or disable objects and the actual delete fails because it tries to call DELETE on the remote object via REST and gets a 404.

For cases with a delete hits a 404 trying to remove an object in Pulp/Candlepin, we should continue with the operation and not fail. If the object is gone in the remote API, then just finish out the transaction and delete the object

An example test case to induce this failure state:

1) Enable a repo in the Red Hat Repositories

2) use pulp-admin to delete said repo

3) Attempt to disable repo in Red Hat Repositories page and get a 404

You can run into this when trying to delete higher level containers such as an Organization delete. If any contained remote object in Candlepin or Pulp is missing, the Org delete will fail on 404 errors and the user is forced to hand-skip each step in the transaction until all missing object deletes are skipped.

We need to keep processing the removal and not fail.

Comment 2 Mike McCune 2016-10-05 20:08:03 UTC
rewording this to include handling 410 GONE return codes when removing an object from Candlepin, like we do with Consumers but for Organization/Owners and other associated objects.

Comment 8 Brad Buckingham 2017-08-14 12:44:04 UTC
Created redmine issue http://projects.theforeman.org/issues/20585 from this bug

Comment 9 Mike McCune 2017-08-23 16:26:12 UTC
*** Bug 1122825 has been marked as a duplicate of this bug. ***

Comment 10 Peter Vreman 2018-05-24 12:03:40 UTC
The BZ https://bugzilla.redhat.com/show_bug.cgi?id=1546974 is related as it implemented for Hosts better error recovery.

Comment 11 Bryan Kearney 2018-09-04 18:01:40 UTC
Thank you for your interest in Satellite 6. We have evaluated this request, and we do not expect this to be implemented in the product in the foreseeable future. We are therefore closing this out as WONTFIX. If you have any concerns about this, please feel free to contact Rich Jerrido or Bryan Kearney. Thank you.

Comment 12 Peter Vreman 2018-09-05 12:59:57 UTC
Why is this a WONTFIX? The description mentions a data inconsitency issue that can happen e.g. during a (unplanned) crash.
Acceptable is to close it then as a dup of BZ https://bugzilla.redhat.com/show_bug.cgi?id=1546974 that includes already improved error recovery

Comment 13 sthirugn@redhat.com 2018-09-05 13:54:53 UTC
Also addressed in these bugs which prevented host deletion failure if candlepin consumer is not found.
https://bugzilla.redhat.com/show_bug.cgi?id=1575140
https://bugzilla.redhat.com/show_bug.cgi?id=1624019

Comment 14 Red Hat Bugzilla 2023-09-15 00:00:13 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 500 days