Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #37600 - ignore missing content on RH repo deletion #11291

Merged

Conversation

ianballou
Copy link
Member

@ianballou ianballou commented Jan 27, 2025

What are the changes introduced in this pull request?

If the Candlepin SetContent action is trying to work with Content that don't exist, move on instead of erroring out with a 404.

Considerations taken when implementing this change?

I'm still not 100% certain if any action needs to be taken to remove the references to the Content that are missing in Candlepin.

In the case of my reproducer system, it seems like the deleted repository left behind an empty Red Hat product. I'm not sure how much better we can recover from that situation given that there is already some data corruption required to hit this issue.

Never mind this, the Product did disappear after all.

What are the testing steps for this pull request?

  1. Create an environment with some Red Hat repositories that refer to content that does not exist in Candlepin
    a) I tested this with a reproducer machine, but to create your own reproducer it's likely that the Candlepin DB will need to be modified.
  2. Apply the patch
  3. Delete the repository and see that it completes successfully

@ianballou ianballou force-pushed the 37600-skip-content-delete-on-404 branch 2 times, most recently from 9cf54a8 to c5d545e Compare January 27, 2025 22:15
@ianballou ianballou force-pushed the 37600-skip-content-delete-on-404 branch from c5d545e to 3710dd4 Compare January 29, 2025 17:17
Copy link
Member

@chris1984 chris1984 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK, works well. Deleted the troublesome repos and it worked fine:

[root@rhvstlp1 certs_temp]# hammer repository destroy --id 1458 --organization-id 1
Repository deleted.
[root@rhvstlp1 certs_temp]# hammer repository destroy --id 1459 --organization-id 1
Repository deleted.

Then ran a script to delete repo id's from 1-2000 and that worked without any issues:

Deleting repo 17
Could not delete the Repository:
  Could not find repository resource with id 17. Potential missing permissions: destroy_products
Deleting repo 18
Repository deleted.
Deleting repo 19
Repository deleted.
Deleting repo 20
Deleting repo 1998
Could not delete the Repository:
  Could not find repository resource with id 1998. Potential missing permissions: destroy_products
Deleting repo 1999
Could not delete the Repository:
  Could not find repository resource with id 1999. Potential missing permissions: destroy_products
Deleting repo 2000
Could not delete the Repository:
  Could not find repository resource with id 2000. Potential missing permissions: destroy_products

@ianballou ianballou merged commit fae8471 into Katello:master Jan 29, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants