This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 786614 - Drift errors in agent.log ,,,, NPE in DriftManager line #681 ... yet Drift seems to be working
Drift errors in agent.log ,,,, NPE in DriftManager line #681 ... yet Drift s...
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: drift (Show other bugs)
3.0.1
Unspecified Unspecified
medium Severity medium (vote)
: ---
: RHQ 4.5.0
Assigned To: John Sanda
Mike Foley
:
Depends On:
Blocks: 833061
  Show dependency treegraph
 
Reported: 2012-02-01 17:24 EST by Mike Foley
Modified: 2013-09-01 06:17 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 833061 (view as bug list)
Environment:
Last Closed: 2013-09-01 06:17:12 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Mike Foley 2012-02-01 17:24:02 EST
Description of problem:  Drift errors in agent.log NPE in DriftManager line #681 ... despite the fact the drift seems to be working for me.


Version-Release number of selected component (if applicable):  JON 3.01 RC#1

2012-02-01 16:50:10,616 ERROR [pool-3-thread-3] (rhq.core.pc.drift.DriftDetector)- Drift detection failed: null
java.lang.NullPointerException
	at org.rhq.core.pc.drift.DriftManager.getAbsoluteBaseDirectory(DriftManager.java:681)
	at org.rhq.core.pc.drift.DriftDetector.basedir(DriftDetector.java:523)
	at org.rhq.core.pc.drift.DriftDetector.createHeaders(DriftDetector.java:531)
	at org.rhq.core.pc.drift.DriftDetector.run(DriftDetector.java:117)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:165)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:267)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:636)
2012-02-01 16:50:10,616 INFO  [pool-3-thread-3] (rhq.core.pc.drift.DriftDetector)- Reverting snapshot for DriftDetectionSchedule[resourceId: 10034, driftDefinitionId: 0, driftDefinitionName: Template-File System]
2012-02-01 16:51:10,601 INFO  [MeasurementManager.sender-1] (rhq.core.pc.measurement.MeasurementSenderRunner)- Measurement collection for [5] metrics took 5ms - sending report to Server...
2012-02-01 16:51:18,219 INFO  [InventoryManager.availability-1] (rhq.core.pc.inventory.InventoryManager)- Sending availability report to Server...
2012-02-01 16:52:10,601 INFO  [MeasurementManager.sender-1] (rhq.core.pc.measurement.MeasurementSenderRunner)- Measurement collection for [5] metrics took 5ms - sending report to Server...
2012-02-01 16:52:10,616 ERROR [pool-3-thread-2] (rhq.core.pc.drift.DriftDetector)- Drift detection failed: null
java.lang.NullPointerException
	at org.rhq.core.pc.drift.DriftManager.getAbsoluteBaseDirectory(DriftManager.java:681)
	at org.rhq.core.pc.drift.DriftDetector.basedir(DriftDetector.java:523)
	at org.rhq.core.pc.drift.DriftDetector.createHeaders(DriftDetector.java:531)
	at org.rhq.core.pc.drift.DriftDetector.run(DriftDetector.java:117)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:165)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:267)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:636)
2012-02-01 16:52:10,616 INFO  [pool-3-thread-2] (rhq.core.pc.drift.DriftDetector)- Reverting snapshot for DriftDetectionSchedule[resourceId: 10034, driftDefinitionId: 0, driftDefinitionName: Template-File System]
2012-02-01 16:52:57,652 INFO  [RHQ Agent Prompt Input Thread] (org.rhq.enterprise.agent.AgentMain)- {AgentMain.prompt-command-invoked}Prompt command invoked: [quit]
Comment 1 Mike Foley 2012-02-01 17:27:37 EST
fyi ...

<ips1> mfoley:         ResourceContainer container = im.getResourceContainer(resourceId);
<ips1>         Resource resource = container.getResource();
<ips1> line 681 is the 2nd one
Comment 2 Mike Foley 2012-02-01 17:55:21 EST
i turned on agent debug ... and could not repro the error.  perhaps the resolution is to add a little more info to the output or error so that if it happens again?
Comment 4 John Sanda 2012-06-18 09:52:34 EDT
I have adding a check and some error logging if the getAbsoluteBaseDirectory method cannot find a resource container for the resource id argument. The logging outputs the resource id and drift definition to facilitate additional debugging and also suggesting restarting the agent with the -u option. Lastly an IllegalArgumentException is thrown since the method should only receive a resource id for which a resource container exists. Changes have been pushed to master.

commit hash: 7ac42911
Comment 5 Heiko W. Rupp 2013-09-01 06:17:12 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.