Distribution clean up: distribution job failure

  • Dear All,

     

    I'm currently having an issue with the "Distribution clean up: distribution" job which is a default job created for Replication. Would you please let me know how this issue can be resolved as it is scheduled to run every 5 minutes and keeps failing with the following error message:

     

    NT SERVICE\SQLSERVERAGENT. Could not remove directory '\\DIRECTORY'. Check the security context of xp_cmdshell and close other processes that may be  accessing the directory. [SQLSTATE 42000] (Error 20015)  Replication-@rowcount_only parameter must be the value 0,1, or 2. 0=7.0 compatible checksum.  1=only check rowcou: agent distribution@rowcount_only parameter must be the value 0,1, or 2. 0=7.0 compatible checksum. 1=only   scheduled for retry. Could not clean up the distribution transaction tables. [SQLSTATE 01000] (Message 14152).  The step failed.

     

     

     

    Thank you in advance!

  • tt-615680 - Tuesday, February 6, 2018 4:44 AM

    Dear All,

     

    I'm currently having an issue with the "Distribution clean up: distribution" job which is a default job created for Replication. Would you please let me know how this issue can be resolved as it is scheduled to run every 5 minutes and keeps failing with the following error message:

     

    NT SERVICE\SQLSERVERAGENT. Could not remove directory '\\DIRECTORY'. Check the security context of xp_cmdshell and close other processes that may be  accessing the directory. [SQLSTATE 42000] (Error 20015)  Replication-@rowcount_only parameter must be the value 0,1, or 2. 0=7.0 compatible checksum.  1=only check rowcou: agent distribution@rowcount_only parameter must be the value 0,1, or 2. 0=7.0 compatible checksum. 1=only   scheduled for retry. Could not clean up the distribution transaction tables. [SQLSTATE 01000] (Message 14152).  The step failed.

     

     

     

    Thank you in advance!

    Those errors are generally caused by the SQL Server service account not having  full control to the share used in replication.

    Sue

  • Sue_H - Tuesday, February 6, 2018 7:03 AM

    tt-615680 - Tuesday, February 6, 2018 4:44 AM

    Dear All,

     

    I'm currently having an issue with the "Distribution clean up: distribution" job which is a default job created for Replication. Would you please let me know how this issue can be resolved as it is scheduled to run every 5 minutes and keeps failing with the following error message:

     

    NT SERVICE\SQLSERVERAGENT. Could not remove directory '\\DIRECTORY'. Check the security context of xp_cmdshell and close other processes that may be  accessing the directory. [SQLSTATE 42000] (Error 20015)  Replication-@rowcount_only parameter must be the value 0,1, or 2. 0=7.0 compatible checksum.  1=only check rowcou: agent distribution@rowcount_only parameter must be the value 0,1, or 2. 0=7.0 compatible checksum. 1=only   scheduled for retry. Could not clean up the distribution transaction tables. [SQLSTATE 01000] (Message 14152).  The step failed.

     

     

     

    Thank you in advance!

    Those errors are generally caused by the SQL Server service account not having  full control to the share used in replication.

    Sue

    I get the same error message even after giving the sql server account a 'full access' permission on the folderswhere the snapshots files are located

  • tt-615680 - Wednesday, February 7, 2018 3:39 AM

    I get the same error message even after giving the sql server account a 'full access' permission on the folderswhere the snapshots files are located

    Make sure it's whatever is the real path as specified in the error message. Default snapshot folder is not the same as where the snapshot files are it's a subfolder.
    Check the working_directory value in the MSdistpublishers table in msdb

    Sue

  • Sue_H - Wednesday, February 7, 2018 6:03 AM

    tt-615680 - Wednesday, February 7, 2018 3:39 AM

    I get the same error message even after giving the sql server account a 'full access' permission on the folderswhere the snapshots files are located

    Make sure it's whatever is the real path as specified in the error message. Default snapshot folder is not the same as where the snapshot files are it's a subfolder.
    Check the working_directory value in the MSdistpublishers table in msdb

    Sue

    The working_directory value in the MSdistpublishers table is different than the error message does that mean I need to amend the location and why would it be different than what it was set to?

  • tt-615680 - Wednesday, February 7, 2018 6:20 AM

    Sue_H - Wednesday, February 7, 2018 6:03 AM

    tt-615680 - Wednesday, February 7, 2018 3:39 AM

    I get the same error message even after giving the sql server account a 'full access' permission on the folderswhere the snapshots files are located

    Make sure it's whatever is the real path as specified in the error message. Default snapshot folder is not the same as where the snapshot files are it's a subfolder.
    Check the working_directory value in the MSdistpublishers table in msdb

    Sue

    The working_directory value in the MSdistpublishers table is different than the error message does that mean I need to amend the location and why would it be different than what it was set to?

    The error message is typically caused by permissions. I have no idea what \\Directory is pointing to or what directory was in the error message, That series of errors is exactly what you get with the permissions issue. You'll need to figure it out by going through the sp_MSdistribution_cleanup stored procedure the job executes.
    Here is a blog post about the error - it basically says the same thing I posted in my first reply:
    Distribution Agent fails with “Could not remove directory†error

    Sue

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

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