Error: TCP/IP Connection Timed Out Port 4000–5000 Has Failed
Issue
Syncs fail with the following error:
The TCP/IP connection to the host <database-host>, port 4000–5000 has failed. Error: "Connect timed out. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall."
Environment
- Connector: SQL Server
- Connection method: SSH Tunnel, Proxy Agent, VPN Tunnel, or Private Networking
Resolution
To troubleshoot this issue, work with your networking or database team to complete the following steps.
- Check the firewall and network configuration between the SSH host and your SQL Server instance. Ensure the SSH host can reach SQL Server on port
1433and that inbound and outbound traffic isn't blocked. - Test network connectivity from the SSH host:
- To verify DNS resolution, run
nslookup <database-host>. - To confirm port connectivity, run
telnet <database-host> 1433ornc -vz <database-host> 1433.
- To verify DNS resolution, run
- Confirm that your SQL Server instance accepts TCP/IP connections on the configured port.
Cause
This issue occurs when a network routing, firewall, or SQL Server configuration issue prevents the SSH host from reaching SQL Server on port 1433.
We use the 4000–5000 port range shown in the error for tunnel routing. This is not the SQL Server port causing the failure.