Bug 1382582 - SRPMs should not be allowed to upload in a satellite product.
Summary: SRPMs should not be allowed to upload in a satellite product.
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Repositories
Version: 6.2.0
Hardware: x86_64
OS: Linux
medium
medium vote
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-07 05:40 UTC by Vishwanath
Modified: 2021-06-10 11:34 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-09-04 18:05:22 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 17746 0 Normal New SRPMs should not be allowed to upload in a satellite product. 2020-12-01 11:45:28 UTC

Description Vishwanath 2016-10-07 05:40:55 UTC
Description of problem:
SRPMs should not be allowed to upload in a satellite product. 


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

How reproducible:
1. Go to Content -> Products and create a New Product.
2. In the new Product, create a new Repository using "Type: yum".
3. In the new Repository, click 'Browse...' in the "Upload Package" box.
4. Select any SRPM package file (for convenience, I'll attach an example).
5. Click the 'Upload' button in the "Upload Package" box.

You should see an error like the following appear:
Error during upload: Task 4ffb5391-32f6-4a55-9ab1-3ab6de6e4e13: Katello::Errors::PulpError: PLP0047: The importer yum_importer indicated a failed response when uploading rpm unit to repository BSB-RHEL_MAX_CustomPkgs-RHEL7_MAX_CustomPkgs.

6. If you then go to Monitor -> Tasks and search for paused tasks, you should see the failed UploadFiles task that generated the above error.  If you click on the Errors tab in the task, you should see the error from my previous comment.  If you look in /var/log/foreman/production.log you should see the log messages listed in my previous comment.

7. Due to the lock held by this paused task, all subsequent attempts to upload any package (either an RPM or an SRPM) will fail.  To correct this problem and allow further upload attempts, you will need to manually delete the failed task using a slightly modified version of the commands listed on https://access.redhat.com/solutions/2089951


Actual results:
While uploading SRPMs system is throwing below error-
Pulp requires the file type to be specified when uploading content, but Satellite uploads both RPMs and SRPMs as file type "rpm".


Expected results:
Satellite should render a proper message to educate user that it's SRPMs cannot be uploaded.

Comment 2 Brad Buckingham 2016-12-19 18:27:09 UTC
Created redmine issue http://projects.theforeman.org/issues/17746 from this bug

Comment 4 Paul Donohue 2017-06-12 15:59:33 UTC
Vishwanath submitted this on my behalf.

I was actually expecting Satellite to submit SRPMs to pulp with file type "srpm", not to render a message indicating that SRPMs cannot be uploaded.

When I build custom RPMs, I'd like to keep the SRPMs in Satellite with the custom RPMs.  I currently have to keep SRPMs in a completely separate system, and I have to manually add/remove SRPMs from that other system as we add/remove RPMs in Satellite.  I would much prefer to keep the SRPMs and RPMs all in the same place.

Pulp does support SRPMs, so this should be possible.  The real issue here is that Satellite uploads both RPMs and SRPMs as the file type "rpm", while pulp requires SRPMs to be uploaded as file type "srpm".
From /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.73/app/models/katello/glue/pulp/repo.rb :
    710       def unit_type_id
    711         case content_type
    712         when Repository::YUM_TYPE
    713           "rpm"
    714         when Repository::PUPPET_TYPE
    715           "puppet_module"
    716         when Repository::DOCKER_TYPE
    717           "docker_manifest"
    718         when Repository::OSTREE_TYPE
    719           "ostree"
    720         when Repository::FILE_TYPE
    721           "iso"
    722         end
    723       end
I believe that adjusting this logic so that it checks the actual file type in addition to checking the repository type would solve this problem.

Comment 5 Bryan Kearney 2018-09-04 18:05:22 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.


Note You need to log in before you can comment on or make changes to this bug.