HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

0x80131904 - An existing connection was forcibly closed by the remote host

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
theconnectionremoteclosedwashostexisting0x80131904forcibly

Problem

Using the Microsoft.Net v4.0 SqlClient connectivity built-in to Microsoft.Net via the System.Data.SqlClient assembly, a particular machine cannot connect to a particular set of servers. When connections are attempted, the following error is thrown:

System.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - An existing connection was forcibly closed by the remote host.) ---> System.ComponentModel.Win32Exception (0x80004005): An existing connection was forcibly closed by the remote host
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParserStateObject.SNIWritePacket(SNIHandle handle, SNIPacket packet, UInt32& sniError, Boolean canAccumulate, Boolean callerHasConnectionLock)
at System.Data.SqlClient.TdsParserStateObject.WriteSni(Boolean canAccumulate)
at System.Data.SqlClient.TdsParserStateObject.WritePacket(Byte flushMode, Boolean canAccumulate)
at System.Data.SqlClient.TdsParser.TdsLogin(SqlLogin rec)
at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)
at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)
at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString

Solution

Installing Microsoft .Net Framework version 4.6.2 resolves this issue in our environment, and appears to be related to the issue presented in this Microsoft Docs migration guide for .Net Framework 4.6.

All affected machines have .Net Framework Version 4.5 or 4.5.1, and have the VMware vSockets DGRAM and vSockets STREAM Base Service Providers through the vsocklib.dll that advertise non-IFS compliance.

Why this issue only appears when attempting connections to certain SQL Server 2016 instances remains an open question.

Context

StackExchange Database Administrators Q#219667, answer score: 2

Revisions (0)

No revisions yet.