Error 14151:Replication Agent failed to start.

I got below error 14151 for one of my SQL Server Replication Agent. The SQL Server Replication Agent may not start and will throw error message:

The replication agent is not registered properly. Rerun SQL Server setup. The step failed. [SQLSTATE 42000] (Error 14151). The step failed.

Cause

The Replication Agent that is running on the server may not restart when a named instance of SQL Server is removed from the server and replication is configured on the server. When you remove a named instance of SQL Server, the registry entries that relate to the Replication Agent are removed from the server. This behavior may also occur when the 8.3 name creation on the NTFS file system partition is disabled on the computer where SQL Server is installed. You disable 8.3 name creation on the NTFS partition by setting the NtfsDisable8dot3NameCreation registry key to 1.

Solution

To work around this problem, follow these steps:

1-Set the NtfsDisable8dot3NameCreation registry key to 0.
To change the registry key, use these steps:
2-On the Start menu, click Run. Type regedit, and then click OK. Locate the following key in Registry Editor:

HKEY_LOCAL_MACHINE\SYSTEM\CURRENTCONTROLSET\CONTROL\FileSystem\

Double-click the NtfsDisable8dot3NameCreation key of type REG_DWORD. Set the Value Data of the registry key to 0, and then click OK.
Note: By default, the value for the entry is set to 0. Close Registry Editor.

3-Restart your computer.

Now you should register the replication agents post performing above registry entry. Re-register the Replication Agent executables. To do this, use below steps:

1- Stop the SQL Server Agent service.

2- Copy the following command to a batch file:

snapshot.exe -regserver
distrib.exe -regserver
replmerg.exe -regserver
logread.exe -regserver
qrdrsvc.exe –regserver

3- Run the batch file you created in step 2 from the Microsoft SQL Server\80\Com folder.

4- Restart the SQL Server Agent service.

I hope you like this article. Please follow our Facebook page and Twitter handle to get latest updates.

Follow me:

Manvendra Deo Singh

I am working as a Technical Architect in one of the top IT consulting firm. I have expertise on all versions of SQL Server since SQL Server 2000. I have lead multiple SQL Server projects like consolidation, upgrades, migrations, HA & DR. I love to share my knowledge. You can contact me on my social accounts for any consulting work.
Manvendra Deo Singh
Follow me:

Leave a Reply

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