Project

General

Profile

Actions

Bug #3519

closed

500 error when creating a duplicate organization

Added by Dominic Cleal over 10 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Category:
API
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Description of problem:
When trying to create an org in foreman when an org with the same name already exists, an ISE is thrown. This is incongruent with such behavior for other subcommands

Steps to Reproduce:
1. 'hammer -u admin -p admin organization create --name foobar' ; note org is created
2. 'hammer -u admin -p admin organization create --name foobar'
3. View results

Actual results:
[root@cloud-qe-21 ~]# hammer -u admin -p admin organization create --name foobar
Could not create the organization:
Error: 500 Internal Server Error

Expected results:
Something like "Organization creation failed: An organization with this name already exists"

Foreman production.log:

Started POST "/api/organizations" for ::1 at 2013-10-25 13:42:55 +0000
Processing by Api::V2::OrganizationsController#create as JSON
  Parameters: {"organization"=>{"name"=>"test"}}
Authorized user admin(Admin User)
undefined method `permission_failed?' for #<Organization:0x000000080a6218> (NoMethodError)
/opt/rh/ruby193/root/usr/share/gems/gems/activemodel-3.2.8/lib/active_model/attribute_methods.rb:407:in `method_missing'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/attribute_methods.rb:149:in `method_missing'
/usr/share/foreman/app/controllers/api/base_controller.rb:54:in `process_resource_error'
/usr/share/foreman/app/controllers/api/base_controller.rb:71:in `process_response'
/usr/share/foreman/app/controllers/concerns/api/v2/taxonomies_controller.rb:47:in `create'

(https://bugzilla.redhat.com/show_bug.cgi?id=1023125)


Related issues 1 (0 open1 closed)

Has duplicate Foreman - Bug #4211: [RFE] Creating a duplicate org does not provide useful feedbackDuplicate01/28/2014Actions
Actions #1

Updated by Martin Bacovsky about 10 years ago

  • Assignee set to Daniel Lobato Garcia
Actions #2

Updated by Dominic Cleal about 10 years ago

  • Has duplicate Bug #4211: [RFE] Creating a duplicate org does not provide useful feedback added
Actions #3

Updated by Daniel Lobato Garcia about 10 years ago

  • Status changed from New to Assigned
Actions #4

Updated by Dominic Cleal about 10 years ago

Taxonomies are missing Authorization, but in addition, the API error handler assumes all resources have it.

Actions #5

Updated by Daniel Lobato Garcia about 10 years ago

  • Status changed from Assigned to Ready For Testing
Actions #6

Updated by Dominic Cleal about 10 years ago

  • Target version set to 1.9.1
Actions #7

Updated by Dominic Cleal about 10 years ago

  • translation missing: en.field_release set to 5
Actions #8

Updated by Daniel Lobato Garcia about 10 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF