Bug 1382582

Summary: SRPMs should not be allowed to upload in a satellite product.
Product: Red Hat Satellite Reporter: Vishwanath <vmeghana>
Component: RepositoriesAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED WONTFIX QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2.0CC: bbuckingham, jcallaha, rakumar, redhatbugs
Target Milestone: UnspecifiedKeywords: 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: 2018-09-04 18:05:22 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:

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.