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 1133792

Summary: Creating user in v1 API returns: undefined method `key?' for #<JSON::Ext::Generator::State:...>
Product: Red Hat Satellite Reporter: Tomas Lestach <tlestach>
Component: APIAssignee: Bryan Kearney <bkearney>
Status: CLOSED WONTFIX QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: low    
Version: 6.0.4CC: cwelton, dcleal
Target Milestone: UnspecifiedKeywords: Reopened, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/7260
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-04 18:27:40 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:
Attachments:
Description Flags
relevant part of /var/log/foreman/production.log none

Description Tomas Lestach 2014-08-26 07:23:28 UTC
Description of problem:
API for user creation fails with:
{"message":"undefined method `key?' for #<JSON::Ext::Generator::State:0x0000000b3fd378>"}
but the user gets created!

Version-Release number of selected component (if applicable):
Satellite-6.0.4-RHEL-6-20140823.0-Satellite-x86_64

How reproducible:
always

Steps to Reproduce:

# curl "$(hostname)/api/users" -u admin:changeme -H "Accept: application/json" -H "Content-Type: application/json" -d '{"user":{"login":"another","mail":"root@localhost","auth_source_id":1,"password":"another_gfolvwxr"}}'


Actual results:
{"message":"undefined method `key?' for #<JSON::Ext::Generator::State:0x0000000b3fd378>"}

Additionally the user *was* created, even if an exception was thrown.

Expected results:
* no error && user gets created
or
* error && do not create the user

Comment 1 Tomas Lestach 2014-08-26 07:27:23 UTC
Created attachment 930760 [details]
relevant part of /var/log/foreman/production.log

Comment 3 Dominic Cleal 2014-08-26 09:36:11 UTC
The v2 API appears to be unaffected, please try using /api/v2/users.

Comment 5 Dominic Cleal 2014-08-26 09:37:47 UTC
Created redmine issue http://projects.theforeman.org/issues/7260 from this bug

Comment 6 Tomas Lestach 2014-08-26 09:57:49 UTC
V1 API ... my fault.
I created Bug 1133854 to remove V1 API from Sat6 completely.

Comment 7 Corey Welton 2014-09-04 18:22:58 UTC
Closing per comment #6

Comment 8 Corey Welton 2014-09-04 18:25:29 UTC
Or not...

Comment 10 Corey Welton 2014-09-04 18:27:40 UTC
OTOH...

Comment 11 Tomas Lestach 2014-09-05 08:07:16 UTC
So, the outcome is - "we keep it broken" ?