Bug 1023332
Summary: | NullPointerException when synchronizing discovered resources with agent | ||||||
---|---|---|---|---|---|---|---|
Product: | [JBoss] JBoss Operations Network | Reporter: | Radim Hatlapatka <rhatlapa> | ||||
Component: | Core Server | Assignee: | John Mazzitelli <mazz> | ||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | Mike Foley <mfoley> | ||||
Severity: | high | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | JON 3.2 | CC: | hrupp | ||||
Target Milestone: | ER05 | ||||||
Target Release: | JON 3.2.0 | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2014-01-02 20:42:57 UTC | Type: | Bug | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Bug Depends On: | |||||||
Bug Blocks: | 1012435 | ||||||
Attachments: |
|
Description
Radim Hatlapatka
2013-10-25 08:25:56 UTC
for (Resource server : servers) { // Only update servers if they haven't already been updated at the platform level if (!platforms.contains(server.getParentResource())) { AgentClient agentClient = agentManager.getAgentClient(server.getAgent()); try { syncInfo = entityManager.find(ResourceSyncInfo.class, server.getId()); agentClient.getDiscoveryAgentService().synchronizeInventory(syncInfo); <<<<--- here line 438 the agentManager.getAgentClient() call can return null, so dereferencing it in line 438 can indeed NPE. The question is though why it may return null in some cases. do we have the log files for this? Debug turned on - looking for this message: LOG.debug("Could not get agent client for " + agent, t); I suspect this is happening during startup, shutdown or at times when the comm layer is turned off (perhaps when in maintenance mode??). I'll add some NPE checks anyways - I think it is safe to check for null here and skip if it is null - the agent should eventually sync itself when its ready. master commit: 1b7f2f3 release/jon3.2/x branch commit: 2af8a30 cherry pick isn't foolproof - apparently, the log variable was renamed LOG in master but that change wasn't in the 3.2 branch. commit e13d0a8 puts the log variable name back to lowercase in the 3.2 branch. Created attachment 817000 [details]
JON server log with the error
It wasn't run with enabled debug logging.
Moving to ON_QA for test with new brew build. |