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 1206734

Summary: hammer repository upload-content throws error: "Error: Too many open files"
Product: Red Hat Satellite Reporter: Karl Hastings <kazen>
Component: HammerAssignee: Adam Ruzicka <aruzicka>
Status: CLOSED CURRENTRELEASE QA Contact: Tazim Kolhar <tkolhar>
Severity: high Docs Contact:
Priority: high    
Version: UnspecifiedCC: aruzicka, bbuckingham, bkearney, cwelton, kshirsal, pwayper, szadok, tkolhar, walden
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
URL: http://projects.theforeman.org/issues/10561
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-08-12 14:02:44 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:
Bug Depends On:    
Bug Blocks: 1115190    

Description Karl Hastings 2015-03-27 22:21:46 UTC
Description of problem:
It seems that when uploading multiple files hammer keeps an open file handle on all of them.  This causes the system to run out of file handles when trying to upload a large repository. 

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


How reproducible:
100%

Steps to Reproduce:
1. in a directory with more rpms than your `ulimit -n` do a 'hammer repository upload-content --name='TestLinux 6.5 content' --organization=Default_Organization --path=./'
2.
3.

Actual results:
upload fails with error:
Could not upload the content:
  Error: Too many open files - ./somefile.rpm

Expected results:
repository uploads successfully.

Additional info:

Comment 1 RHEL Program Management 2015-03-27 22:23:20 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 3 Bryan Kearney 2015-05-20 12:19:08 UTC
Created redmine issue http://projects.theforeman.org/issues/10561 from this bug

Comment 4 Walden Raines 2015-05-20 15:34:06 UTC
We should batch files that we open in order to avoid this OS level error.

Comment 5 Paul Wayper 2015-05-26 07:08:04 UTC
I would also suggest that, to conform to the standard convention of most other Unix commands, that the files to import be taken from the command line after all other arguments have been processed.  So one can simply do:

hammer repository upload-content --name='TestLinux 6.5 content' --organization=Default_Organization *.rpm

and have all the files listed on the command line batch uploaded.

Hope this helps,

Paul

Comment 6 Adam Ruzicka 2015-06-04 10:30:40 UTC
Paul Wayper: As for making hammer more Unix convention compliant, I would create a new bugzilla/issue for it since it's out of scope of this bug report.

Comment 11 Tazim Kolhar 2015-06-11 10:39:13 UTC
VERIFIED:
# rpm -qa | grep foreman
ruby193-rubygem-foreman_discovery-2.0.0.15-1.el7sat.noarch
foreman-libvirt-1.7.2.27-1.el7sat.noarch
ruby193-rubygem-foreman_gutterball-0.0.1.9-1.el7sat.noarch
hp-ml150g6-01.rhts.eng.bos.redhat.com-foreman-proxy-client-1.0-1.noarch
ruby193-rubygem-foreman_docker-1.2.0.14-1.el7sat.noarch
rubygem-hammer_cli_foreman_discovery-0.0.1.10-1.el7sat.noarch
foreman-selinux-1.7.2.13-1.el7sat.noarch
foreman-compute-1.7.2.27-1.el7sat.noarch
foreman-gce-1.7.2.27-1.el7sat.noarch
ruby193-rubygem-foreman-redhat_access-0.2.0-8.el7sat.noarch
rubygem-hammer_cli_foreman-0.1.4.14-1.el7sat.noarch
foreman-debug-1.7.2.27-1.el7sat.noarch
foreman-vmware-1.7.2.27-1.el7sat.noarch
ruby193-rubygem-foreman-tasks-0.6.12.8-1.el7sat.noarch
rubygem-hammer_cli_foreman_tasks-0.0.3.4-1.el7sat.noarch
rubygem-hammer_cli_foreman_docker-0.0.3.7-1.el7sat.noarch
foreman-proxy-1.7.2.5-1.el7sat.noarch
hp-ml150g6-01.rhts.eng.bos.redhat.com-foreman-client-1.0-1.noarch
ruby193-rubygem-foreman_bootdisk-4.0.2.13-1.el7sat.noarch
hp-ml150g6-01.rhts.eng.bos.redhat.com-foreman-proxy-1.0-2.noarch
foreman-ovirt-1.7.2.27-1.el7sat.noarch
rubygem-hammer_cli_foreman_bootdisk-0.1.2.7-1.el7sat.noarch
foreman-1.7.2.27-1.el7sat.noarch
ruby193-rubygem-foreman_hooks-0.3.7-2.el7sat.noarch
foreman-postgresql-1.7.2.27-1.el7sat.noarch

steps:
# hammer repository upload-content --name test_r --organization test_org --path=./ --product prod

Comment 12 Bryan Kearney 2015-08-11 13:28:23 UTC
This bug is slated to be released with Satellite 6.1.

Comment 13 Bryan Kearney 2015-08-12 14:02:44 UTC
This bug was fixed in version 6.1.1 of Satellite which was released on 12 August, 2015.