Project

General

Profile

Bug #5750

Cannot set default_organization_id at user creation

Added by dustin tsang about 8 years ago. Updated about 8 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
Category:
API
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:

Description

https://bugzilla.redhat.com/show_bug.cgi?id=1092656

Created attachment 890865 [details]
part of /var/log/foreman/production.log

Description of problem:
Creation of an user via API with default_organization_id set fails with 500 ISE.

Version-Release number of selected component (if applicable):
Satellite-6.0.3-RHEL-6-20140423.1-Satellite-x86_64-dvd1.iso

How reproducible:
always

Steps to Reproduce:
1. Run @api.resource(:users).call(:create, user_hash) with following user_hash:
user_hash = {
:login => "newuser",
:firstname => "user",
:lastname => "new",
:mail => "root@localhost",
:auth_source_id => 1,
:password => "password",
:organization_ids => [13],
:default_organization_id => 13,
:location_ids => [],
:role_ids => [],
}

Actual results:
Creation of user failed with: 500 Internal Server Error: {
"error": {"message":"undefined method `key?' for #<JSON::Ext::Generator::State:0x007f696cecadd8>"}
}
but the user was created!

Expected results:
no exceptions or ISEs

Additional info:
- creating of the user without default_organization_id works and setting it using the user update API afterwards works as well


Related issues

Has duplicate Katello - Bug #5666: Cannot set default_organization_id at user creationDuplicate2014-05-12

History

#1 Updated by Dominic Cleal about 8 years ago

  • Project changed from Katello to Foreman
  • Category set to API
  • Status changed from New to Ready For Testing
  • Assignee set to dustin tsang
  • Target version set to 1.8.3

#2 Updated by Dmitri Dolguikh about 8 years ago

  • Target version changed from 1.8.3 to 1.8.2

#3 Updated by Dominic Cleal about 8 years ago

  • Has duplicate Bug #5666: Cannot set default_organization_id at user creation added

#4 Updated by dustin tsang about 8 years ago

The server is no longer giving a 500 internal error but a proper validation but proper validation is given.
Validation message and an example of a successful creation of a user can be seen in the link.
https://gist.github.com/dustint-rh/f3e0408e1cc937a8f4fb

#5 Updated by Dominic Cleal about 8 years ago

  • Status changed from Ready For Testing to Rejected
  • Target version deleted (1.8.2)

Also available in: Atom PDF