"The remote server '(null)' does not exist" error occurs after you remove an article from a publication in SQL Server

Applies to: SQL Server 2014 DeveloperSQL Server 2014 DeveloperSQL Server 2014 Enterprise More

Symptoms


Assume that you create a transactional publication by using the sp_addpublication stored procedure in SQL Server 2014 or 2016, and you set the @allow_drop property to True. After you drop a table that is published in the publication and manually remove the obsolete article from the publication, you may receive an error message that resembles the following:
The remote server "(null)" does not exist.

For example, this issue occurs in the following scenario:
  • You publish a table in a transactional publication, and then you set the @allow_drop property to True.
  • You remove the published table.
  • Before the Log Reader agent processes the records that are related to the drop table command, you clean up the obsolete article by using one the following stored procedures:
    • sp_MSdropobsoletearticle
    • sp_droparticle
    • sp_droppublication
In this case, the following error messages are logged in a verbose log:
Status: 0, code: 1007, text: 'The process could not execute 'sp_MSadd_replcmds' on 'SQL_SERVER_INSTANCE'.'.
The process could not execute 'sp_MSadd_replcmds' on 'SQL_SERVER_INSTANCE'.
Repl Agent Status: 6
Status: 0, code: 1007, text: 'The remote server "(null)" does not exist, or has not been designated as a valid Publisher, or you may not have permission to see available Publishers.'.
Status: 4, code: 6001, text: 'Background thread for 'Command Loader' is exiting.'.
Status: 0, code: 22020, text: 'Batches were not committed to the Distributor.'.
Status: 0, code: 22037, text: 'The last step did not log any message!'.

Note Drop table support (DROP TABLE DDL) was added in SQL Server 2014 Service Pack 2. For information about drop table support, see the following article in the Microsoft Knowledge Base:
3170123 Supports DROP TABLE DDL for articles that are included in transactional replication in SQL Server 2014

Resolution


This issue is fixed in the following cumulative updates for SQL Server:


Status


Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

References


Learn about the terminology Microsoft uses to describe software updates.