Fedora Account System
Red Hat Associate
Red Hat Customer
Description of problem: ----------------------- While creating custom button with rest getting 500 response "undefined local variable or method `custom_button' for #<Api::CustomButtonsController:0x0000557605973210>" Version-Release number of selected component (if applicable): ------------------------------------------------------------- 5.11.5.2 How reproducible: ---------------- always Steps to Reproduce: ------------------- POST https://hostname/api/custom_buttons { "action": "create", "resources": [ { "applies_to_class": "CloudNetwork", "description": "btn_hUEvrZ", "name": "btn_desc_zsZ", "options": { "button_color": "#4727ff", "button_icon": "ff fa-user", "display": true }, "resource_action": { "ae_class": "PROCESS", "ae_namespace": "SYSTEM" } }, { "applies_to_class": "CloudNetwork", "description": "btn_3lmjXr", "name": "btn_desc_d3q", "options": { "button_color": "#4727ff", "button_icon": "ff fa-user", "display": true }, "resource_action": { "ae_class": "PROCESS", "ae_namespace": "SYSTEM" } } ] } Actual results: --------------- 500 responce code with error { "error": { "kind": "internal_server_error", "message": "undefined local variable or method `custom_button' for #<Api::CustomButtonsController:0x0000557605973210>", "klass": "NameError" } } Expected results: ----------------- It should work Additional info: ---------------- This functionality working fine with 5.10 and 5.11.4.2. Marking as regration.
Hey Nikhil, please include stack traces if you can. Error caught: [NameError] undefined local variable or method `custom_button' for #<Api::CustomButtonsController:0x00007ff9c06d0af8> /Users/drewmu/manageiq-api/app/controllers/api/custom_buttons_controller.rb:14:in `rescue in create_resource' /Users/drewmu/manageiq-api/app/controllers/api/custom_buttons_controller.rb:3:in `create_resource' /Users/drewmu/manageiq-api/app/controllers/api/base_controller.rb:76:in `block in create' /Users/drewmu/manageiq-api/app/controllers/api/base_controller.rb:66:in `collect' /Users/drewmu/manageiq-api/app/controllers/api/base_controller.rb:66:in `create' /Users/drewmu/.rvm/gems/ruby-2.5.5/gems/actionpack-5.1.7/lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action' /Users/drewmu/.rvm/gems/ruby-2.5.5/gems/actionpack-5.1.7/lib/abstract_controller/base.rb:186:in `process_action' /Users/drewmu/.rvm/gems/ruby-2.5.5/gems/actionpack-5.1.7/lib/action_controller/metal/rendering.rb:30:in `process_action' /Users/drewmu/.rvm/gems/ruby-2.5.5/gems/actionpack-5.1.7/lib/abstract_controller/callbacks.rb:20:in `block in process_action' /Users/drewmu/.rvm/gems/ruby-2.5.5/gems/activesupport-5.1.7/lib/active_support/callbacks.rb:131:in `run_callbacks' /Users/drewmu/.rvm/gems/ruby-2.5.5/gems/actionpack-5.1.7/lib/abstract_controller/callbacks.rb:19:in `process_action' /Users/drewmu/.rvm/gems/ruby-2.5.5/gems/actionpack-5.1.7/lib/action_controller/metal/rescue.rb:20:in `process_action' /Users/drewmu/.rvm/gems/ruby-2.5.5/gems/actionpack-5.1.7/lib/action_controller/metal/instrumentation.rb:32:in `block in process_action' /Users/drewmu/.rvm/gems/ruby-2.5.5/gems/activesupport-5.1.7/lib/active_support/notifications.rb:166:in `block in instrument' /Users/drewmu/.rvm/gems/ruby-2.5.5/gems/activesupport-5.1.7/lib/active_support/notifications/instrumenter.rb:21:in `instrument' /Users/drewmu/.rvm/gems/ruby-2.5.5/gems/activesupport-5.1.7/lib/active_support/notifications.rb:166:in `instrument' /Users/drewmu/.rvm/gems/ruby-2.5.5/gems/actionpack-5.1.7/lib/action_controller/metal/instrumentation.rb:30:in `process_action' /Users/drewmu/.rvm/gems/ruby-2.5.5/gems/actionpack-5.1.7/lib/action_controller/metal/params_wrapper.rb:252:in `process_action' /Users/drewmu/.rvm/gems/ruby-2.5.5/gems/activerecord-5.1.7/lib/active_record/railties/controller_runtime.rb:22:in `process_action'
Dup of https://bugzilla.redhat.com/show_bug.cgi?id=1827818
thanks! closing though. *** This bug has been marked as a duplicate of bug 1827818 ***