The distribution agent failed to create temporary files

  • Hi

    I'm getting this error with a transactional replication setup on SQL 2008R2 Standard (SP1):

    The distribution agent failed to create temporary files in 'C:\Program Files\Microsoft SQL Server\100\COM' directory. System returned errorcode 5. (Source: MSSQL_REPL, Error number: MSSQL_REPL21100)

    I've been to http://support.microsoft.com/kb/956032/en-us amongst other places, and as a result given full control to Everyone on the C:\Program Files\Microsoft SQL Server\100\COM folder (I tried the SQL Agent and Distribution agent accounts first). I've also disabled on-access scanning for the anti-virus software. It's a 2-node cluster so I've done this for both nodes.

    Is there anything else I can try in order to troubleshoot further? - only this one has got me completely stumped.

    Thanks everyone,

    Duncan

  • Hi all

    I managed to fix it. Confusingly, although the error message was on the publisher/distributor, the folder it was referring to was on the subscriber. I gave the distribution agent account write access to the folder and disabled on-access scanning for the folder (as I had done at the publisher/distributor), and lo-and-behold it works!

    Live and learn.

    Duncan

  • I setup replication using the impersonate settings, so it's using the SQL Agent account which is domain and is an Admin on both boxes. I'm still getting the error.

  • pcwik (3/14/2013)


    I setup replication using the impersonate settings, so it's using the SQL Agent account which is domain and is an Admin on both boxes. I'm still getting the error.

    Sorry to hear that. You can try using Process Monitor to find out a bit more about the accounts and access requests involved - that's what I did which enabled me to work out I was looking at the wrong box.

    You will need to check the exact permissions on the folder involved as well. Even an admin account can be denied access to folders.

  • Thanks, I'll give process monitor a try. As far as the permissions I even created a share and granted full control to everyone, same thing. The real stupid part of this is that is does breath every ten minutes or so. If I keep refreshing replication monitor, it shows error, error, error, transactions delivered, error...

  • Just wanted to add that I also encountered this issue today. Also on SQL2008R2 SP1.

    Very weird, the error is reported on the publisher but is referring to a failure of the distribution agent running on the subscriber.

    The microsoft support article says this only occurs when "You use the "Distribution Profile for OLEDB streaming" profile for the Distribution Agent", however I am not using this profile. I'm using a custom profile which does not include any of the OLEdb profile settings.

    Also the error just started out of nowhere, no changes, replication has been working fine for over a year. I added the permission to the folder to fix it, but would like to know why it started only now.

  • Andrew G (7/11/2013)


    Just wanted to add that I also encountered this issue today. Also on SQL2008R2 SP1.

    Very weird, the error is reported on the publisher but is referring to a failure of the distribution agent running on the subscriber.

    The microsoft support article says this only occurs when "You use the "Distribution Profile for OLEDB streaming" profile for the Distribution Agent", however I am not using this profile. I'm using a custom profile which does not include any of the OLEdb profile settings.

    Also the error just started out of nowhere, no changes, replication has been working fine for over a year. I added the permission to the folder to fix it, but would like to know why it started only now.

    Have you checked things like antivirus software? Has anything else changed recently?

    Try using process monitor as I mentioned above. That was the only way I could properly troubleshoot it in the end. It will tell you exactly what processes are trying to access what and will give you an idea of the error.

    Hope you get it solved.

    Duncan

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply