Bug 2261948

Summary: Errors while deleting repository from Satellite: Unable to find content with the ID "XXXX"
Product: Red Hat Satellite Reporter: Sahil Bhasin <sabhasin>
Component: RepositoriesAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED MIGRATED QA Contact: Satellite QE Team <sat-qe-bz-list>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.14.1CC: ahumbe, dhjoshi, iballou, rlavi, sajha, saydas
Target Milestone: UnspecifiedKeywords: MigratedToJIRA, Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-06-06 17:01:03 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:

Description Sahil Bhasin 2024-01-30 14:49:28 UTC
Description of problem:

While deleting the repository from Satellite 6.14.1 
~~~~~~~~~~~
Katello::Errors::CandlepinError: Unable to find content with the ID "XXXX".
~~~~~~~~~~~

A similar BZ 2032040 was reported earlier and it was fixed in 6.13 but it seems in 6.14 also this Bug exists.

Actual results:

1. The content is missing in the Candlepin DB:

# su - postgres -c "psql candlepin -c \"select uuid, content_id, contentUrl, label, type, vendor from cp2_content where content_id = 'XXXX'\""

 uuid | content_id | contenturl | label | type | vendor
------+------------+------------+-------+------+--------
(0 rows)

2. But it's still referenced by some root repositories:

#  #  su - postgres -c "psql foreman -c \"select * from katello_root_repositories where content_id = '9134'\""
 id  |                              name                               |         created_at         |         updated_at         | major | minor | gpg_key_id | content_id |  arch
  |                              label                              |                                  url                                  | unprotected | content_type | product
_id | checksum_type | pulp_scratchpad_checksum_type | docker_upstream_name | download_policy | verify_ssl_on_sync | upstream_username | upstream_password | deb_releases | deb_com
ponents | deb_architectures | ssl_ca_cert_id | ssl_client_cert_id | ssl_client_key_id | ignorable_content | include_tags | description | ansible_collection_requirements |     htt
p_proxy_policy     | http_proxy_id | download_concurrency | os_versions | ansible_collection_auth_url | ansible_collection_auth_token | upstream_authentication_token | mirroring_
policy | retain_package_versions_count | generic_remote_options | exclude_tags | metadata_expire
-----+-----------------------------------------------------------------+----------------------------+----------------------------+-------+-------+------------+-----

 YYY | Red Hat OpenShift Container Platform 4.3 for RHEL 8 x86_64 RPMs | 2020-03-05 07:57:02.695964 | 2023-12-14 12:26:14.188373 |       |       |            | XXXX       | noarc
h | Red_Hat_OpenShift_Container_Platform_4_3_for_RHEL_8_x86_64_RPMs | https://cdn.redhat.com/content/dist/layered/rhel8/x86_64/rhocp/4.3/os | f           | yum          |
 30 |               |                               |                      | on_demand       | t                  |                   |                   |              |
        |                   |                |                    |                   | --- []           +|              |             |                                 | global_
default_http_proxy |               |                      |             |                             |                               |                               | mirror_com
plete  |                               |                        |              |
     |                                                                 |                            |                            |       |       |            |            |
  |                                                                 |                                                                       
(1 row)

Expected results:

It should delete the repository without any error.

Comment 8 Sayan Das 2024-05-08 15:36:45 UTC
One more case and the root cause is the same:

Some other Orphaned status of repo or product, causing some repo deletion\enable task to run into this issue.

Comment 10 Eric Helms 2024-06-06 17:01:03 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "SAT-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.