web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

E-mail attachment distributor batch job - System.IO.IOException: The file exists

(0) ShareShare
ReportReport
Posted on by

Hi All,

There is below error in batch job history of "E-mail attachment distributor" , unable to proceed further, Kindly advise us how to resolve this error.

System.IO.IOException: The file exists.

at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.Path.InternalGetTempFileName(Boolean checkHost)
at Dynamics.Ax.Application.WinAPIServer.getTempFileName() in WinAPIServer.getTempFileName.xpp:line 19
at Dynamics.Ax.Application.SRSPrintArchiveContract.Parmtmpfilepath(String _tmpFilePath, Boolean ) in SRSPrintArchiveContract.parmTmpFilePath.xpp:line 16
at Dynamics.Ax.Application.SRSPrintArchiveContract.Parmtmpfilepath()
at Dynamics.Ax.Application.SrsReportRunPrinter.Toarchive() in SrsReportRunPrinter.toArchive.xpp:line 9
at Dynamics.Ax.Application.SrsReportRunPrinter.Printreport() in SrsReportRunPrinter.printReport.xpp:line 41
at Dynamics.Ax.Application.SrsReportRunService.Runreport(SrsReportDataContract _reportContract) in SrsReportRunService.runReport.xpp:line 43
at Dynamics.Ax.Application.SrsReportRunImpl.Runreport() in SrsReportRunImpl.runReport.xpp:line 11
at Dynamics.Ax.Application.SrsReportRunController.Runreport() in SrsReportRunController.runReport.xpp:line 99
at Dynamics.Ax.Application.SrsReportRunController.Run() in SrsReportRunController.run.xpp:line 27
at Dynamics.Ax.Application.SysOperationController.Startoperation() in SysOperationController.startOperation.xpp:line 10
at Dynamics.Ax.Application.SrsReportRunController.Startoperation() in SrsReportRunController.startOperation.xpp:line 12
at Dynamics.Ax.Application.SysWorkflowApprovalWorkitemService.Generatereport(Int64 _configReportRecId, Int32 _contextTableId, Int64 _contextRecId) in SysWorkflowApprovalWorkitemService.generateReport.xpp:line 57
at Dynamics.Ax.Application.SysWorkflowApprovalWorkitemService.Getattachmentcontent(Int64 _docuRefRecId, Int64 _configReportRecId, Int32 _contextTableId, Int64 _contextRecId) in SysWorkflowApprovalWorkitemService.getAttachmentContent.xpp:line 36
at Dynamics.Ax.Application.SysEmailAttachment.generateAndSaveFileToDisk(Int64 _appConfigReportsRecId, Int32 _contextTableId, Int64 _contextRecId) in SysEmailAttachment.generateAndSaveFileToDisk.xpp:line 38
at Dynamics.Ax.Application.SysEmailAttachment.generateAttachment(String _workflowElementName, Int32 _contextTableId, Int64 _contextRecId) in SysEmailAttachment.generateAttachment.xpp:line 29
at Dynamics.Ax.Application.EventNotificationWorkflow.Sendmail(Boolean _isGlobalEmailTemplate, Boolean ) in EventNotificationWorkflow.sendMail.xpp:line 30
at Dynamics.Ax.Application.EventNotificationWorkflow.Sendmail(Boolean _isGlobalEmailTemplate)
at Dynamics.Ax.Application.EventNotificationWorkflow.Create(Boolean _isGlobal, Boolean ) in EventNotificationWorkflow.create.xpp:line 23
at Dynamics.Ax.Application.EventNotificationWorkflow.Create(Boolean _isGlobal)
at Dynamics.Ax.Application.SysEmailAttachment.Createeventnotification() in SysEmailAttachment.createEventNotification.xpp:line 31
at Dynamics.Ax.Application.SysEmailAttachment.Run() in SysEmailAttachment.run.xpp:line 10
at Dynamics.Ax.Application.SysEmailAttachmentNotificationBatch.Run() in SysEmailAttachmentNotificationBatch.run.xpp:line 18
at Dynamics.Ax.Application.BatchRun.runJobStaticCode(Int64 batchId) in BatchRun.runJobStaticCode.xpp:line 54

Regards,

Akbar

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mea_ Profile Picture
    60,284 on at
    RE: System.IO.IOException: The file exists. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) in AX 2012 - E-mail attachment distributor batch job

    Hi Akbarpasha ,

    It means that random temporary file name that system generates already exists in temp folder, so solution would be to clean the folder. Check C:\Users\AOSUserName\AppData\Local\Temp folder on the AOS server, where AOSUserName is user name that AOS is running under and delete files with ".tmp" extension.

  • Akbarpasha Profile Picture
    on at
    RE: E-mail attachment distributor batch job - System.IO.IOException: The file exists

    Hi ievgen,

    i have cleared temp folder for he path, but still the batch job is ending in error in batchjobhistory.

  • Mea_ Profile Picture
    60,284 on at
    RE: E-mail attachment distributor batch job - System.IO.IOException: The file exists

    Same error? Do you have only one batch AOS, cause if you have multiple you need to check them all.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#2
Community Member Profile Picture

Community Member 2

#2
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans