SQL Server Replication Process Could not Read File due to OS Error 5

20 Apr
April 20, 2012

Resolving the following SQL Server Replication error is easy enough, and is general linked to access to replication folders on the Distributor file-system, from the Subscriber Agent account.

The full error message will look something like this:

The process could not read file ‘‘ due to OS error 5. (Source: MSSQL_REPL, Error number: MSSQL_REPL20024)

When setting up replication, you are required to specify an account under which the Subscriber Agent will run, for example if you were using T-SQL to create a subscription, you will have to specify the following paramters:

@job_login = '[subscriber-agent-account]'
@job_password = '[subscriber-agent-account-password]'

The error message indicates that the [subscriber-agent-account] used to create the subscription does not have access to shared folders required for that subscription.

Lets assume that you have a distributor machine called Dist1, which has a folder called D:\ReplData, this folder contains data used for replicating a publication, when you created the distributor, you specified this folder as a network location to use as a file share for the replication data, using either:

  • Implicit File Share (not recommended): When you specify \\Dist1\$D\ReplData as the network location, this is implicit because you are traversing the file-system in order to reach the folder share, and the folder is not being explicitly shared.
  • Explicit File Share (recommended): When you specify \\Dist1\ReplData, this is done by right-clicking on the folder in Windows Explorer, and selecting the “Share” option.

Implicit File Share Distribution Folder

In order to resolve the “Process could not read file due to OS Error 5″ error when using an implicit file share, you will have to give the subscriber agent account FULL administrative access to the file system (D: in our case), since the authentication need to be able to read the D:\ drive in order to reach the ReplData folder.

Explicit File Share Distribution Folder

In order to resolve the “Process could not read file due to OS Error 5″ error when using an explicit file share, you will have to give the subscriber agent account read access to the File Share location only. This security setting configuration can be done when setting up the folder as a Shared Folder.

Clearly the option with the least

SQL Server Replication Process Could not Read File due to OS Error 5 rated 4 out of 5 by 1 readers

SQL Server Replication Process Could not Read File due to OS Error 5 , 4.0 out of 5 based on 1 ratings

          0 votes
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>