Bug 760263

Summary: agent fails to generate drift content zip
Product: [Other] RHQ Project Reporter: Libor Zoubek <lzoubek>
Component: driftAssignee: John Sanda <jsanda>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.2CC: theute
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Windows   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-07 19:24:46 UTC Type: ---
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: 760116    
Bug Blocks: 707225    

Description Libor Zoubek 2011-12-05 17:42:35 UTC
Description of problem: when agent does not find any of file requested by server to deliver its content, it fails, we need to add check for such situation (which can occur when all files are deleted at a time between agent reported file paths & SHAs and server processed it and requests content of some files)


Version-Release number of selected component (if applicable):
Version: 3.0.0.GA
Build Number: e23441b:4e746e8

How reproducible:always
  
Actual results:

Agent shows up exception

ERROR [pool-3-thread-1] (rhq.core.pc.drift.DriftManager)- An error occurred while trying to send content for changeset[resourceId: 10004, driftDefinition: Template-File System]
java.util.zip.ZipException: ZIP file must have at least one entry
	at java.util.zip.ZipOutputStream.finish(ZipOutputStream.java:304)
	at java.util.zip.DeflaterOutputStream.close(DeflaterOutputStream.java:146)
	at java.util.zip.ZipOutputStream.close(ZipOutputStream.java:321)
	at org.rhq.core.pc.drift.DriftManager.sendChangeSetContentToServer(DriftManager.java:362)
	at org.rhq.core.pc.drift.DriftFilesSender.run(DriftFilesSender.java:70)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:662)


Expected results: No such exception occurs

Comment 1 John Sanda 2011-12-12 18:44:39 UTC
Added check so that the agent does not attempt to create empty zip file. I also added some additional debug logging to show which drift files are going into the zip file.

master commit hash: 35fcafbd977ca41cb2cbff7be81787543c5224e8

Comment 2 Mike Foley 2012-02-07 19:24:46 UTC
changing status of VERIFIED BZs for JON 2.4.2 and JON 3.0 to CLOSED/CURRENTRELEASE