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 1329292 - Can't upload repository content via API
Summary: Can't upload repository content via API
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Repositories
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: David Davis
QA Contact: Katello QA List
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-21 14:33 UTC by Andrii Balakhtar
Modified: 2019-09-26 13:59 UTC (History)
1 user (show)

Fixed In Version: rubygem-katello-3.0.0.27-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-27 11:02:19 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 14819 0 None None None 2016-04-26 14:05:11 UTC

Description Andrii Balakhtar 2016-04-21 14:33:20 UTC
Description of problem:
Cannot upload content into repository via API, receiving 500 Error NoMethodError: undefined method `collect' for #<ActionDispatch::Http::UploadedFile:0x007fa0505974a8>
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.18/app/controllers/katello/api/v2/repositories_controller.rb:266:in `upload_content'


Version-Release number of selected component (if applicable):
Sat6.2 Beta Snap9

How reproducible:
Always

Steps to Reproduce:
1. Make sure you have some product with repo.
2. Try to upload repo content via API (POST /katello/api/repositories/:id/upload_content)
3.

Actual results:
2016-04-21 17:20:19 - nailgun.client - DEBUG - Making HTTP POST request to https://example.com/katello/api/v2/repositories/248/upload_content with options {'files': {'content': <open file '/home/andrii/workspace/robottelo/tests/foreman/data/which-2.19-6.el6.x86_64.rpm', mode 'rb' at 0x7f7bf27dbed0>}, 'verify': False, 'auth': ('admin', '***')} and no data.
2016-04-21 17:20:20 - nailgun.client - WARNING - Received HTTP 500 response: {"displayMessage":"undefined method `collect' for #\u003cActionDispatch::Http::UploadedFile:0x007fa0505974a8\u003e","errors":["undefined method `collect' for #\u003cActionDispatch::Http::UploadedFile:0x007fa0505974a8\u003e"]}

Expected results:
Content was uploaded successfully

Additional info:
Works as expected via CLI

Comment 4 Partha Aji 2016-04-26 13:57:08 UTC
Created redmine issue http://projects.theforeman.org/issues/14819 from this bug

Comment 5 Bryan Kearney 2016-05-03 16:19:17 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/14819 has been closed

Comment 6 Andrii Balakhtar 2016-05-17 11:05:30 UTC
VERIFIED on Sat 6.2.0 GA SNAP 11. All the automated tests which are using `upload_content` are passing.

Comment 7 Bryan Kearney 2016-07-27 11:02:19 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1501


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