Actions
Bug #3515
closedAssociated resources not found by ID causes 500 Internal Server Error
Description
Description of problem:
making call of hammer cli:
`hammer --output base subnet create --name "allparams" --network "251.10.10.11" --mask "255.255.255.0" --gateway "251.10.10.255" --dns-primary "251.10.11.255" --dns-secondary "251.10.12.255" --from "251.10.10.10" --to "251.10.10.12" --vlanid "2" --domain-ids "1"` just fails with: === Could not create the subnet: Error: 500 Internal Server Error
Actual results:
500 - ISE
Expected results:
no exception. subnet needs to be created. Even if there is any error: proper message should be returned back.
Foreman production.log:
Started POST "/foreman/api/subnets" for 127.0.0.1 at 2013-10-25 06:23:19 -0400 Processing by Api::V1::SubnetsController#create as JSON Parameters: {"subnet"=>{"dns_secondary"=>"251.10.12.255", "network"=>"251.10.10.11", "from"=>"251.10.10.10", "mask"=>"255.255.255.0", "vlanid"=>"2", "to"=>"251.10.10.12", "domain_ids"=>["1"], "gateway"=>"251.10.10.255", "dns_primary"=>"251.10.11.255", "name"=>"allparams"}} Authorized user admin(Admin User) Couldn't find Domain with id=1 (ActiveRecord::RecordNotFound)
Updated by Tomáš Strachota about 11 years ago
- Project changed from Hammer CLI to Foreman
- Category changed from Foreman commands (obsolete) to API
This is actually problem on api side. I've switched the project/category of the bug.
Api should return 404 with better message when an associated resource is not found.
From the foreman log:
Domain Load (0.1ms) SELECT "domains".* FROM "domains" WHERE "domains"."id" = $1 ORDER BY domains.name LIMIT 1 [["id", 83]] Couldn't find Domain with id=83 (ActiveRecord::RecordNotFound) ... Rendered api/v2/errors/standard_error.json.rabl (0.6ms) Completed 500 Internal Server Error in 19.5ms (Views: 9.7ms | ActiveRecord: 1.7ms)
Updated by Anonymous about 11 years ago
- Target version changed from 1.10.0 to 1.9.3
Updated by Daniel Lobato Garcia about 11 years ago
Updated by Dominic Cleal about 11 years ago
- Status changed from New to Ready For Testing
- Assignee set to Daniel Lobato Garcia
Updated by Daniel Lobato Garcia about 11 years ago
- Related to Bug #3915: Hammer does not handle 404s well added
Updated by Daniel Lobato Garcia about 11 years ago
- Related to deleted (Bug #3915: Hammer does not handle 404s well)
Updated by Daniel Lobato Garcia about 11 years ago
- Blocks Bug #3915: Hammer does not handle 404s well added
Updated by Anonymous almost 11 years ago
- Target version changed from 1.9.3 to 1.9.2
Updated by Dominic Cleal almost 11 years ago
- Translation missing: en.field_release set to 2
Updated by Daniel Lobato Garcia almost 11 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 46338cd73c542ecc3aa045b45e831434792c710e.
Actions