SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Distribution clean up: distribution job failure


Distribution clean up: distribution job failure

Author
Message
tt-615680
tt-615680
SSCertifiable
SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)

Group: General Forum Members
Points: 6680 Visits: 1478

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!


Sue_H
Sue_H
SSC Guru
SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)

Group: General Forum Members
Points: 67202 Visits: 13960
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



tt-615680
tt-615680
SSCertifiable
SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)

Group: General Forum Members
Points: 6680 Visits: 1478
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

Sue_H
Sue_H
SSC Guru
SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)

Group: General Forum Members
Points: 67202 Visits: 13960
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



tt-615680
tt-615680
SSCertifiable
SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)

Group: General Forum Members
Points: 6680 Visits: 1478
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?

Sue_H
Sue_H
SSC Guru
SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)

Group: General Forum Members
Points: 67202 Visits: 13960
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




Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search