Bug 812912 - NPE in InventoryManager during detection of drift support
NPE in InventoryManager during detection of drift support
Product: RHQ Project
Classification: Other
Component: drift (Show other bugs)
Unspecified Unspecified
high Severity urgent (vote)
: ---
: RHQ 4.4.0
Assigned To: Heiko W. Rupp
Mike Foley
Depends On:
Blocks: 782759
  Show dependency treegraph
Reported: 2012-04-16 10:42 EDT by Heiko W. Rupp
Modified: 2013-09-01 06:15 EDT (History)
0 users

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

Attachments (Terms of Use)
Screenshot of idea with some variables (121.71 KB, image/png)
2012-04-16 10:43 EDT, Heiko W. Rupp
no flags Details

  None (edit)
Description Heiko W. Rupp 2012-04-16 10:42:32 EDT
The following code throws a NPE because type is null

    private boolean supportsDriftManagement(Resource r) {
        PluginMetadataManager metaDataMgr = PluginContainer.getInstance().getPluginManager().getMetadataManager();
        ResourceType type = metaDataMgr.getType(r.getResourceType());
        return type.getDriftDefinitionTemplates() != null && !type.getDriftDefinitionTemplates().isEmpty();

The  resource in question is 

Resource[id=10004, uuid=192fc673-144a-4476-9e19-9b5166cc4193, type={Samba}Samba Server, key=/etc/samba/smb.conf, name=pintsize.home.pilhuhn.de, parent=pintsize]

where r.inventoryStatus == IGNORED

Agent log says 

2012-04-16 16:41:43,313 WARN  [InventoryManager.discovery-1] (rhq.core.pc.inventory.InventoryManager)- Failed to synchronize local inventory with Server inventory for Resource [10001] and its descendants: null
Comment 1 Heiko W. Rupp 2012-04-16 10:43:06 EDT
Created attachment 577732 [details]
Screenshot of idea with some variables
Comment 2 Heiko W. Rupp 2012-04-16 10:57:54 EDT
as fix: return false if type==null as ignored resources have no drift support by definition
Comment 3 Charles Crouch 2012-04-16 11:40:56 EDT
Heiko is working on the fix
Comment 4 Heiko W. Rupp 2012-04-16 11:44:47 EDT
master  f383f2dc3a3f6eb
Comment 5 Heiko W. Rupp 2013-09-01 06:15:47 EDT
Bulk closing of items that are on_qa and in old RHQ releases, which are out for a long time and where the issue has not been re-opened since.

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