Created attachment 1016500 [details] Driving event validation fails Description of problem: Validation fails for "Driving Event" while editing or creating a copy of the existing alert Version-Release number of selected component (if applicable): 5.4.0.0.19.20150410165622_ad23806 How reproducible: 100% Steps to Reproduce: 1. Navigate to Control ==> Explorer ==> Alerts ==> Choose an existing alert (say Datacenter VMs >10) 2. Click on Configuration ==> Edit this Alert (or) Copy this Alert 3. Change the Description and click on Save button Actual results: Throws error message stating "undefined method `[]' for #<MiqExpression:0x0000000b4361a0> [miq_policy/alert_edit]". Refer the screenshot "Driving event validation fails", evm.log and production.log file for more information Expected results: Should validate for Driving Event field as it not selected and should throw the error message accordingly Additional info: evm.log: ======== [----] E, [2015-04-20T14:12:41.964458 #10918:e25ea0] ERROR -- : MIQ(miq_policy_controller-alert_edit): A Driving Event must be selected production.log: =============== [----] I, [2015-04-20T14:12:19.034052 #10918:e25ea0] INFO -- : Started POST "/miq_policy/alert_field_changed/new?description=Datacenter%20VMs%20%3E%2010-renamed" for 127.0.0.1 at 2015-04-20 14:12:19 -0400 [----] I, [2015-04-20T14:12:19.037978 #10918:e25ea0] INFO -- : Processing by MiqPolicyController#alert_field_changed as JS [----] I, [2015-04-20T14:12:19.038075 #10918:e25ea0] INFO -- : Parameters: {"description"=>"Datacenter VMs > 10-renamed", "id"=>"new"} [----] I, [2015-04-20T14:12:19.066066 #10918:e25ea0] INFO -- : Completed 200 OK in 27.9ms (Views: 0.6ms | ActiveRecord: 1.1ms) [----] I, [2015-04-20T14:12:41.864029 #10918:e25ea0] INFO -- : Started POST "/miq_policy/alert_edit?button=add" for 127.0.0.1 at 2015-04-20 14:12:41 -0400 [----] I, [2015-04-20T14:12:41.944279 #10918:e25ea0] INFO -- : Processing by MiqPolicyController#alert_edit as JS [----] I, [2015-04-20T14:12:41.944416 #10918:e25ea0] INFO -- : Parameters: {"button"=>"add"} [----] F, [2015-04-20T14:12:41.965162 #10918:e25ea0] FATAL -- : Error caught: [NoMethodError] undefined method `[]' for #<MiqExpression:0x00000010367e18> /var/www/miq/vmdb/app/controllers/miq_policy_controller/alerts.rb:537:in `alert_valid_record?' /var/www/miq/vmdb/app/controllers/miq_policy_controller/alerts.rb:23:in `alert_edit' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/actionpack/lib/action_controller/metal/implicit_render.rb:4:in `send_action' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/actionpack/lib/abstract_controller/base.rb:167:in `process_action' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/actionpack/lib/action_controller/metal/rendering.rb:10:in `process_action' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/actionpack/lib/abstract_controller/callbacks.rb:18:in `block in process_action' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/activesupport/lib/active_support/callbacks.rb:557:in `_run__1555300855091572694__process_action__1121620265443633649__callbacks' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/activesupport/lib/active_support/callbacks.rb:405:in `__run_callback' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/activesupport/lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/activesupport/lib/active_support/callbacks.rb:81:in `run_callbacks' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/actionpack/lib/abstract_controller/callbacks.rb:17:in `process_action' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/actionpack/lib/action_controller/metal/rescue.rb:29:in `process_action' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/actionpack/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/activesupport/lib/active_support/notifications.rb:123:in `block in instrument' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/activesupport/lib/active_support/notifications/instrumenter.rb:20:in `instrument' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/activesupport/lib/active_support/notifications.rb:123:in `instrument' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/actionpack/lib/action_controller/metal/instrumentation.rb:29:in `process_action' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/actionpack/lib/action_controller/metal/params_wrapper.rb:207:in `process_action' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/activerecord/lib/active_record/railties/controller_runtime.rb:18:in `process_action' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/actionpack/lib/abstract_controller/base.rb:121:in `process' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/actionpack/lib/abstract_controller/rendering.rb:45:in `process' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/actionpack/lib/action_controller/metal.rb:203:in `dispatch' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/actionpack/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/actionpack/lib/action_controller/metal.rb:246:in `block in action' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/actionpack/lib/action_dispatch/routing/route_set.rb:73:in `call' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/actionpack/lib/action_dispatch/routing/route_set.rb:73:in `dispatch' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/actionpack/lib/action_dispatch/routing/route_set.rb:36:in `call' /opt/rh/cfme-gemset/gems/journey-1.0.4/lib/journey/router.rb:68:in `block in call' /opt/rh/cfme-gemset/gems/journey-1.0.4/lib/journey/router.rb:56:in `each' /opt/rh/cfme-gemset/gems/journey-1.0.4/lib/journey/router.rb:56:in `call' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/actionpack/lib/action_dispatch/routing/route_set.rb:608:in `call' /opt/rh/cfme-gemset/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward' /opt/rh/cfme-gemset/gems/rack-cache-1.2/lib/rack/cache/context.rb:143:in `pass' /opt/rh/cfme-gemset/gems/rack-cache-1.2/lib/rack/cache/context.rb:155:in `invalidate' /opt/rh/cfme-gemset/gems/rack-cache-1.2/lib/rack/cache/context.rb:71:in `call!' /opt/rh/cfme-gemset/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/actionpack/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call' /opt/rh/cfme-gemset/gems/rack-1.4.5/lib/rack/etag.rb:23:in `call' /opt/rh/cfme-gemset/gems/rack-1.4.5/lib/rack/conditionalget.rb:35:in `call' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/actionpack/lib/action_dispatch/middleware/head.rb:14:in `call' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/actionpack/lib/action_dispatch/middleware/params_parser.rb:21:in `call' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/actionpack/lib/action_dispatch/middleware/flash.rb:242:in `call' /opt/rh/cfme-gemset/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:210:in `context' /opt/rh/cfme-gemset/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:205:in `call' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/actionpack/lib/action_dispatch/middleware/cookies.rb:341:in `call' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/activerecord/lib/active_record/query_cache.rb:64:in `call' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/actionpack/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/activesupport/lib/active_support/callbacks.rb:405:in `_run__765567197915781139__call__4026112033378302818__callbacks' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/activesupport/lib/active_support/callbacks.rb:405:in `__run_callback' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/activesupport/lib/active_support/callbacks.rb:385:in `_run_call_callbacks' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/activesupport/lib/active_support/callbacks.rb:81:in `run_callbacks' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/actionpack/lib/action_dispatch/middleware/callbacks.rb:27:in `call' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/actionpack/lib/action_dispatch/middleware/remote_ip.rb:31:in `call' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/actionpack/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/railties/lib/rails/rack/logger.rb:32:in `call_app' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/railties/lib/rails/rack/logger.rb:18:in `call' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/actionpack/lib/action_dispatch/middleware/request_id.rb:22:in `call' /opt/rh/cfme-gemset/gems/rack-1.4.5/lib/rack/methodoverride.rb:21:in `call' /opt/rh/cfme-gemset/gems/rack-1.4.5/lib/rack/runtime.rb:17:in `call' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/activesupport/lib/active_support/cache/strategy/local_cache.rb:72:in `call' /opt/rh/cfme-gemset/gems/rack-1.4.5/lib/rack/lock.rb:15:in `call' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/actionpack/lib/action_dispatch/middleware/static.rb:63:in `call' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/railties/lib/rails/engine.rb:484:in `call' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/railties/lib/rails/application.rb:231:in `call' /opt/rh/cfme-gemset/gems/rack-1.4.5/lib/rack/content_length.rb:14:in `call' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/railties/lib/rails/rack/log_tailer.rb:17:in `call' /opt/rh/cfme-gemset/gems/thin-1.3.1/lib/thin/connection.rb:80:in `block in pre_process' /opt/rh/cfme-gemset/gems/thin-1.3.1/lib/thin/connection.rb:78:in `catch' /opt/rh/cfme-gemset/gems/thin-1.3.1/lib/thin/connection.rb:78:in `pre_process' /opt/rh/cfme-gemset/gems/thin-1.3.1/lib/thin/connection.rb:53:in `process' /opt/rh/cfme-gemset/gems/thin-1.3.1/lib/thin/connection.rb:38:in `receive_data' /opt/rh/cfme-gemset/gems/eventmachine-1.0.7/lib/eventmachine.rb:187:in `run_machine' /opt/rh/cfme-gemset/gems/eventmachine-1.0.7/lib/eventmachine.rb:187:in `run' /opt/rh/cfme-gemset/gems/thin-1.3.1/lib/thin/backends/base.rb:61:in `start' /opt/rh/cfme-gemset/gems/thin-1.3.1/lib/thin/server.rb:159:in `start' /opt/rh/cfme-gemset/gems/rack-1.4.5/lib/rack/handler/thin.rb:13:in `run' /opt/rh/cfme-gemset/gems/rack-1.4.5/lib/rack/server.rb:268:in `start' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/railties/lib/rails/commands/server.rb:70:in `start' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/railties/lib/rails/commands.rb:55:in `block in <top (required)>' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/railties/lib/rails/commands.rb:50:in `tap' /opt/rh/cfme-gemset/bundler/gems/rails-8f014fba21f9/railties/lib/rails/commands.rb:50:in `<top (required)>' script/rails:6:in `require' script/rails:6:in `<main>' [----] I, [2015-04-20T14:12:41.966596 #10918:e25ea0] INFO -- : Rendered layouts/_exception_contents.html.haml (0.3ms) [----] I, [2015-04-20T14:12:41.967167 #10918:e25ea0] INFO -- : Completed 200 OK in 22.6ms (Views: 1.6ms | ActiveRecord: 1.1ms)
New commit detected on manageiq/master: https://github.com/ManageIQ/manageiq/commit/27b8cd7756d012c74e74cce9d1943929e947cdc8 commit 27b8cd7756d012c74e74cce9d1943929e947cdc8 Author: Martin Hradil <mhradil> AuthorDate: Wed Apr 22 15:53:11 2015 +0000 Commit: Martin Hradil <mhradil> CommitDate: Wed Apr 22 15:53:11 2015 +0000 Alert validation fix: don't fail on MiqExpression alert.expression may be nil, MiqExpression or Hash, the "Event to Check" is relevant only if Hash (introduced in 2e48432) https://bugzilla.redhat.com/show_bug.cgi?id=1213553 vmdb/app/controllers/miq_policy_controller/alerts.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Hi Martin, This fix does not seems to be cherry picked in 5.4.0.0.24.20150427192818_1fd9e49, Can you please confirm?? Thanks, Ramesh
Hi, confirming it is not in 1fd9e49, AFAICT it is currently only in upstream master. Martin
Good to go. Verified and working fine in 5.4.0.0.25.20150429111523_0455f87
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-1100.html