Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2227289

Summary: File not accessible even after reuploading within the repo if the pulp artifact was mistakenly removed from the filesystem prior to the same
Product: Red Hat Satellite Reporter: Sayan Das <saydas>
Component: PulpAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED MIGRATED QA Contact: Satellite QE Team <sat-qe-bz-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.14.0CC: rlavi
Target Milestone: UnspecifiedKeywords: MigratedToJIRA, Triaged
Target Release: Unused   
Hardware: All   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-06-06 16:25:36 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 Sayan Das 2023-07-28 15:55:06 UTC
Description of problem:

Sequence:

* A file-type repo exists with no upstream URL specified.
* A file was uploaded to the repo manually
* The repo was made part of a CV and CV was republished

If we remove the artifact related to that file from the filesystem, then The only way to get back the file is by re-uploading it in the repo manually.

But even if the reupload would be successful, The file would still not be accessible from it's Published path


Version-Release number of selected component (if applicable):

Satellite 6.14

# rpm -q satellite katello python39-pulpcore
satellite-6.14.0-3.el8sat.noarch
katello-4.9.0-1.el8sat.noarch
python39-pulpcore-3.22.7-1.el8pc.noarch



How reproducible:

Always


Steps to Reproduce:
1. Install Satellite 6.14.0 with Org Name RedHat

2. Create a product called "Custom"

3. Create a file type repo called "FILE_NO_URL" in that product and that should not have any upstream URLs mentioned and it should be unprotected.

4. Upload a file called "rake_options" in that repo from UI or hammer

5. Create a CV called "TestCV", add that FILE_NO_URL repo in the CV and Publish a new version.

6. Do a curl on "http://satellite614.lab.example.com/pulp/content/RedHat/Library/custom/Custom/FILE_NO_URL/rake_options"

"http://satellite614.lab.example.com/pulp/content/RedHat/Library/custom/Custom/FILE_NO_URL/PULP_MANIFEST"

"http://satellite614.lab.example.com/pulp/content/RedHat/Library/TestCV/custom/Custom/FILE_NO_URL/rake_options"

"http://satellite614.lab.example.com/pulp/content/RedHat/Library/TestCV/custom/Custom/FILE_NO_URL/PULP_MANIFEST"


7. On satellite, "rm -rf /var/lib/pulp/media/artifact/*"

8. Repeat Step 6

9. Manually reupload the file rake_options back to the repo and perform a CV version republish as well.

10. Repeat Step 6

11. Delete the file from the repo ( using hammer or Sat UI )

12. Consider Orphan Protection Timeout and then run an orphan cleanup.

13. Repeat Step 9 

14. Repeat Step 6


Actual results:

No errors on any other steps except, Step 8 , 10 and 14

The PULP_MANIFEST would be present and can be fetched but the file rake_options is always missing.

Jul 28 21:04:00 satellite614 pulpcore-content[1851]: [28/Jul/2023:15:34:00 +0000] "GET /pulp/content/RedHat/Library/custom/Custom/FILE_NO_URL/ HTTP/1.1" 200 720 "https://satellite614.lab.example.com/products/389/repositories/108" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
Jul 28 21:04:02 satellite614 pulpcore-content[1844]: [2023-07-28 15:34:02 +0000] [1844] [ERROR] Error handling request
Jul 28 21:04:02 satellite614 pulpcore-content[1844]: Traceback (most recent call last):
Jul 28 21:04:02 satellite614 pulpcore-content[1844]:  File "/usr/lib64/python3.9/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
Jul 28 21:04:02 satellite614 pulpcore-content[1844]:    resp = await request_handler(request)
Jul 28 21:04:02 satellite614 pulpcore-content[1844]:  File "/usr/lib64/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle
Jul 28 21:04:02 satellite614 pulpcore-content[1844]:    resp = await handler(request)
Jul 28 21:04:02 satellite614 pulpcore-content[1844]:  File "/usr/lib64/python3.9/site-packages/aiohttp/web_middlewares.py", line 117, in impl
Jul 28 21:04:02 satellite614 pulpcore-content[1844]:    return await handler(request)
Jul 28 21:04:02 satellite614 pulpcore-content[1844]:  File "/usr/lib/python3.9/site-packages/pulpcore/content/authentication.py", line 41, in authenticate
Jul 28 21:04:02 satellite614 pulpcore-content[1844]:    return await handler(request)
Jul 28 21:04:02 satellite614 pulpcore-content[1844]:  File "/usr/lib/python3.9/site-packages/pulpcore/cache/cache.py", line 339, in cached_function
Jul 28 21:04:02 satellite614 pulpcore-content[1844]:    response = await self.make_entry(
Jul 28 21:04:02 satellite614 pulpcore-content[1844]:  File "/usr/lib/python3.9/site-packages/pulpcore/cache/cache.py", line 378, in make_entry
Jul 28 21:04:02 satellite614 pulpcore-content[1844]:    response = await handler(*args, **kwargs)
Jul 28 21:04:02 satellite614 pulpcore-content[1844]:  File "/usr/lib/python3.9/site-packages/pulpcore/content/handler.py", line 243, in stream_content
Jul 28 21:04:02 satellite614 pulpcore-content[1844]:    return await self._match_and_stream(path, request)
Jul 28 21:04:02 satellite614 pulpcore-content[1844]:  File "/usr/lib/python3.9/site-packages/pulpcore/content/handler.py", line 601, in _match_and_stream
Jul 28 21:04:02 satellite614 pulpcore-content[1844]:    return await self._serve_content_artifact(ca, headers, request)
Jul 28 21:04:02 satellite614 pulpcore-content[1844]:  File "/usr/lib/python3.9/site-packages/pulpcore/content/handler.py", line 847, in _serve_content_artifact
Jul 28 21:04:02 satellite614 pulpcore-content[1844]:    raise Exception(_("Expected path '{}' is not found").format(path))
Jul 28 21:04:02 satellite614 pulpcore-content[1844]: Exception: Expected path '/var/lib/pulp/media/artifact/92/5f04066d1649d1882cfd72db4514bb55154e1d8248452caf077cf7e8e3e655' is not found



Expected results:

If we are uploading back the file, It should be available in the repo. 

This would affect https://bugzilla.redhat.com/show_bug.cgi?id=2227276 , because if users have restored their satellite with no pulp data and want to recover the same, They can recover everything else but not the file type repos that is manually managed. 

Additional info:

I could be wrong but The only two probable ways to fix this would be:

A) Keep the file in an HTTP-exposed location, create a PULP_MANIFEST, use that location to define an upstream URL in the repo and then run a Repair Action ( i.e. Validate Content Checksum )

B) Or Completly delete the repo from everywhere in satellite, Cleanup orphaned contents and then recreate the repo with the files reuploaded in the repo

   And then again add back the repo in CV and republish the CV


This is perhaps NOT a regression and it exists in older versions but I never tried this approach before until I was testing for BZ# 2227276 .

Comment 1 Eric Helms 2024-06-06 16:25:36 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.