Project

General

Profile

Actions

Bug #5750

closed

Cannot set default_organization_id at user creation

Added by dustin tsang almost 10 years ago. Updated almost 10 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
Category:
API
Target version:
-
Difficulty:
Triaged:
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 1 (0 open1 closed)

Has duplicate Katello - Bug #5666: Cannot set default_organization_id at user creationDuplicate05/12/2014Actions
Actions #1

Updated by Dominic Cleal almost 10 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
Actions #2

Updated by Anonymous almost 10 years ago

  • Target version changed from 1.8.3 to 1.8.2
Actions #3

Updated by Dominic Cleal almost 10 years ago

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

Updated by dustin tsang almost 10 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

Actions #5

Updated by Dominic Cleal almost 10 years ago

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

Also available in: Atom PDF