Description of problem: ----------------------- Version-Release number of selected component (if applicable): --------------------------------------- 5.6.0.4 Beta 2 How reproducible: ----------------- Always Steps to Reproduce: ------------------ 1.Create a catalog item to provision an infra VM. 2.Remove the template that the catalog item was using from VMDB and refresh the infra provider. Actual results: --------------- Catalog item becomes corrupt.Unable to edit or view catalog item. Expected results: ----------------- When a template used by a catalog item is deleted,the catalog item should also be removed or put in some disabled state. Additional info: ----------------
Here's a snippet from production.log when I click the catalog item : [----] I, [2016-04-29T11:23:53.831412 #12716:11d64f0] INFO -- : Processing by CatalogController#tree_select as JS [----] I, [2016-04-29T11:23:53.831492 #12716:11d64f0] INFO -- : Parameters: {"id"=>"stc-1_st-1"} [----] F, [2016-04-29T11:23:54.014052 #12716:11d64f0] FATAL -- : Error caught: [NoMethodError] undefined method `get_options' for nil:NilClass /var/www/miq/vmdb/app/controllers/application_controller/miq_request_methods.rb:761:in `prov_set_show_vars' /var/www/miq/vmdb/app/controllers/catalog_controller.rb:1737:in `get_node_info' /var/www/miq/vmdb/app/controllers/catalog_controller.rb:1821:in `replace_right_cell' /var/www/miq/vmdb/app/controllers/catalog_controller.rb:280:in `tree_select' /opt/rh/cfme-gemset/bundler/gems/rails-f0a2edc7fc08/actionpack/lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action' /opt/rh/cfme-gemset/bundler/gems/rails-f0a2edc7fc08/actionpack/lib/abstract_controller/base.rb:181:in `process_action' /opt/rh/cfme-gemset/bundler/gems/rails-f0a2edc7fc08/actionpack/lib/action_controller/metal/rendering.rb:30:in `process_action' /opt/rh/cfme-gemset/bundler/gems/rails-f0a2edc7fc08/actionpack/lib/abstract_controller/callbacks.rb:20:in `block in process_action' /opt/rh/cfme-gemset/bundler/gems/rails-f0a2edc7fc08/activesupport/lib/active_support/callbacks.rb:126:in `call' /opt/rh/cfme-gemset/bundler/gems/rails-f0a2edc7fc08/activesupport/lib/active_support/callbacks.rb:126:in `call' /opt/rh/cfme-gemset/bundler/gems/rails-f0a2edc7fc08/activesupport/lib/active_support/callbacks.rb:506:in `block (2 levels) in compile' /opt/rh/cfme-gemset/bundler/gems/rails-f0a2edc7fc08/activesupport/lib/active_support/callbacks.rb:455:in `call' /opt/rh/cfme-gemset/bundler/gems/rails-f0a2edc7fc08/activesupport/lib/active_support/callbacks.rb:455:in `call' /opt/rh/cfme-gemset/bundler/gems/rails-f0a2edc7fc08/activesupport/lib/active_support/callbacks.rb:101:in `__run_callbacks__' /opt/rh/cfme-gemset/bundler/gems/rails-f0a2edc7fc08/activesupport/lib/active_support/callbacks.rb:750:in `_run_process_action_callbacks' /opt/rh/cfme-gemset/bundler/gems/rails-f0a2edc7fc08/activesupport/lib/active_support/callbacks.rb:90:in `run_callbacks' /opt/rh/cfme-gemset/bundler/gems/rails-f0a2edc7fc08/actionpack/lib/abstract_controller/callbacks.rb:19:in `process_action' /opt/rh/cfme-gemset/bundler/gems/rails-f0a2edc7fc08/actionpack/lib/action_controller/metal/rescue.rb:31:in `process_action' /opt/rh/cfme-gemset/bundler/gems/rails-f0a2edc7fc08/actionpack/lib/action_controller/metal/instrumentation.rb:32:in `block in process_action' /opt/rh/cfme-gemset/bundler/gems/rails-f0a2edc7fc08/activesupport/lib/active_support/notifications.rb:164:in `block in instrument' /opt/rh/cfme-gemset/bundler/gems/rails-f0a2edc7fc08/activesupport/lib/active_support/notifications/instrumenter.rb:21:in `instrument' /opt/rh/cfme-gemset/bundler/gems/rails-f0a2edc7fc08/activesupport/lib/active_support/notifications.rb:164:in `instrument' /opt/rh/cfme-gemset/bundler/gems/rails-f0a2edc7fc08/actionpack/lib/action_controller/metal/instrumentation.rb:30:in `process_action' /opt/rh/cfme-gemset/bundler/gems/rails-f0a2edc7fc08/actionpack/lib/action_controller/metal/params_wrapper.rb:248:in `process_action' /opt/rh/cfme-gemset/bundler/gems/rails-f0a2edc7fc08/activerecord/lib/active_record/railties/controller_runtime.rb:18:in `process_action' /opt/rh/cfme-gemset/bundler/gems/rails-f0a2edc7fc08/actionpack/lib/abstract_controller/base.rb:126:in `process' /opt/rh/cfme-gemset/bundler/gems/rails-f0a2edc7fc08/actionview/lib/action_view/rendering.rb:30:in `process' /opt/rh/cfme-gemset/bundler/gems/rails-f0a2edc7fc08/actionpack/lib/action_controller/metal.rb:190:in `dispatch' /opt/rh/cfme-gemset/bundler/gems/rails-f0a2edc7fc08/actionpack/lib/action_controller/metal.rb:262:in `dispatch' /opt/rh/cfme-gemset/bundler/gems/rails-f0a2edc7fc08/actionpack/lib/action_dispatch/routing/route_set.rb:50:in `dispatch' /opt/rh/cfme-gemset/bundler/gems/rails-f0a2edc7fc08/actionpack/lib/action_dispatch/routing/route_set.rb:32:in `serve' /opt/rh/cfme-gemset/bundler/gems/rails-f0a2edc7fc08/actionpack/lib/action_dispatch/journey/router.rb:39:in `block in serve' /opt/rh/cfme-gemset/bundler/gems/rails-f0a2edc7fc08/actionpack/lib/action_dispatch/journey/router.rb:26:in `each' /opt/rh/cfme-gemset/bundler/gems/rails-f0a2edc7fc08/actionpack/lib/action_dispatch/journey/router.rb:26:in `serve' /opt/rh/cfme-gemset/bundler/gems/rails-f0a2edc7fc08/actionpack/lib/action_dispatch/routing/route_set.rb:739:in `call' /opt/rh/cfme-gemset/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:186:in `call!' /opt/rh/cfme-gemset/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:164:in `call' /opt/rh/cfme-gemset/gems/omniauth-1.3.1/lib/omniauth/builder.rb:63: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.0.alpha/lib/rack/etag.rb:25:in `call' /opt/rh/cfme-gemset/gems/rack-2.0.0.alpha/lib/rack/conditional_get.rb:38:in `call' /opt/rh/cfme-gemset/gems/rack-2.0.0.alpha/lib/rack/head.rb:12:in `call'
Drew - Lucy worked on issues around this before to deal with missing/orphaned and archived templates. This seems to be a slightly different issue as we always had a request in those cases. This one looks like the request is nil. Would be good to recreate and maybe Lucy can help out here as well if needed.
Lucy - Please retest. Once we can edit the workflow we should look into not allowing invalid catalog items from being ordered in the UI. Maybe the show but the UI button is disabled with a pop-up message. Need to work with the UI team on that part.
https://github.com/ManageIQ/manageiq/pull/10355
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/ac42757c6afe4e995c0a3a4b8ca75f36f461b113 commit ac42757c6afe4e995c0a3a4b8ca75f36f461b113 Author: Lucy Fu <lufu> AuthorDate: Tue Aug 9 15:08:33 2016 -0400 Commit: Lucy Fu <lufu> CommitDate: Tue Aug 16 15:44:07 2016 -0400 Update source in the provision request when source template is changed. The source column in the request is used to validate the template. During the request update time, options contains the old template while values has the new template id. https://bugzilla.redhat.com/show_bug.cgi?id=1331824 app/models/miq_provision_virt_workflow.rb | 2 +- spec/models/miq_provision_virt_workflow_spec.rb | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-)
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/b2d6852a444371437c6af2ac9e28c1f336c3902e commit b2d6852a444371437c6af2ac9e28c1f336c3902e Author: Lucy Fu <lufu> AuthorDate: Tue Aug 9 15:10:23 2016 -0400 Commit: Lucy Fu <lufu> CommitDate: Tue Aug 16 15:44:07 2016 -0400 When validate template, check the existence of the request first. https://bugzilla.redhat.com/show_bug.cgi?id=1331824 app/models/service_template.rb | 8 ++++++++ spec/models/service_template_spec.rb | 8 ++++++++ 2 files changed, 16 insertions(+)
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/ba69b49e4559285623b6ce0ea9986ca909757175 commit ba69b49e4559285623b6ce0ea9986ca909757175 Author: Lucy Fu <lufu> AuthorDate: Tue Aug 9 15:04:25 2016 -0400 Commit: Lucy Fu <lufu> CommitDate: Tue Aug 16 15:44:07 2016 -0400 The provision request should not be deleted when a template is deleted. So the user can edit the catalog item to select a new template. https://bugzilla.redhat.com/show_bug.cgi?id=1331824 app/models/vm_or_template.rb | 2 +- spec/models/miq_provision_request_template_spec.rb | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-)
New commit detected on ManageIQ/manageiq/darga: https://github.com/ManageIQ/manageiq/commit/32ca30920fdf8113cf667d94e59011de854bf2b7 commit 32ca30920fdf8113cf667d94e59011de854bf2b7 Author: Lucy Fu <lufu> AuthorDate: Tue Aug 9 15:04:25 2016 -0400 Commit: Lucy Fu <lufu> CommitDate: Thu Aug 25 11:51:21 2016 -0400 The provision request should not be deleted when a template is deleted. So the user can edit the catalog item to select a new template. https://bugzilla.redhat.com/show_bug.cgi?id=1331824 app/models/vm_or_template.rb | 2 +- spec/models/miq_provision_request_template_spec.rb | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-)
New commit detected on ManageIQ/manageiq/darga: https://github.com/ManageIQ/manageiq/commit/b140081d7c0c55d0f59f87d6cf5a1117a2c9d84e commit b140081d7c0c55d0f59f87d6cf5a1117a2c9d84e Author: Lucy Fu <lufu> AuthorDate: Tue Aug 9 15:08:33 2016 -0400 Commit: Lucy Fu <lufu> CommitDate: Thu Aug 25 11:52:51 2016 -0400 Update source in the provision request when source template is changed. The source column in the request is used to validate the template. During the request update time, options contains the old template while values has the new template id. https://bugzilla.redhat.com/show_bug.cgi?id=1331824 app/models/miq_provision_virt_workflow.rb | 2 +- spec/models/miq_provision_virt_workflow_spec.rb | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-)
New commit detected on ManageIQ/manageiq/darga: https://github.com/ManageIQ/manageiq/commit/753e46975f10adda9bbd89d1dbeb2efe1492ff5c commit 753e46975f10adda9bbd89d1dbeb2efe1492ff5c Author: Lucy Fu <lufu> AuthorDate: Tue Aug 9 15:10:23 2016 -0400 Commit: Lucy Fu <lufu> CommitDate: Thu Aug 25 11:53:13 2016 -0400 When validate template, check the existence of the request first. https://bugzilla.redhat.com/show_bug.cgi?id=1331824 app/models/service_template.rb | 8 ++++++++ spec/models/service_template_spec.rb | 8 ++++++++ 2 files changed, 16 insertions(+)
Fixed. Verified in 5.7.0.4-alpha1.20161005153002_cfc8a23