Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

SQL Server Error 1435: Database Mirroring Fix

· 7 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

SQL Server error 1435 ("Received unexpected database mirroring error response status") means the principal and mirror servers in a database mirroring session have fallen out of sync at the protocol level, usually because the mirror database is no longer in the RESTORING state, the endpoints are misconfigured, or the two partners cannot authenticate each other. The fix is to stop the mirroring session on both partners, verify the mirror database is still restoring, check the mirroring endpoints and service accounts, and then re-establish the session with the correct partner addresses. You will need sysadmin rights on both instances and a recent full and log backup of the principal database.

What You'll Need

  • Sysadmin (or at least ALTER DATABASE and CONTROL SERVER) permissions on both the principal and mirror SQL Server instances.
  • The exact server and instance names, ports, and the mirroring endpoint names used by both partners.
  • A current full backup and at least one log backup of the principal database, in case the mirror must be reinitialized.
  • Access to SQL Server error logs and the Windows Event Log on both servers.
  • Confirmation that the SQL Server service accounts can authenticate to each other (same domain, trusted domains, or certificates).

Step-by-Step

  1. Read the actual error context first. Open SQL Server Management Studio (SSMS), connect to the principal, and run SELECT * FROM sys.database_mirroring for the affected database. Check mirroring_state_desc, mirroring_role_desc, and mirroring_safety_level_desc. Then open the SQL Server error log on both instances and look for messages immediately before error 1435; they usually name the failing endpoint or authentication step. Menu labels in SSMS can differ slightly by version, but the object explorer path is Databases > right-click the database > Tasks > Mirror.
  2. Pause or stop the mirroring session on both partners. On the principal run ALTER DATABASE YourDB SET PARTNER OFF; and on the mirror run the same command. This clears the stuck protocol state without dropping the databases. Do not drop the mirror database at this stage.
  3. Verify the mirror database is still in RESTORING. On the mirror instance run SELECT state_desc FROM sys.databases WHERE name = 'YourDB';. It must return RESTORING. If it returns ONLINE or RECOVERY_PENDING, the mirror has been brought online or a restore was interrupted, and it must be re-prepared from a fresh backup before mirroring can work.
  4. Check the mirroring endpoints. On each server run SELECT name, role_desc, state_desc, port FROM sys.database_mirroring_endpoints;. Confirm the endpoint exists, is STARTED, and uses the port you expect. If the endpoint is missing, create it with CREATE ENDPOINT Mirroring STATE = STARTED AS TCP (LISTENER_PORT = 5022) FOR DATABASE_MIRRORING (ROLE = PARTNER); (use ALL for a witness). If it is stopped, run ALTER ENDPOINT Mirroring STATE = STARTED;.
  5. Confirm authentication between partners. The SQL Server service account on the principal must be able to log in to the mirror and vice versa. If both instances run under domain accounts in the same or trusted domain, this is automatic. If they are in workgroups or untrusted domains, you must use certificates; otherwise the endpoint handshake fails and can surface as error 1435. Check the SQL Server error log for login failures from the partner's service account.
  6. Test connectivity on the mirroring port. From the principal server, use Test-NetConnection -ComputerName MirrorServer -Port 5022 in PowerShell (adjust the port to your endpoint). Repeat in the other direction. If the port is blocked, fix the Windows Firewall rule or the network ACL before continuing.
  7. Restart the mirroring session in the correct order. On the mirror, set the principal partner: ALTER DATABASE YourDB SET PARTNER = 'TCP://PrincipalServer:5022';. Then on the principal, set the mirror partner: ALTER DATABASE YourDB SET PARTNER = 'TCP://MirrorServer:5022';. If you use a witness, add it with SET WITNESS = 'TCP://WitnessServer:5022'; on the principal.
  8. Confirm the session is synchronizing. Re-run SELECT mirroring_state_desc, mirroring_role_desc FROM sys.database_mirroring WHERE database_id = DB_ID('YourDB'); on both servers. You want SYNCHRONIZING or SYNCHRONIZED, with the principal as PRINCIPAL and the mirror as MIRROR. If it stays DISCONNECTED, return to the error log; the next message will usually be more specific than 1435.
  9. If the mirror cannot be salvaged, reinitialize it. Take a full backup and a log backup of the principal, restore them on the mirror with WITH NORECOVERY, then repeat steps 7 and 8. This is the reliable fallback when the mirror database state is wrong or the log chain is broken.

