Project

General

Profile

Actions

Bug #4154

closed

API for Model deletion is not passing the ID parameter

Added by Og Maciel almost 11 years ago. Updated over 6 years ago.

Status:
Resolved
Priority:
Normal
Category:
Foreman commands (obsolete)
Target version:
Difficulty:
Triaged:
Team Backlog:
Fixed in Releases:
Found in Releases:
In Kanboard:

Description

Our automation has found the following issue:

Started POST "/api/models" for 10.16.45.160 at 2014-01-21 14:10:53 -0500
Processing by Api::V2::ModelsController#create as JSON
  Parameters: {"model"=>{"name"=>"tv0426"}, "apiv"=>"v2"}
Expire fragment views/tabs_and_title_records-1 (0.1ms)
Authorized user admin(Admin User)
Completed 201 Created in 44ms (Views: 1.2ms | ActiveRecord: 0.0ms)

Started GET "/api/models?page=1&per_page=20&search=name%3D%22tv0426%22" for 10.16.45.160 at 2014-01-21 14:11:01 -0500
Processing by Api::V2::ModelsController#index as JSON
  Parameters: {"page"=>"1", "per_page"=>"20", "search"=>"name=\"tv0426\"", "apiv"=>"v2", "model"=>{}}
Authorized user admin(Admin User)
  Rendered api/v2/models/index.rabl within api/v2/layouts/index_layout (4.4ms)
Completed 200 OK in 36ms (Views: 5.3ms | ActiveRecord: 17.2ms)

Started GET "/api/models/tv0426" for 10.16.45.160 at 2014-01-21 14:11:02 -0500
Processing by Api::V2::ModelsController#show as JSON
  Parameters: {"apiv"=>"v2", "id"=>"tv0426", "model"=>{}}
Authorized user admin(Admin User)
  Rendered api/v2/models/show.rabl (2.0ms)
Completed 200 OK in 37ms (Views: 2.9ms | ActiveRecord: 20.6ms)

Started DELETE "/api/models/" for 10.16.45.160 at 2014-01-21 14:11:03 -0500

ActionController::RoutingError (No route matches [DELETE] "/api/models"):
  /usr/lib/ruby/gems/1.8/gems/passenger-4.0.5/lib/phusion_passenger/rack/thread_handler_extension.rb:77:in `process_request'
  /usr/lib/ruby/gems/1.8/gems/passenger-4.0.5/lib/phusion_passenger/request_handler/thread_handler.rb:140:in `accept_and_process_next_request'
  /usr/lib/ruby/gems/1.8/gems/passenger-4.0.5/lib/phusion_passenger/request_handler/thread_handler.rb:108:in `main_loop'
  /usr/lib/ruby/gems/1.8/gems/passenger-4.0.5/lib/phusion_passenger/request_handler.rb:441:in `block (3 levels) in start_threads'

Started GET "/api/models/tv0426" for 10.16.45.160 at 2014-01-21 14:11:04 -0500
Processing by Api::V2::ModelsController#show as JSON
  Parameters: {"apiv"=>"v2", "id"=>"tv0426", "model"=>{}}
Authorized user admin(Admin User)
  Rendered api/v2/models/show.rabl (1.8ms)
Completed 200 OK in 33ms (Views: 2.5ms | ActiveRecord: 19.4ms)
Actions #1

Updated by Dominic Cleal almost 11 years ago

  • Project changed from Foreman to Hammer CLI
  • Category set to Foreman commands (obsolete)
Actions #2

Updated by Dominic Cleal almost 11 years ago

  • Target version set to 1.9.1
Actions #3

Updated by Tomáš Strachota over 10 years ago

  • Status changed from New to Assigned
  • Assignee set to Tomáš Strachota
Actions #4

Updated by Tomáš Strachota over 10 years ago

  • Status changed from Assigned to Need more information

I'm a bit confused. Og, can you please provide more information about where the problem occurs? It seems like this problem should be reported rather as an API issue.

I tested model related deletion in hammer and it seems to work for me.

I'm not sure what is the problem even in case it's an API issue reported in a wrong category. From the log in the description it seems like you're hitting wrong route. There's no delete action defined on /api/models/

Actions #5

Updated by Dominic Cleal over 10 years ago

It looks like Hammer's not appending the ID to DELETE "/api/models/"? It should be DELETE /api/models/12345.

Actions #6

Updated by Tomáš Strachota over 10 years ago

'hammer model delete' seem to work fine for me. And because hammer isn't mentioned anywhere in the issue description I'm wondering whether the intention was really to report it against hammer.

Actions #7

Updated by Dominic Cleal over 10 years ago

Good point! I might have assumed that, sorry. Og?

Actions #8

