Description of problem: A FATAL exception occurs in production.log causing the C&U configuration screen to be entirely blank. Version-Release number of selected component (if applicable): 5.6.2.2 How reproducible: Always (in this environment) Steps to Reproduce: 1. Go to Configuration > Settings > CFME Region 2. Click on the C&U Collection tag Actual results: Nothing is displayed and a FATAL error appears in production.log [----] I, [2016-11-10T00:48:03.118877 #7085:18495a8] INFO -- : Started POST "/ops/change_tab/?tab_id=settings_cu_collection" for 127.0.0.1 at 2016-11-10 00:48:03 -0500 [----] I, [2016-11-10T00:48:03.180159 #7085:18495a8] INFO -- : Processing by OpsController#change_tab as JS [----] I, [2016-11-10T00:48:03.180248 #7085:18495a8] INFO -- : Parameters: {"tab_id"=>"settings_cu_collection"} [----] F, [2016-11-10T00:48:03.994794 #7085:18495a8] FATAL -- : Error caught: [NoMethodError] undefined method `where' for nil:NilClass /var/www/miq/vmdb/app/models/ext_management_system.rb:427:in `non_clustered_hosts' /var/www/miq/vmdb/app/controllers/ops_controller/settings/cap_and_u.rb:334:in `block in build_cl_hosts_tree' /opt/rh/cfme-gemset/gems/activerecord-5.0.0.1/lib/active_record/relation/delegation.rb:38:in `each' /opt/rh/cfme-gemset/gems/activerecord-5.0.0.1/lib/active_record/relation/delegation.rb:38:in `each' /var/www/miq/vmdb/app/controllers/ops_controller/settings/cap_and_u.rb:333:in `build_cl_hosts_tree' /var/www/miq/vmdb/app/controllers/ops_controller/settings/cap_and_u.rb:195:in `cu_build_edit_screen' /var/www/miq/vmdb/app/controllers/ops_controller/settings/common.rb:1113:in `settings_get_info' /var/www/miq/vmdb/app/controllers/ops_controller.rb:184:in `change_tab' /opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action' /opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/abstract_controller/base.rb:188:in `process_action' /opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_controller/metal/rendering.rb:30:in `process_action' /opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/abstract_controller/callbacks.rb:20:in `block in process_action' /opt/rh/cfme-gemset/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:126:in `call' /opt/rh/cfme-gemset/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:126:in `call' /opt/rh/cfme-gemset/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:506:in `block (2 levels) in compile' /opt/rh/cfme-gemset/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:455:in `call' /opt/rh/cfme-gemset/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:455:in `call' /opt/rh/cfme-gemset/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:101:in `__run_callbacks__' /opt/rh/cfme-gemset/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:750:in `_run_process_action_callbacks' /opt/rh/cfme-gemset/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:90:in `run_callbacks' /opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/abstract_controller/callbacks.rb:19:in `process_action' /opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_controller/metal/rescue.rb:20:in `process_action' /opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_controller/metal/instrumentation.rb:32:in `block in process_action' /opt/rh/cfme-gemset/gems/activesupport-5.0.0.1/lib/active_support/notifications.rb:164:in `block in instrument' /opt/rh/cfme-gemset/gems/activesupport-5.0.0.1/lib/active_support/notifications/instrumenter.rb:21:in `instrument' /opt/rh/cfme-gemset/gems/activesupport-5.0.0.1/lib/active_support/notifications.rb:164:in `instrument' /opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_controller/metal/instrumentation.rb:30:in `process_action' /opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_controller/metal/params_wrapper.rb:248:in `process_action' /opt/rh/cfme-gemset/gems/activerecord-5.0.0.1/lib/active_record/railties/controller_runtime.rb:18:in `process_action' /opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/abstract_controller/base.rb:126:in `process' /opt/rh/cfme-gemset/gems/actionview-5.0.0.1/lib/action_view/rendering.rb:30:in `process' /opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_controller/metal.rb:190:in `dispatch' /opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_controller/metal.rb:262:in `dispatch' /opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_dispatch/routing/route_set.rb:50:in `dispatch' /opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_dispatch/routing/route_set.rb:32:in `serve' /opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_dispatch/journey/router.rb:39:in `block in serve' /opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_dispatch/journey/router.rb:26:in `each' /opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_dispatch/journey/router.rb:26:in `serve' /opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_dispatch/routing/route_set.rb:725:in `call' /opt/rh/cfme-gemset/gems/secure_headers-3.0.3/lib/secure_headers/middleware.rb:10:in `call' /opt/rh/cfme-gemset/gems/rack-2.0.1/lib/rack/etag.rb:25:in `call' /opt/rh/cfme-gemset/gems/rack-2.0.1/lib/rack/conditional_get.rb:38:in `call' /opt/rh/cfme-gemset/gems/rack-2.0.1/lib/rack/head.rb:12:in `call' /opt/rh/cfme-gemset/gems/rack-2.0.1/lib/rack/session/abstract/id.rb:222:in `context' /opt/rh/cfme-gemset/gems/rack-2.0.1/lib/rack/session/abstract/id.rb:216:in `call' /opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/cookies.rb:613:in `call' /opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/callbacks.rb:38:in `block in call' /opt/rh/cfme-gemset/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:97:in `__run_callbacks__' /opt/rh/cfme-gemset/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:750:in `_run_call_callbacks' /opt/rh/cfme-gemset/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:90:in `run_callbacks' /opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/callbacks.rb:36:in `call' /opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/remote_ip.rb:79:in `call' /opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/debug_exceptions.rb:49:in `call' /opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/show_exceptions.rb:31:in `call' /opt/rh/cfme-gemset/gems/railties-5.0.0.1/lib/rails/rack/logger.rb:36:in `call_app' /opt/rh/cfme-gemset/gems/railties-5.0.0.1/lib/rails/rack/logger.rb:26:in `call' /opt/rh/cfme-gemset/gems/request_store-1.3.1/lib/request_store/middleware.rb:9:in `call' /opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/request_id.rb:24:in `call' /opt/rh/cfme-gemset/gems/rack-2.0.1/lib/rack/method_override.rb:22:in `call' /opt/rh/cfme-gemset/gems/rack-2.0.1/lib/rack/runtime.rb:22:in `call' /opt/rh/cfme-gemset/gems/activesupport-5.0.0.1/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call' /opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/executor.rb:12:in `call' /opt/rh/cfme-gemset/gems/rack-2.0.1/lib/rack/sendfile.rb:111:in `call' /opt/rh/cfme-gemset/gems/railties-5.0.0.1/lib/rails/engine.rb:522:in `call' /opt/rh/rh-ruby22/root/usr/share/gems/gems/puma-3.3.0/lib/puma/configuration.rb:224:in `call' /opt/rh/rh-ruby22/root/usr/share/gems/gems/puma-3.3.0/lib/puma/server.rb:561:in `handle_request' /opt/rh/rh-ruby22/root/usr/share/gems/gems/puma-3.3.0/lib/puma/server.rb:406:in `process_client' /opt/rh/rh-ruby22/root/usr/share/gems/gems/puma-3.3.0/lib/puma/server.rb:271:in `block in run' /opt/rh/rh-ruby22/root/usr/share/gems/gems/puma-3.3.0/lib/puma/thread_pool.rb:111:in `call' /opt/rh/rh-ruby22/root/usr/share/gems/gems/puma-3.3.0/lib/puma/thread_pool.rb:111:in `block in spawn_thread' /opt/rh/cfme-gemset/gems/logging-2.1.0/lib/logging/diagnostic_context.rb:450:in `call' /opt/rh/cfme-gemset/gems/logging-2.1.0/lib/logging/diagnostic_context.rb:450:in `block in create_with_logging_context' [----] I, [2016-11-10T00:48:04.001098 #7085:18495a8] INFO -- : Rendered layouts/_exception_contents.html.haml (4.6ms) [----] I, [2016-11-10T00:48:04.001758 #7085:18495a8] INFO -- : Completed 200 OK in 821ms (Views: 6.3ms | ActiveRecord: 0.0ms) Expected results: Screen should be displayed. Additional info:
Matous, can you try to reproduce this on 5.7.0 please.
I think it's failing on: def non_clustered_hosts hosts.where(:ems_cluster_id => nil) end Are amazon providers supposed to have hosts? Maybe someone on the providers team can help review.
Ugh, azure, not amazon. Thanks bugzilla, my typo is here forever.
I can see switch for collecting clusters and datastores in 5.7.0.10 there, so I suppose it's okay.
I have clicked on this UI tab many many times without any problem. Today I tested this on the Darga release using an Azure provider and a SCVMM provider with unclustered hosts and it works fine. There is nothing we can do unless we get more specific steps that will enable us to reproduce this.
*** Bug 1394432 has been marked as a duplicate of this bug. ***
ok, the root cause is tracked here https://github.com/ManageIQ/manageiq/issues/12828
https://github.com/ManageIQ/manageiq/pull/12878
New commit detected on ManageIQ/manageiq-providers-amazon/master: https://github.com/ManageIQ/manageiq-providers-amazon/commit/13cbb68b282c26449752c6127cba9e9c111a592b commit 13cbb68b282c26449752c6127cba9e9c111a592b Author: Marcel Hild <hild> AuthorDate: Mon Nov 28 15:13:11 2016 +0100 Commit: Marcel Hild <hild> CommitDate: Mon Nov 28 15:13:11 2016 +0100 Add managers in before_create callback instead of before_validation otherwise it could happen that one process deletes the manager and another one saves it and the saving one would add back a deleted manager. https://bugzilla.redhat.com/show_bug.cgi?id=1389459 https://bugzilla.redhat.com/show_bug.cgi?id=1393675 app/models/manageiq/providers/amazon/cloud_manager.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/fab74b285e2d93f85456d9a0985081b5eb7b9aff commit fab74b285e2d93f85456d9a0985081b5eb7b9aff Author: Marcel Hild <hild> AuthorDate: Mon Nov 28 15:02:56 2016 +0100 Commit: Marcel Hild <hild> CommitDate: Mon Nov 28 15:02:56 2016 +0100 Add managers in before_create callback instead of before_validation otherwise it could happen that one process deletes the manager and another one saves it and the saving one would add back a deleted manager. https://bugzilla.redhat.com/show_bug.cgi?id=1389459 https://bugzilla.redhat.com/show_bug.cgi?id=1393675 app/models/manageiq/providers/foreman/provider.rb | 2 +- app/models/manageiq/providers/google/cloud_manager.rb | 2 +- app/models/manageiq/providers/openstack/cloud_manager.rb | 2 +- app/models/manageiq/providers/openstack/infra_manager.rb | 2 +- app/models/manageiq/providers/vmware/cloud_manager.rb | 2 +- spec/controllers/provider_foreman_controller_spec.rb | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-)
New commit detected on ManageIQ/manageiq-providers-azure/master: https://github.com/ManageIQ/manageiq-providers-azure/commit/a2acb585c09633f903c194aae227fdf50e591a13 commit a2acb585c09633f903c194aae227fdf50e591a13 Author: Marcel Hild <hild> AuthorDate: Mon Nov 28 15:10:55 2016 +0100 Commit: Marcel Hild <hild> CommitDate: Mon Nov 28 15:10:55 2016 +0100 Add managers in before_create callback instead of before_validation otherwise it could happen that one process deletes the manager and another one saves it and the saving one would add back a deleted manager. https://bugzilla.redhat.com/show_bug.cgi?id=1389459 https://bugzilla.redhat.com/show_bug.cgi?id=1393675 app/models/manageiq/providers/azure/cloud_manager.rb | 2 +- .../manageiq/providers/azure/cloud_manager_spec.rb | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-)
https://github.com/ManageIQ/manageiq/pull/12381
https://github.com/ManageIQ/manageiq/pull/12878 is the PR that fixes this - not the PR in Comment #27
Matous, for QE testing you can only replicate that in the UI by running a refresh and immediately destroying the provider and hope that it runs into this race conditions.
Verified in 5.8.0.12. After doing refresh and then immediately deleting provider I can still see C & U Collection page.
*** Bug 1446414 has been marked as a duplicate of this bug. ***
*** Bug 1446576 has been marked as a duplicate of this bug. ***