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 2129950 - ISE when creating a CV with org_id specified as array
Summary: ISE when creating a CV with org_id specified as array
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: API
Version: 6.12.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.13.0
Assignee: Samir Jha
QA Contact: Peter Ondrejka
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-09-26 19:09 UTC by Lukáš Hellebrandt
Modified: 2023-05-03 13:23 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-03 13:22:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
production.log (13.32 KB, text/plain)
2022-09-26 19:09 UTC, Lukáš Hellebrandt
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 35816 0 Normal New ISE when creating a CV with org_id specified as array 2022-12-02 14:03:27 UTC
Red Hat Issue Tracker SAT-13682 0 None None None 2022-11-18 10:22:43 UTC
Red Hat Product Errata RHSA-2023:2097 0 None None None 2023-05-03 13:23:51 UTC

Description Lukáš Hellebrandt 2022-09-26 19:09:01 UTC
Created attachment 1914454 [details]
production.log

Description of problem:
When creating a CV through API, I get ISE (log attached) when I specify organization ID as a list of IDs:

$ curl -uadmin:<password> -k -H "Content-Type:application/json" -H "Accept:application/json" -X POST https://<FQDN>/katello/api/v2/content_views -d '{"name": "test1", "organization_id": [1], "api_version": "v2", "content_view": {"name": "test1", "organization_id": [1]}}'

{"displayMessage":"undefined method `start_with?' for [1]:Array","errors":["undefined method `start_with?' for [1]:Array"]}

The part before ":Array" is the value specified for organization_id


Version-Release number of selected component (if applicable):
Reproduced with Sat 6.12.0 snap 12.0 AND 6.11.3

How reproducible:
Deterministic

Steps to Reproduce:
curl -uadmin:<password> -k -H "Content-Type:application/json" -H "Accept:application/json" -X POST https://<FQDN>/katello/api/v2/content_views -d '{"name": "test1", "organization_id": [1], "api_version": "v2", "content_view": {"name": "test1", "organization_id": [1]}}'

Actual results:
Traceback, error, no CV created

Expected results:
Either CV created with the specified organization or at least correctly handled error, no ISE

Comment 1 Lukáš Hellebrandt 2022-09-26 21:47:39 UTC
In 6.9.7, this error was handled correctly:
$ curl -uadmin:<password> -k -H "Content-Type:application/json" -H "Accept:application/json" -X POST https://<FQDN>/katello/api/v2/content_views -d '{"name": "test1", "organization_id": [1], "api_version": "v2", "content_view": {"name": "test1", "organization_id": [1]}}'
{"displayMessage":"Unfiltered params array: organization_id.","errors":["Unfiltered params array: organization_id."]}

6.10.1 does this, still ok but it's interesting how often the behavior changes:
$ curl -uadmin:<password> -k -H "Content-Type:application/json" -H "Accept:application/json" -X POST https://<FQDN>/katello/api/v2/content_views -d '{"name": "test1", "organization_id": [1], "api_version": "v2", "content_view": {"name": "test1", "organization_id": [1]}}'
{"message":"Organization with id [1] not found"}

In 6.11.0 snap 26.0, the behavior was already the same as reported.

Marking this as regression but this was regression in 6.11.0 against 6.10.

Comment 5 Lukáš Hellebrandt 2022-11-18 09:49:07 UTC
Hello Samir, ISE is never a correct response and if this is common, it is one more reason to handle the exception correctly. Also, this specific case with a CV is a regression. To make it sound less horrible, I agree that this is low severity. It can't be considered normal or ok though.

Comment 9 Lukáš Hellebrandt 2022-11-22 14:33:14 UTC
Why did automation do that? I don't think it had any specific reason, it was just so written that it passed an array. I've fixed it, this doesn't block automation.

Comment 11 Samir Jha 2022-12-02 14:03:26 UTC
Created redmine issue https://projects.theforeman.org/issues/35816 from this bug

Comment 12 Bryan Kearney 2022-12-03 16:03:17 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/35816 has been resolved.

Comment 13 Peter Ondrejka 2023-01-05 14:01:12 UTC
Verified on Satellite 6.13 snap 4, using steps from problem desc. The api call receives:

{"message":"Organization with id [1] not found"}(broker) 

The prodlog contains no ISE:

2023-01-05T08:56:03 [I|app|9e12714c] Started POST "/katello/api/v2/content_views" <ip> at 2023-01-05 08:56:03 -0500
2023-01-05T08:56:03 [I|app|9e12714c] Processing by Katello::Api::V2::ContentViewsController#create as JSON
2023-01-05T08:56:03 [I|app|9e12714c]   Parameters: {"name"=>"test1", "organization_id"=>[1], "api_version"=>"v2", "content_view"=>{"name"=>"test1", "organization_id"=>[1]}}
2023-01-05T08:56:03 [I|app|9e12714c] Authorized user admin(Admin User)
2023-01-05T08:56:03 [I|app|9e12714c] Filter chain halted as :authorize rendered or redirected
2023-01-05T08:56:03 [I|app|9e12714c] Completed 404 Not Found in 270ms (Views: 1.1ms | ActiveRecord: 29.8ms | Allocations: 13891)

Comment 16 errata-xmlrpc 2023-05-03 13:22:11 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 (Important: Satellite 6.13 Release), 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/RHSA-2023:2097


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