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" ?