Error message when you run the Distribution Agent in SQL Server 2008 or in SQL Server 2008 R2: "The distribution agent failed to create temporary files"

Symptoms
On an instance of Microsoft SQL Server 2008 or of Microsoft SQL Server 2008 R2 that is installed on a Windows Server 2008-based computer, you configure a transactional publication. You use the "Distribution Profile for OLEDB streaming" profile for the Distribution Agent. When you run the Distribution Agent, you receive the following error message:
The distribution agent failed to create temporary files in C:\Program Files\Microsoft SQL Server\100\COM directory. System returned errorcode 5.
Cause
When you use the "Distribution Profile for OLEDB streaming" profile for the Distribution Agent or you use OLEDB streaming in a custom profile, the Distribution Agent creates temporary files in the following directory:
C:\Program Files\Microsoft SQL Server\100\COM
If the account that is running SQL Server Agent does not have write access to the COM folder, the Distribution Agent will fail when it is running as a job. If you run the Distribution Agent from a command line by using an account that does not have write access to the COM folder, the same failure will occur.
Workaround
To work around this issue, grant write permissions to the COM folder for the account that is running the SQL Server Agent service. If you run the Distribution Agent from a command line, grant write permissions to the COM folder for the account that you use to run the Distribution Agent.

Note If you change the account that is assigned to the replication job, the account should have write permissions to the COM folder.

If you still encounter this issue intermittently after you follow these steps, you should make sure that the COM folder is excluded from any antivirus scan that occurs on the system.

More information
Error code 5 indicates that the error is "access is denied."
Status
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
SQL2008RelNoteReplication
Properties

Article ID: 956032 - Last Review: 10/19/2015 18:18:00 - Revision: 9.0

Microsoft SQL Server 2008 Standard, Microsoft SQL Server 2008 Developer, Microsoft SQL Server 2008 Enterprise, Microsoft SQL Server 2008 R2 Datacenter, Microsoft SQL Server 2008 R2 Developer, Microsoft SQL Server 2008 R2 Enterprise, Microsoft SQL Server 2008 R2 Standard, Microsoft SQL Server 2012 Developer, Microsoft SQL Server 2012 Enterprise, Microsoft SQL Server 2012 Enterprise Core, Microsoft SQL Server 2012 Service Pack 1, Microsoft SQL Server 2012 Service Pack 2, Microsoft SQL Server 2012 Standard, Microsoft SQL Server 2014 Developer, Microsoft SQL Server 2014 Enterprise, Microsoft SQL Server 2014 Enterprise Core, Microsoft SQL Server 2014 Service Pack 1, Microsoft SQL Server 2014 Standard

  • sql2008relnotereplication sql2008relnote kbtshoot kbexpertiseadvanced kbprb KB956032
Feedback