Updated by Og Maciel over 10 years ago

  • Status changed from Need more information to Feedback

Sorry guys for not being explicit about how it was tested. I checked the Foreman commands box but should have also included the hammer cli command. Yes, the ID is not being passed in the request (using hammer cli command) and therefore nothing gets deleted.

Actions #9

Updated by Dominic Cleal over 10 years ago

Maybe it needs re-testing then, since I think how names are looked up has changed in Hammer recently.

Actions #10

Updated by Tomáš Strachota over 10 years ago

I think so. Og, re-test it, please.

Actions #11

Updated by Anonymous over 10 years ago

  • Target version changed from 1.9.1 to 1.9.0
Actions #12

Updated by Og Maciel over 10 years ago

[root@qetello01 ~]# hammer organization delete --name jgotfcbe
Could not delete the organization:
  Error: 400 Bad Request

Started GET "/katello/api/organizations?search=name+%3D+jgotfcbe" for 127.0.0.1 at 2014-03-03 08:17:50 -0500
Processing by Katello::Api::V2::OrganizationsController#index as JSON
  Parameters: {"search"=>"name = jgotfcbe", "api_version"=>"v2", "organization"=>{}}
Authorized user admin(Admin User)
Field 'name' not recognized for searching! (ScopedSearch::QueryNotSupported)
  Rendered api/v2/errors/param_error.json.rabl within api/v2/layouts/error_layout (0.9ms)
Completed 400 Bad Request in 76ms (Views: 3.1ms | ActiveRecord: 19.0ms)

[root@qetello01 ~]# hammer organization delete --id 2
Could not delete the organization:
  Error: 500 Internal Server Error

Started DELETE "/katello/api/organizations/2" for 127.0.0.1 at 2014-03-03 08:18:08 -0500
Processing by Katello::Api::V2::OrganizationsController#destroy as JSON
  Parameters: {"api_version"=>"v2", "id"=>"2", "organization"=>{}}
Expire fragment views/tabs_and_title_records-1 (0.1ms)
Authorized user admin(Admin User)
Red Hat provider can not be deleted
Deleting environment in candlepin: Library
Candlepin environment doesn't exist: Library
Expire fragment views/tabs_and_title_records-1 (0.2ms)
Katello::Resources::Candlepin::CandlepinResource: 404 Resource Not Found {"displayMessage":"Organization with id jgotfcbe could not be found.","requestUuid":"ea8db3f7-e0fe-44f1-a1b1-f9028dc5153e"} (GET /candlepin/owners/jgotfcbe/servicelevels) (RestClient::ResourceNotFound)
/opt/rh/ruby193/root/usr/share/gems/gems/rest-client-1.6.1/lib/restclient/abstract_response.rb:48:in `return!'
/opt/rh/ruby193/root/usr/share/gems/gems/rest-client-1.6.1/lib/restclient/request.rb:220:in `process_result'
/opt/rh/ruby193/root/usr/share/gems/gems/rest-client-1.6.1/lib/restclient/request.rb:169:in `block in transmit'
/opt/rh/ruby193/root/usr/share/ruby/net/http.rb:746:in `start'
/opt/rh/ruby193/root/usr/share/gems/gems/rest-client-1.6.1/lib/restclient/request.rb:166:in `transmit'
/opt/rh/ruby193/root/usr/share/gems/gems/rest-client-1.6.1/lib/restclient/request.rb:60:in `execute'
/opt/rh/ruby193/root/usr/share/gems/gems/rest-client-1.6.1/lib/restclient/request.rb:31:in `execute'
/opt/rh/ruby193/root/usr/share/gems/gems/rest-client-1.6.1/lib/restclient/resource.rb:51:in `get'
/opt/rh/ruby193/root/usr/share/gems/gems/katello-1.5.0/app/lib/katello/http_resource.rb:97:in `get'
/opt/rh/ruby193/root/usr/share/gems/gems/katello-1.5.0/app/lib/katello/resources/candlepin.rb:412:in `service_levels'
/opt/rh/ruby193/root/usr/share/gems/gems/katello-1.5.0/app/models/katello/glue/candlepin/owner.rb:29:in `block (2 levels) in included'
/opt/rh/ruby193/root/usr/share/gems/gems/katello-1.5.0/app/lib/katello/lazy_accessor.rb:139:in `instance_eval'
/opt/rh/ruby193/root/usr/share/gems/gems/katello-1.5.0/app/lib/katello/lazy_accessor.rb:139:in `run_initializer'
/opt/rh/ruby193/root/usr/share/gems/gems/katello-1.5.0/app/lib/katello/lazy_accessor.rb:77:in `block (2 levels) in lazy_accessor'
/opt/rh/ruby193/root/usr/share/gems/gems/katello-1.5.0/app/models/katello/glue/candlepin/owner.rb:38:in `serializable_hash'
/opt/rh/ruby193/root/usr/share/gems/gems/activemodel-3.2.8/lib/active_model/serializers/json.rb:94:in `as_json'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/json/encoding.rb:47:in `block in encode'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/json/encoding.rb:77:in `check_for_circular_references'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/json/encoding.rb:46:in `encode'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/json/encoding.rb:31:in `encode'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/core_ext/object/to_json.rb:16:in `to_json'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/renderers.rb:93:in `block in <module:Renderers>'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/renderers.rb:35:in `block in _handle_render_options'
/opt/rh/ruby193/root/usr/share/ruby/set.rb:222:in `block in each'
/opt/rh/ruby193/root/usr/share/ruby/set.rb:222:in `each_key'
/opt/rh/ruby193/root/usr/share/ruby/set.rb:222:in `each'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/renderers.rb:32:in `_handle_render_options'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/renderers.rb:28:in `render_to_body'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/compatibility.rb:50:in `render_to_body'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/rendering.rb:88:in `render'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/rendering.rb:16:in `render'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
/opt/rh/ruby193/root/usr/share/ruby/benchmark.rb:295:in `realtime'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/core_ext/benchmark.rb:5:in `ms'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:40:in `block in render'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:83:in `cleanup_view_runtime'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/railties/controller_runtime.rb:24:in `cleanup_view_runtime'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:39:in `render'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/responder.rb:254:in `display'
/usr/share/foreman/app/controllers/api/api_responder.rb:10:in `api_behavior'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/responder.rb:181:in `rescue in to_format'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/responder.rb:175:in `to_format'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/responder.rb:153:in `respond'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/responder.rb:146:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/mime_responds.rb:239:in `respond_with'
/usr/share/foreman/app/controllers/api/base_controller.rb:86:in `process_success'
/usr/share/foreman/app/controllers/api/base_controller.rb:91:in `process_response'
/usr/share/foreman/app/controllers/concerns/api/v2/taxonomies_controller.rb:66:in `destroy'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/base.rb:167:in `process_action'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/rendering.rb:10:in `process_action'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/callbacks.rb:18:in `block in process_action'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:461:in `block (3 levels) in _run__2432048553563400688__process_action__3824049692356727363__callbacks'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_9389'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:326:in `around'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:310:in `_callback_around_2054'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:214:in `_conditional_callback_around_9389'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:449:in `block (2 levels) in _run__2432048553563400688__process_action__3824049692356727363__callbacks'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_9388'
/usr/share/foreman/app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:214:in `_conditional_callback_around_9388'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:404:in `block in _run__2432048553563400688__process_action__3824049692356727363__callbacks'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_9387'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:326:in `around'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:310:in `_callback_around_13'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:214:in `_conditional_callback_around_9387'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:403:in `_run__2432048553563400688__process_action__3824049692356727363__callbacks'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `__run_callback'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in `run_callbacks'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/callbacks.rb:17:in `process_action'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/rescue.rb:29:in `process_action'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:in `block in instrument'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:in `instrument'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/base.rb:121:in `process'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/rendering.rb:45:in `process'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal.rb:203:in `dispatch'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal.rb:246:in `block in action'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:73:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:36:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/mapper.rb:42:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/journey-1.0.4/lib/journey/router.rb:68:in `block in call'
/opt/rh/ruby193/root/usr/share/gems/gems/journey-1.0.4/lib/journey/router.rb:56:in `each'
/opt/rh/ruby193/root/usr/share/gems/gems/journey-1.0.4/lib/journey/router.rb:56:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:600:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/engine.rb:479:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in `method_missing'
/opt/rh/ruby193/root/usr/share/gems/gems/journey-1.0.4/lib/journey/router.rb:68:in `block in call'
/opt/rh/ruby193/root/usr/share/gems/gems/journey-1.0.4/lib/journey/router.rb:56:in `each'
/opt/rh/ruby193/root/usr/share/gems/gems/journey-1.0.4/lib/journey/router.rb:56:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:600:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/apipie-rails-0.0.23/lib/apipie/static_dispatcher.rb:56:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/etag.rb:23:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/conditionalget.rb:35:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/head.rb:14:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
/usr/share/foreman/lib/middleware/catch_json_parse_errors.rb:9:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/flash.rb:242:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:205:in `context'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:200:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/cookies.rb:339:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/query_cache.rb:64:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:473:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `_run__1298632126344997863__call__795425364383671622__callbacks'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `__run_callback'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in `run_callbacks'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/rack/logger.rb:26:in `call_app'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/rack/logger.rb:16:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/katello-1.5.0/config/initializers/quiet_paths.rb:11:in `call_with_quiet'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/request_id.rb:22:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/methodoverride.rb:21:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/runtime.rb:17:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/lock.rb:15:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:143:in `pass'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:155:in `invalidate'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:71:in `call!'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/engine.rb:479:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/application.rb:223:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in `method_missing'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/builder.rb:134:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/urlmap.rb:64:in `block in call'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/urlmap.rb:49:in `each'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/urlmap.rb:49:in `call'
/usr/lib/ruby/gems/1.8/gems/passenger-4.0.5/lib/phusion_passenger/rack/thread_handler_extension.rb:77:in `process_request'
/usr/lib/ruby/gems/1.8/gems/passenger-4.0.5/lib/phusion_passenger/request_handler/thread_handler.rb:140:in `accept_and_process_next_request'
/usr/lib/ruby/gems/1.8/gems/passenger-4.0.5/lib/phusion_passenger/request_handler/thread_handler.rb:108:in `main_loop'
/usr/lib/ruby/gems/1.8/gems/passenger-4.0.5/lib/phusion_passenger/request_handler.rb:441:in `block (3 levels) in start_threads'
/opt/rh/ruby193/root/usr/share/gems/gems/logging-1.8.1/lib/logging/diagnostic_context.rb:323:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/logging-1.8.1/lib/logging/diagnostic_context.rb:323:in `block in create_with_logging_context'
  Rendered api/v2/errors/standard_error.json.rabl within api/v2/layouts/error_layout (1.1ms)
