Bug 785857 - deleting template causes resources with detached templates to throw exception
deleting template causes resources with detached templates to throw exception
Product: RHQ Project
Classification: Other
Component: Core UI, drift (Show other bugs)
Unspecified Unspecified
urgent Severity high (vote)
: ---
: JON 3.0.1
Assigned To: John Mazzitelli
Mike Foley
Depends On: 767263
Blocks: jon310-sprint11/rhq44-sprint11
  Show dependency treegraph
Reported: 2012-01-30 14:15 EST by Charles Crouch
Modified: 2015-02-01 18:27 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 767263
Last Closed: 2013-09-03 11:04:34 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Charles Crouch 2012-01-30 14:15:47 EST
+++ This bug was initially created as a clone of Bug #767263 +++

To replicate:

1) create a drift template
2) go to resource A's drift tab, create definition from that template, but detach it
3) delete the template
4) go back to the resource A's drift tab

The template is no longer in existance. But the definition was detached, so it does not get deleted. However, what should it show in the "template" column of the table? It should probably be empty. But it looks like its trying to get the name of an non-existent template

This actually is pretty bad because now I can't view the drift definitions anymore, not just for this definition, but I assume I can't see any defs, because it's the table that can't render - and the table lists all definitions.

--- Additional comment from mazz@redhat.com on 2011-12-13 12:01:06 EST ---

com.google.gwt.core.client.JavaScriptException:(TypeError): Cannot read property 'org_rhq_core_domain_drift_DriftDefinitionTemplate_name' of null
(TypeError): Cannot read property 'org_rhq_core_domain_drift_DriftDefinitionTemplate_name' of null
   at Unknown.org_rhq_core_domain_drift_DriftDefinitionTemplate_$getName__Lorg_rhq_core_domain_drift_DriftDefinitionTemplate_2Ljava_lang_String_2(Unknown source:0)
   at Unknown.org_rhq_enterprise_gui_coregui_client_drift_DriftDefinitionDataSource_convert__Lorg_rhq_core_domain_drift_DriftDefinitionComposite_2Lcom_smartgwt_client_widgets_grid_ListGridRecord_2(Unknown source:0)
   at Unknown.org_rhq_enterprise_gui_coregui_client_drift_DriftDefinitionDataSource_$copyValues__Lorg_rhq_enterprise_gui_coregui_client_drift_DriftDefinitionDataSource_2Lorg_rhq_core_domain_drift_DriftDefinitionComposite_2Lcom_smartgwt_client_widgets_grid_ListGridRecord_2(Unknown source:0)
   at Unknown.org_rhq_enterprise_gui_coregui_client_drift_DriftDefinitionDataSource_copyValues__Ljava_lang_Object_2Lcom_smartgwt_client_widgets_grid_ListGridRecord_2(Unknown source:0)
   at Unknown.org_rhq_enterprise_gui_coregui_client_util_RPCDataSource_copyValues__Ljava_lang_Object_2ZLcom_smartgwt_client_widgets_grid_ListGridRecord_2(Unknown source:0)
   at Unknown.org_rhq_enterprise_gui_coregui_client_util_RPCDataSource_$buildRecords__Lorg_rhq_enterprise_gui_coregui_client_util_RPCDataSource_2Ljava_util_Collection_2Z_3Lcom_smartgwt_client_widgets_grid_ListGridRecord_2(Unknown source:0)
   at Unknown.org_rhq_enterprise_gui_coregui_client_util_RPCDataSource_$buildRecords__Lorg_rhq_enterprise_gui_coregui_client_util_RPCDataSource_2Ljava_util_Collection_2_3Lcom_smartgwt_client_widgets_grid_ListGridRecord_2(Unknown source:0)
   at Unknown.org_rhq_enterprise_gui_coregui_client_util_RPCDataSource_buildRecords__Ljava_util_Collection_2_3Lcom_smartgwt_client_widgets_grid_ListGridRecord_2(Unknown source:0)
   at Unknown.org_rhq_enterprise_gui_coregui_client_drift_DriftDefinitionDataSource_$dataRetrieved__Lorg_rhq_enterprise_gui_coregui_client_drift_DriftDefinitionDataSource_2Lorg_rhq_core_domain_util_PageList_2Lcom_smartgwt_client_data_DSResponse_2Lcom_smartgwt_client_data_DSRequest_2V(Unknown source:0)
   at Unknown.org_rhq_enterprise_gui_coregui_client_drift_DriftDefinitionDataSource$9$1_onPermissionsLoaded__Ljava_util_Set_2V(Unknown source:0)

--- Additional comment from mazz@redhat.com on 2011-12-13 13:48:00 EST ---

git commit to master: 1c2b7c6

jay looked around and didn't find any other places where driftDef.getTemplate() is called that isn't protected from null checks so this appears to be the only place where this problem occurred.

--- Additional comment from mfoley@redhat.com on 2011-12-13 14:58:22 EST ---

documenting that i am reproducing the original error (I don't have the fix yet)....   retest tomorrow.

--- Additional comment from skondkar@redhat.com on 2011-12-14 05:51:16 EST ---

Verified on master build#833 (Version: 4.3.0-SNAPSHOT Build Number: ee66d10)

Created a drift template and a detached definition from that template in drift tab of resource. Deleted the template, navigated back to the resource's drift tab.

 Verified that there is no exception thrown and the "template" column of detached drift definition table of the resource displays 'None'.
Comment 2 John Mazzitelli 2012-01-30 16:08:13 EST
git commit to release/jon3.0.x branch: ceb7b6e
Comment 3 Charles Crouch 2012-01-30 23:39:21 EST
Switching to using MODIFIED for fixes that are in the appropriate but are waiting to get into a build.
Comment 4 Simeon Pinder 2012-02-03 10:12:29 EST
Moving this to ON_QA as there is now a binary available to test with:
Comment 5 Heiko W. Rupp 2013-09-03 11:04:34 EDT
Bulk closing of old issues in VERIFIED state.

Note You need to log in before you can comment on or make changes to this bug.