Skip to content

Est. 2011ยทMicrosoft Partner ID 7033487ยทDelivery under 3 minยทSupport 7 days a week

Your vault is empty.

Free Fix 10054

Error 10054: Existing Connection Forcibly Closed During a Running Query

11 min read Updated October 5, 2026 SQL Server

Fix it now

An established connection was reset, not refused and not timed out on the way up. Microsoft’s leading documented cause for a 10054 at a SQL client is a failed TLS handshake; after that come idle timeouts in the path, adapter and driver faults, and MTU problems. The pattern tells you which.

Run this on the instance to see the server’s own record of recent connection losses

SELECT record_id, DATEADD(ms, -1 * (ms_ticks - [timestamp]), GETDATE()) AS event_time, CAST(record AS XML) AS record
FROM sys.dm_os_ring_buffers CROSS JOIN sys.dm_os_sys_info
WHERE ring_buffer_type = N'RING_BUFFER_CONNECTIVITY'
ORDER BY record_id DESC;
  1. Establish the pattern first. Resets only on long queries, only after a fixed idle period, only over one link, or scattered at random each point somewhere different.
  2. Check the SQL Server error log for 4014 at the same moment. Its presence means the engine saw the network read fail rather than deciding to close the session itself.
  3. Check the Windows System event log on both machines for adapter resets, link changes and disconnects around the same timestamps.
  4. If the resets began after a TLS or driver change, compare cipher suites on both machines with Get-TlsCipherSuite before touching anything else.
  5. If they follow a period of inactivity, get the idle timeout from whoever owns the firewall, NAT device or load balancer in the path.

Do not restart the SQL Server service to make a network change take effect. The instance holds no copy of a network device’s timeout policy, and a restart kills every session, drops the plan cache and buffer pool, and runs recovery.

If the workload now completes you are done. If not, the next section explains who generates the reset and how the pattern points at them.

Why it happens

10054 is WSAECONNRESET. Microsoft’s Winsock reference defines it as “Connection reset by peer. An existing connection was forcibly closed by the remote host,” and lists the ordinary reasons: the peer application stopped suddenly, the host rebooted, a network interface was disabled, or the remote host used a hard close. That is a description of an established, working connection being cut, which is what makes it a different investigation from a connection that was refused.

When a SQL client reports it, though, the most common cause is narrower than the Winsock definition suggests. Microsoft’s own article on the subject is about TLS: the client and server fail to agree on encryption during pre-login, one side gives up, and the other reports the reset. That is why so many 10054 outbreaks start on the day someone hardened a cipher policy, upgraded a driver, or moved a machine to a newer Windows build.

The companion numbers describe the same moment from different heights. Error 64 is Windows system error ERROR_NETNAME_DELETED, “The specified network name is no longer available.” It is not an SMB-only or named-pipes-only error; the SQL Server TCP Provider reports it routinely when the session dies underneath the client. Error 121 is ERROR_SEM_TIMEOUT, “The semaphore timeout period has expired,” which travels with adapter and driver faults. Error 4014 is SQL Server’s own record, severity 20: a fatal error occurred while reading the input stream from the network, and the session was terminated.

The two sides cannot complete a TLS handshake

You have this one if Resets happen almost immediately after a connection is opened, and started after a hardening change, a Windows update or a driver upgrade.

  1. Check for a shared TLS version first. A client on TLS 1.0 and a server requiring 1.2 have nothing to negotiate.
  2. If the versions match, compare cipher suites: Get-TlsCipherSuite on both machines.
  3. Remove TLS_DHE cipher suites from local policy where Windows Server 2012 and 2016 or later are mixed. Microsoft documents that they handle the Diffie-Hellman key exchange differently.
  4. Check the certificate the instance presents. MD5, SHA224 and SHA512 signatures do not work with TLS 1.2.
  5. Move the client to a current driver: ODBC 17 or 18, OLE DB 18 or 19, .NET Framework 4.6.2 or later, JDBC 9.4 or later.

Microsoft’s guidance is explicit that SQL Server Native Client and SQLOLEDB are not the answer. If an application still carries one, that is the finding.

A device in the path is timing out idle connections

You have this one if Long-running queries die at a consistent interval, always the same number of minutes, and short queries never fail.

  1. Ask the network team for the idle timeout on any firewall, NAT device or load balancer between client and server, and compare it with your interval.
  2. Either raise that timeout for the database port, or make the connection send traffic often enough that it never looks idle.
  3. Re-test the failing query straight after the change. No restart of anything is required.

A repeatable interval is the giveaway. Hardware faults are irregular; a device policy is not. If you do change the KeepAlive value on the TCP/IP protocol in SQL Server Configuration Manager, that one does need a service restart, so schedule it.

Network adapter offload, driver or firmware faults

You have this one if Resets appear at random, affect more than one application, and the System event log shows adapter resets or link events.

  1. Update the adapter driver and firmware on the server, and on the client if the failure is one-sided.
  2. Review offload settings with Get-NetAdapterAdvancedProperty. Change one at a time and test between changes.
  3. On a virtual machine, check the hypervisor’s virtual switch and the host’s physical adapters. The guest is often reporting somebody else’s fault.

MTU or fragmentation across a WAN or VPN

You have this one if Small result sets return fine and large ones fail, and only over one particular link.

  1. Find the usable payload: ping -f -l 1472 <server>, then reduce the size until it succeeds.
  2. Have the network team correct the MTU on the tunnel, or make path MTU discovery work properly.
  3. Do not lower the MTU on the server as a first move. You would change every connection to fix one path.

The client gave up and the reset is the consequence

You have this one if Only one application is affected and its own logs show command timeouts at the same moments.

  1. Compare the application’s command timeout with the real duration of the query it runs.
  2. Tune the query or raise the timeout deliberately, rather than treating the reset as a network fault.
  3. Check pool settings. A pool handing out a connection that a device already killed produces a reset on first use, which looks like a server problem and is not.

Full reference

Matching the pattern to the cause

When it happens Where to look first
Immediately after connecting TLS: no shared protocol, no shared cipher suite, or a weak certificate hash
On long-running queries only Idle timeouts on a firewall, NAT device or load balancer
After a fixed idle period, reproducibly The same, or a connection pool handing out dead sessions
Randomly across all workloads Adapter, driver, firmware or offload settings; read the System event log
Only across a VPN or WAN link MTU or fragmentation in the path
Around a failover An availability group or cluster moved. The reset is expected behaviour
Under peak load on SQL Server 2017 or earlier Login dispatcher pressure. SQL Server 2019 added a dedicated pool for it

What each number is telling you

Number Where it comes from Published meaning
10054 Winsock, reported by the client WSAECONNRESET: an existing connection was forcibly closed by the remote host
64 Windows system error, reported by the client provider ERROR_NETNAME_DELETED: the specified network name is no longer available
121 Windows system error ERROR_SEM_TIMEOUT: the semaphore timeout period has expired
4014 SQL Server error log, severity 20 A fatal error occurred while reading the input stream from the network. The session will be terminated

Error 64 in particular is worth reading carefully, because it is frequently miscast as an SMB or named pipes problem. It is a general Windows network-name error and the TCP Provider raises it as readily as anything else. A reader on TCP/IP who assumes 64 is irrelevant to them will go looking for a named pipes configuration that is not in use.

What not to do

  • Do not restart the SQL Server service to make a firewall, NAT or load balancer change take effect. There is nothing cached on the instance for the restart to clear, and the outage is real: every session killed, plan cache and buffer pool dropped, and recovery run on every active database.
  • Do not add retry logic and stop there. Retries let a batch job survive and tell you nothing. Add them so the workload copes, then still find the cause.
  • Do not edit HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters keep-alive values as a first move. They change behaviour for every connection the machine makes and need a reboot. Prefer the per-instance KeepAlive setting on the TCP/IP protocol in SQL Server Configuration Manager.
  • Do not re-enable TLS 1.0 or 1.1 permanently to make the symptom stop. If you must, put a date on it and fix the driver.

Evidence to collect before you change anything

  1. The connectivity ring buffer output above, which is the server’s own record of recent losses and carries the client address.
  2. The SQL Server error log filtered for 4014: EXEC sys.sp_readerrorlog 0, 1, N'4014';
  3. The Windows System event log on both machines for the same minute.
  4. The exact interval between connection start and reset, for at least three occurrences. If it is constant to the second, you are looking at a device policy.
  5. SELECT encrypt_option FROM sys.dm_exec_connections WHERE session_id = @@SPID; from a connection that does survive, so you know what a working negotiation looks like here.

Where SQL Server is genuinely the one closing the session

It happens, and it leaves evidence. A KILL, a resource governor limit, a shutdown, a failover and an availability group role change all write something. A bare 10054 with a 4014 in the error log and nothing else is the engine reporting that the read failed underneath it, which points outward at the path rather than inward at the instance.

Every code this article covers

Code What it points at Source
10054 WSAECONNRESET: an existing connection was forcibly closed by the remote host. For SQL clients, Microsoft documents a failed TLS handshake as the leading cause Microsoft Learn
64 Windows system error ERROR_NETNAME_DELETED: the specified network name is no longer available. Reported by the TCP Provider as well as on named pipes and SMB paths Microsoft Learn
121 Windows system error ERROR_SEM_TIMEOUT: the semaphore timeout period has expired. Commonly seen with adapter, driver and offload faults Microsoft Learn
4014 A fatal error occurred while reading the input stream from the network. The session will be terminated. Severity 20 Microsoft Learn

Confirm the fix worked

  1. Re-run the workload that was failing, in full, and confirm it completes without a reset.
  2. Re-read the error log and confirm no new 4014 entries appear for that client.
  3. Query the connectivity ring buffer again and confirm no fresh records have been written.
  4. Leave a connection idle for longer than the interval you identified, then run a query on it and confirm it still works.
  5. If the cause was TLS, confirm encrypt_option on a surviving connection is what you expected rather than what you assumed.

Questions people ask about this

Is SQL Server closing the connection deliberately?

Rarely, and when it does it records why. A bare 10054 with a 4014 in the error log means the network read failed underneath the engine, which points at the path rather than at the instance.

Do I have to restart SQL Server after changing a firewall timeout?

No, and you should not. The instance has no cached copy of a network device’s policy. Re-test the failing query directly. The one change that does need a restart is the KeepAlive value on the TCP/IP protocol in SQL Server Configuration Manager, so schedule that in a maintenance window.

Would retry logic fix this?

It will hide it, which is worth something for a batch job and nothing for a diagnosis. Add retries with backoff so the workload survives, then still find the cause. A path that resets connections will do worse things later.

Is this a licensing or edition problem?

No. Network behaviour is identical across editions and everything here lives in drivers, devices and configuration you already own.

Why does it only happen to one application?

Usually because only that application holds connections open long enough, or runs queries long enough, to meet an idle timeout in the path. It can also be a pool handing back connections that were killed while sitting idle.

Related error codes

Was this article helpful?

Your feedback helps us improve our documentation.

Related articles

Free Fix Error 208: Invalid Object Name – Schema, Database Context and Collation Free Fix Error 14274: Jobs Break After a Server Rename or an MSX Move License Error Error 3967: Insufficient Space in tempdb to Hold Row Versions Free Fix Error 8152: String or Binary Data Would Be Truncated – Find the Column
โ† Back to Knowledge Base