SQL Server Error 1479: Mirroring Timeout Fix
In this article
SQL Server error 1479 means the database mirroring session dropped because the mirroring connection timed out — the principal server stopped hearing from the mirror (or the witness) within the configured timeout window. The fastest fix is to confirm both endpoints can actually reach each other on the mirroring port, restart the SQL Server service on the mirror if it is hung, and then resume the mirroring session. Most occurrences trace back to a network path problem, a firewall change, a service that stopped, or a timeout value that is too aggressive for the link.
Before changing anything, understand what the error is telling you. Error 1479 is raised on the principal and reads along the lines of "The mirroring connection to <server> has timed out after N seconds." It is a symptom, not a root cause. The mirroring session enters a DISCONNECTED or SUSPENDED state, the mirror database stops receiving log, and the principal keeps accepting transactions (unless you are in high-safety mode with automatic failover, in which case the witness and mirror relationship also matters). Your job is to restore connectivity, then resume the session so the mirror can catch up.
What You'll Need
- Login with sysadmin or db_owner rights on both the principal and mirror SQL Server instances.
- Access to the Windows firewall (or network firewall) on both servers, or to whoever manages it.
- The mirroring endpoint name and port (typically TCP 5022, but confirm on your system).
- SSMS or sqlcmd to run T-SQL on both instances.
- Permission to restart the SQL Server service on the mirror if needed.
- Knowledge of whether you use high-safety (synchronous) or high-performance (asynchronous) mode, and whether a witness is configured.
Step-by-Step
- Confirm the current state. On the principal, run
SELECT DB_NAME(database_id) AS db, mirroring_state_desc, mirroring_role_desc, mirroring_safety_level_desc FROM sys.database_mirroring WHERE mirroring_state IS NOT NULL;and repeat on the mirror. You want to see whether the state is DISCONNECTED, SUSPENDED, or SYNCHRONIZED. A DISCONNECTED state confirms the timeout broke the link. - Check the SQL Server error log on both sides. Look for error 1479 alongside related messages such as 1418 (the mirroring connection could not be established) or 1443. The timestamp tells you when the link dropped and helps you correlate with network changes, service restarts, or patching.
- Test basic network reachability. From the principal, run
Test-NetConnection -ComputerName <mirror> -Port 5022in PowerShell (replace the port with your endpoint port). Do the same in reverse. If the port test fails, the problem is network or firewall, not SQL Server — fix that first. - Check the mirroring endpoint is listening. On each instance run
SELECT name, state_desc, port, type_desc FROM sys.database_mirroring_endpoints;. The state should be STARTED. If it is STOPPED, start it withALTER ENDPOINT <endpoint_name> STATE = STARTED;. - Verify the service account and authentication. The SQL Server service account on each instance must be able to authenticate to the other endpoint. If you use Windows authentication, confirm the service accounts have logins and CONNECT permission on the endpoint. If you use certificates, confirm they have not expired.
- Restart the SQL Server service on the mirror if it appears hung. A hung mirror service is a common cause of a timeout that survives network tests. Restarting the service briefly interrupts databases on that instance, so schedule it appropriately. After restart, the mirroring endpoint comes back up and the principal can reconnect.
- Resume the mirroring session. Once connectivity is confirmed, on the principal run
ALTER DATABASE <database_name> SET PARTNER RESUME;. Then re-checksys.database_mirroringon both sides. The state should move from SUSPENDED to SYNCHRONIZING and then SYNCHRONIZED. If it does not resume, the link is still broken — go back to the network checks. - Review the timeout setting. The default is 10 seconds. On a high-latency link or a busy server, that can be too tight. On the principal run
ALTER DATABASE <database_name> SET PARTNER TIMEOUT 30;(or a value appropriate to your link) and repeat on the mirror. Do not set it very high just to hide a real network problem. - Confirm the mirror is catching up. Check
SELECT mirroring_state_desc, mirroring_safety_level_desc FROM sys.database_mirroring WHERE database_id = DB_ID('<database_name>');and watch the log send queue and redo queue in the mirroring performance counters. A shrinking queue means the mirror is applying log normally again.
Common Mistakes
- Resuming the session before fixing the underlying network or firewall issue — it will just time out again.
- Changing the timeout value to a very large number to mask a genuine connectivity problem, which delays failover and hides the real fault.
- Forgetting that the witness also needs to reach both partners in high-safety mode with automatic failover; a witness that cannot be reached can affect failover behavior.
- Testing the port from the wrong server or with the wrong endpoint port, then concluding the network is fine.
- Restarting the mirror service during a busy period without checking which databases and applications depend on it.
- Assuming error 1479 always means the mirror is down — sometimes the principal's own network stack or firewall is the problem.
Tips
- Keep a note of your endpoint port and timeout setting so you can check them quickly next time.
- If the timeout recurs at the same time each day, look for scheduled backups, index maintenance, or network jobs that saturate the link.
- Use the mirroring performance counters (log send queue, redo queue, transaction delay) to spot a link that is degrading before it times out.
- In asynchronous high-performance mode, a timeout is less disruptive but still indicates a link problem worth fixing.
- Document the service account and authentication method (Windows or certificate) for each endpoint — most recurring timeouts trace back to a credential or certificate change.
Troubleshooting
If the port test fails, check the Windows firewall inbound rule for the mirroring port on both servers and any network firewall between them. If the port test passes but the session will not resume, check the SQL Server error log for 1418 or 1443 — those point to endpoint authentication or endpoint state problems rather than raw connectivity. If the endpoint is STARTED and authentication looks correct but the mirror still will not connect, verify the mirror database is in RESTORING state; a mirror database that has been recovered or brought online cannot accept mirroring. If you use certificates, confirm the certificate on each side is valid, has not expired, and that the logins mapped to the certificates have CONNECT permission on the endpoint. If the session resumes but immediately times out again, lower the load on the link or raise the timeout modestly, and check for packet loss or high latency between the servers. If a witness is configured, confirm it can reach both partners; an unreachable witness can prevent automatic failover even when the principal and mirror can see each other.
Frequently Asked Questions
What does SQL Server error 1479 actually mean?
It means the principal server did not receive a response from the mirror (or witness) within the configured mirroring timeout, so the mirroring session was disconnected. It is a connectivity symptom, not a database corruption error.
Does error 1479 cause data loss?
No. The principal keeps its transaction log, and once the session is resumed the mirror catches up from where it left off. In high-safety mode the principal may stop accepting transactions if it cannot form a quorum, but committed data is not lost.
Should I just increase the timeout to stop the error?
Only after you have ruled out a real network or service problem. Raising the timeout hides the symptom and delays failover; fix the underlying connectivity first, then adjust the timeout if your link genuinely needs it.
Can a firewall change cause error 1479?
Yes. A new firewall rule, a changed port, or a network device blocking the mirroring port will break the connection and produce a timeout. Test the port from both servers after any network change.
Why does the error come back after I resume the session?
Because the root cause was not fixed. Resuming only re-establishes the session; if the network path, endpoint state, or authentication is still broken, the connection will time out again.
Does the witness need to be reachable for mirroring to work?
In high-safety mode with automatic failover, yes — the witness must be able to reach both partners for quorum. Without a reachable witness, automatic failover may not occur, though the principal and mirror can still mirror between themselves.