When distributing pdf reports to folder via loop and reduce selection, job fails randomly and some times job completes without any issue.
Error in Task Log looks like as below mentioned:
3/19/2012 20:37:26.3171313 Error Failed to generate files. Filename=C:\Documents and Settings\All Users\Application Data\QlikTech\DistributionService\1\temp\a3cc8806-3ee3-4d69-95a2-d37d0258eaf9\d1de5eb1343042c3829156d47aae79a7.pdf. Exception=System.IO.IOException: The process cannot access the file 'C:\Documents and Settings\All Users\Application Data\QlikTech\DistributionService\1\temp\a3cc8806-3ee3-4d69-95a2-d37d0258eaf9\d1de5eb1343042c3829156d47aae79a7.pdf' because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at QVBWrapper.Document.GeneratePdfFile(ILogBucket logBucket, String reportId)
...
3/19/2012 20:37:27.1451450 Error Failed to generate QVW File package.. Exception=System.NullReferenceException: Object reference not set to an instance of an object.
at QDSMain.DistributeHelper.GrabPDFFile(ILogBucket i_LogBucket, FilePackageContainer i_ParentFilePackageContainer, String i_FileName, Dictionary`2 i_DuplicateList, Document i_Document)
3/19/2012 20:37:27.1451450 Information Deleting temporary files.
3/19/2012 20:37:28.0044045 Information Closing the document.
3/19/2012 20:37:28.6449434 Information Closed the QlikView Engine successfully. ProcessID=3840
3/19/2012 20:37:29.7385464 Error The task "Udaan_With_Load" failed. Exception:
QDSMain.Exceptions.DistributionFailedException: Distribute failed with errors to follow. ---> QDSMain.Exceptions.LogBucketErrorException: Failed to generate QVW File package.. Exception=System.NullReferenceException: Object reference not set to an instance of an object.
at QDSMain.DistributeHelper.GrabPDFFile(ILogBucket i_LogBucket, FilePackageContainer i_ParentFilePackageContainer, String i_FileName, Dictionary`2 i_DuplicateList, Document i_Document)
Environment:
- QlikView Server, all versions
This error arise when the PDF-writer/printer is not releasing the PDF file that has been created. The QDS needs access to it in order to be able to distribute it.
QDS is doing a couple of retries in order to get the file but if that doesn’t succeed distribution fails.
This is possibly due to a series of quick the loop of reduce cycles, combined with drive/network access speed.