Completed 500 Internal Server Error in 1161ms (Views: 3.7ms | ActiveRecord: 0.0ms)

[root@qetello01 ~]# hammer organization list
-----------------------------------------------------------------------------------------------
ID | NAME                | LABEL                                | DESCRIPTION
-----------------------------------------------------------------------------------------------
1  | ACME_Corporation    | ACME_Corporation                     | ACME_Corporation Organization
3  | NY Data Store       | NY_Data_Store                        |
4  | São Paulo          | 33c86be3-d6aa-43ab-bb8b-efce91157e97 |
5  | São Paulo de Minas | 81ccc106-79bb-4d14-a69d-96351ad646f4 |
-----------------------------------------------------------------------------------------------

Looks like deleting by ID works but it throws back a nasty stacktrace, Deletion by name doesn't work.

Actions #13

Updated by Og Maciel over 10 years ago

fwiw my environment:

  • rubygem-foreman_api-0.1.11-1.el6.noarch
  • foreman-release-1.5.0-0.develop.201402250936git8cf1033.el6.noarch
  • foreman-selinux-1.5.0-0.develop.201401221845git5f25c33.el6.noarch
  • foreman-proxy-1.5.0-0.develop.201402201704gita25e7b9.el6.noarch
  • foreman-1.5.0-0.develop.201402250936git8cf1033.el6.noarch
  • rubygem-hammer_cli_foreman-0.0.18-1.el6.noarch
  • foreman-postgresql-1.5.0-0.develop.201402250936git8cf1033.el6.noarch
Actions #14

Updated by Dominic Cleal over 10 years ago

You appear to be testing deletion of organisations, while this bug report is about hardware models. Could you try those instead please?

Actions #15

Updated by Og Maciel over 10 years ago

  • Status changed from Feedback to Resolved

I clearly need more coffee :/

[root@qetello01 ~]# hammer model list
-----------------------------------
ID | NAME | VENDOR CLASS | HW MODEL
-----------------------------------
1  | KVM  |              |
-----------------------------------
[root@qetello01 ~]# hammer model create --name foobar
Hardware model created
[root@qetello01 ~]# hammer model list
-------------------------------------
ID | NAME   | VENDOR CLASS | HW MODEL
-------------------------------------
1  | KVM    |              |
2  | foobar |              |
-------------------------------------
[root@qetello01 ~]# hammer model delete --name foobar
Hardware model deleted
[root@qetello01 ~]# hammer model list
-----------------------------------
ID | NAME | VENDOR CLASS | HW MODEL
-----------------------------------
1  | KVM  |              |
-----------------------------------
[root@qetello01 ~]# hammer model create --name foobar
Hardware model created
[root@qetello01 ~]# #hammer model delete --id 2
[root@qetello01 ~]# hammer model list
-------------------------------------
ID | NAME   | VENDOR CLASS | HW MODEL
-------------------------------------
1  | KVM    |              |
3  | foobar |              |
-------------------------------------
[root@qetello01 ~]# hammer model delete --id 3
Hardware model deleted
[root@qetello01 ~]# hammer model list
-----------------------------------
ID | NAME | VENDOR CLASS | HW MODEL
-----------------------------------
1  | KVM  |              |
-----------------------------------
Actions

Also available in: Atom PDF