How to Fix SQL Server Error 21893 (Msg 21893)

Published
Length
3 min read

Luis Felipe Dias

All posts

You see sql server error 21893 when a redirected publisher misses remote subscriber entries. To fix it, you must add the subscribers as remote servers on that publisher. This issue carries a severity level of 16 in the database engine. It stops replication validation until the new publisher host knows every subscriber. What causes sql server error 21893 in replication In a high availability setup, you might redirect an original publisher to another node. The database engine checks if the red

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

You see sql server error 21893 when a redirected publisher misses remote subscriber entries. To fix it, you must add the subscribers as remote servers on that publisher.

This issue carries a severity level of 16 in the database engine. It stops replication validation until the new publisher host knows every subscriber.

What causes sql server error 21893 in replication

In a high availability setup, you might redirect an original publisher to another node. The database engine checks if the redirected publisher knows all existing subscribers. If those subscribers do not appear as remote servers, the check fails.

The engine then raises message 21893 with severity 16. The official error text lists the missing subscribers and the original publisher name. It also names the redirected publisher that lacks the remote server records.

Server definitions live at the instance level rather than inside the replicated database. When a failover happens, the secondary instance does not get these server links by itself. Admins must set up the remote server records on every possible publisher partner.

How to diagnose and fix the failure safely

Start by reading the exact error text in your log. Note the subscriber names and the redirected publisher name from the message. Log in to the redirected publisher instance to check its registered remote servers.

Compare the remote servers on the original publisher against the redirected publisher. You will find one or more subscriber server names missing on the new host. Add each missing subscriber as a remote server on the redirected publisher instance.

Do not hand out broad admin rights to fix this issue in production. A database user is the identity of a login when it connects to a database. People who need access to many databases on an instance often use a SQL login.

Kubernetes API Server Access + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

For one or a few databases, a contained database user is an option. An admin must first enable contained databases on the server and the database. There are 13 types of database users available in the engine.

Keep permissions tight when engineers check replication tables during an outage. Members of the fixed datareader role can read all data from user tables and views. Do not grant the database owner role just to inspect replication state.

A database owner can run all maintenance tasks and even drop the database. Note that you cannot change the permissions assigned to fixed database roles. Grant only read access for diagnosis, and limit server link changes to replication admins.

How to prevent missing remote server errors

You can avoid this error by matching server settings across all availability replicas. When you add a subscriber to the primary publisher, update every secondary partner too. Keep a simple list of all subscribers tied to each published database.

Run a regular check that compares remote server catalogs across your publisher nodes. If a new subscriber joins the topology, register it on all failover partners right away. This simple habit keeps publisher redirection ready for planned switchovers or sudden outages.

Also review who can change server links and replication settings on your hosts. Separate daily read access from the high privileges needed to register remote servers. When teams also query user tables, masking rewrites matched fields like emails in results.

Govern SQL Server queries and responses in flight

Table grants decide which SQL Server objects a caller may touch. They do not check query intent or rewrite sensitive values in results across every client and agent. By design, hoop.dev sits inline in the TDS wire protocol next to SQL Server as a sidecar for your SQL Server. On every production batch from an engineer or AI agent, hoop.dev decides to pass, mask, block, or hold it for approval.

With hoop.dev guardrails and hoop.dev data masking, banned statements are refused or held for review, matched sensitive fields in supported result columns are masked in memory, and each decision is logged. Check out the code on GitHub.

Frequently asked questions

What does severity 16 mean for message 21893?

Severity 16 means the error comes from a user or setup mistake. The database engine stays online, and no system data is corrupt. You can fix it by adding the missing remote server records.

Where do I register the missing subscriber servers?

You must register them on the redirected publisher instance named in the error text. That instance needs a remote server entry for each subscriber of the original publisher. Once added, run the publisher redirection check again.

What role should engineers use to inspect database tables safely?

Assign engineers to the fixed datareader role so they can read user tables and views. Avoid the database owner role because it allows full maintenance and dropping the database. If someone must never read table data, use the deny datareader role instead.

The query runs. The emails stay hidden.