Common Mistakes

  • Running SET PARTNER OFF on only one side, which leaves the other partner waiting and can generate further 1435 or 1418 messages.
  • Restoring the mirror database WITH RECOVERY instead of WITH NORECOVERY, which makes it impossible to mirror.
  • Using a server name in the partner address that does not resolve from the other server (NetBIOS name vs FQDN, wrong instance name, or missing port).
  • Forgetting that the mirroring endpoint port is separate from the SQL Server instance port and must be opened in the firewall.
  • Assuming a witness is required; it is only needed for automatic failover with high-safety mode, and a misconfigured witness can cause its own connection errors.
  • Reusing an old backup to reinitialize the mirror when the principal has since truncated or backed up logs, breaking the log chain.

Tips

  • Use fully qualified domain names in partner addresses to avoid name resolution differences between servers.
  • Keep the same collation and SQL Server version compatibility in mind; mirroring requires compatible versions and editions, and the mirror must be at the same or a later build within the supported range.
  • Record the endpoint names, ports, and partner addresses in your runbook so a future 1435 can be resolved without rediscovery.
  • Check the Windows Event Log for Schannel or Kerberos errors at the same timestamp as the 1435; they often explain the underlying authentication failure.
  • If you are migrating away from mirroring, note that it is a deprecated feature; plan for an Always On availability group instead, but do not mix the two for the same database.

Troubleshooting

If the session still reports DISCONNECTED after step 8, work through these checks in order. First, re-read the error log on both servers for the exact timestamp of the failure; 1435 is a wrapper and the real cause is usually the line above it. Second, confirm the endpoint state with sys.database_mirroring_endpoints and restart it if needed. Third, verify the partner address string character by character, including the TCP:// prefix and port. Fourth, test authentication by logging in to the mirror from the principal's service account context, or review the log for SSPI or login failed errors. Fifth, if the mirror database is not in RESTORING, reinitialize from fresh backups. If the principal is in a suspect or recovery state, resolve that first; mirroring cannot proceed while either database is not healthy. Finally, if a witness is configured, remove it temporarily with SET WITNESS OFF to isolate whether the witness is the failing partner, then re-add it once the principal and mirror are synchronized.

Frequently Asked Questions

What does error 1435 actually mean?

It means one partner received a response from the other that did not match the expected mirroring protocol state, typically because the mirror database is not restoring, the endpoint is stopped or misconfigured, or authentication between the partners failed.

Can I fix 1435 without reinitializing the mirror?

Yes, in most cases. Stopping the session on both sides, correcting the endpoint or authentication problem, and re-establishing the partners is usually enough. Reinitialization is only needed when the mirror database state or log chain is broken.

Does error 1435 cause data loss?

No. The error stops synchronization but does not itself delete data. However, if you reinitialize the mirror from an old backup, any transactions after that backup are not on the mirror until the log backups are restored.

Is database mirroring still supported?

Database mirroring is deprecated in recent SQL Server versions and is not recommended for new deployments. It still works in versions that include it, but Always On availability groups are the supported long-term replacement.

Why does the error come back right after I restart the session?

The underlying cause was not fixed. Recheck the mirror database state, the endpoint state and port, and authentication between the service accounts before restarting the partners again.

Do both servers need the same SQL Server version?

The mirror must run the same or a later build within the supported compatibility range, and both instances need compatible editions. Check the official documentation for your version before rebuilding a session.