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 2192717

Summary: Uploading 3rd party packages not correcting the name format
Product: Red Hat Satellite Reporter: Amar Ganbat <aganbat>
Component: PulpAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact: Satellite QE Team <sat-qe-bz-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.12.3CC: dalley
Target Milestone: UnspecifiedKeywords: Regression, 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: 2023-05-23 04:59:45 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 Amar Ganbat 2023-05-02 21:02:35 UTC
Description of problem:

When uploading 3rd party package with the wrong name format with '_', like  nomachine_8.4.2_1_x86_64.rpm or zoom_x86_64.rpm pulp3 is not correcting it. 

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

satellite 6.12 pulp3 

How reproducible:

1. Create a product, create a repo, and manually upload a package with '_' in the name.

2. Query the tables
~~~
su - postgres -c "psql pulpcore -c \"select content_ptr_id, name, version, release, epoch, arch, location_href from rpm_package where location_href ilike '%nomachine%';\""
            content_ptr_id            |         name          | version | release | epoch |  arch  |                     location_href                     
--------------------------------------+-----------------------+---------+---------+-------+--------+-------------------------------------------------------
8a7cb39e-ca16-4a53-9589-ab024aae641b | nomachine             | 8.4.2   | 1       | 0     | x86_64 | nomachine-8.4.2-1.x86_64.rpm


su - postgres -c "psql pulpcore -c \"select * from core_contentartifact where content_id in (select content_ptr_id from rpm_package where location_href ilike '%nomachine%');\""
               pulp_id                |         pulp_created          |       pulp_last_updated       |               relative_path                |             artifact_id              |              content_id              
--------------------------------------+-------------------------------+-------------------------------+--------------------------------------------+--------------------------------------+--------------------------------------

9875da6f-891b-4df8-8841-b5f4dbcda879 | 2023-04-20 12:23:58.932566-05 | 2023-04-20 12:23:58.93258-05  | nomachine_8.4.2_1_x86_64.rpm               | 8e41e09d-4b88-4ccf-89f1-3fce0108e96f | 8a7cb39e-ca16-4a53-9589-ab024aae641b
~~~

or zoom package

~~~
su - postgres -c "psql pulpcore -c \"select content_ptr_id, name, version, release, epoch, arch, location_href from rpm_package where location_href ilike '%zoom%';\""
            content_ptr_id            | name |     version     | release | epoch |  arch  |                location_href                 

 602c4956-7a1b-4bfe-a187-1b58126fb62b | zoom | 5.14.5.2430     | 1       | 0     | x86_64 | zoom-5.14.5.2430-1.x86_64.rpm


su - postgres -c "psql pulpcore -c \"select * from core_contentartifact where content_id in (select content_ptr_id from rpm_package where location_href ilike '%zoom%');\""
               pulp_id                |         pulp_created          |       pulp_last_updated       |           relative_path           |             artifact_id              |              content_id              
--------------------------------------+-------------------------------+-------------------------------+-----------------------------------+--------------------------------------+--------------------------------------

d4c8671c-fecf-41bb-af1d-5a679be7c0b4 | 2023-04-20 11:44:03.491748-05 | 2023-04-20 11:44:03.491768-05 | zoom_x86_64.rpm                   | b6c97253-9f13-4297-828c-aa866ee148b2 | 602c4956-7a1b-4bfe-a187-1b58126fb62b
~~~~


Actual results:

yum can't find the package with the correct name format

[MIRROR] zoom-5.14.5.2430-1.x86_64.rpm: Status code: 404 for https://satellite/lce/cv..... /Packages/z/zoom-5.14.5.2430-1.x86_64.rpm


Expected results:

After this update and metadata generate yum works. Assuming relative_path='zoom-5.14.5.2430-1.x86_64.rpm' format needs to be correct from the initial package upload process.

# su - postgres -c "psql -d pulpcore -c \"UPDATE core_contentartifact SET relative_path='zoom-5.14.5.2430-1.x86_64.rpm' where content_id='602c4956-7a1b-4bfe-a187-1b58126fb62b'\""

# su - postgres -c "psql -d pulpcore -c \"UPDATE core_contentartifact SET relative_path='nomachine-8.4.2-1.x86_64.rpm' where content_id='8a7cb39e-ca16-4a53-9589-ab024aae641b'\""


Additional info: 

This wasn't a problem in the pulp2 era. The same package uploaded to 6.9 resulted in the correct naming format inside the pulp directory.

# ls -l /var/lib/pulp/published/yum/https/repos/Operations/Library/custom/zoom/zoom_repo/Packages/z/zoom-5.14.5.2430-1.x86_64.rpm 
lrwxrwxrwx. 1 apache apache 127 May  2 11:40 /var/lib/pulp/published/yum/https/repos/Operations/Library/custom/zoom/zoom_repo/Packages/z/zoom-5.14.5.2430-1.x86_64.rpm -> /var/lib/pulp/content/units/rpm/86/5683a79432ad5bb035d8b21962d2b74faa6266e6002116d4d370a7b4810d99/zoom-5.14.5.2430-1.x86_64.rpm

Comment 1 Daniel Alley 2023-05-23 04:59:45 UTC
Duplicate of https://bugzilla.redhat.com/show_bug.cgi?id=2161993 with a little bit of relevant discussion also on https://bugzilla.redhat.com/show_bug.cgi?id=2151657

*** This bug has been marked as a duplicate of bug 2161993 ***