One of the more visible changes we made in connectivity space for SQL Server 2005 was enhancing error messages reported to the user in case of connection failures. I have seen several cases over the last several months, and in this post I would like to list some of them with the root cause that caused them. The cause may not be the only one triggering a particular error message, and there may be other error messages of interest.
This is a semi-random selection from real cases I investigated. Likely I will post another batch some time in the future, and I would be happy to see replies with additional errors, particularly if the root cause is unclear.
The examples are from various client stacks – ODBC or OLEDB from SQL Native Client or from managed SqlClient.
The exact formatting of the messages will depend on the application you use. Most of the examples below used OSQL, SQLCMD, or SQL Server Management Studio.
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.) (Microsoft SQL Server, Error: 10061)
(a) default instance:
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)
(b) named instance:
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Shared Memory Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)
[SQL Native Client]Unable to complete login process due to delay in opening server connection
A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - The specified network name is no longer available.)
Possibly:
A transport-level error has occurred when sending the request to the server. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)
[SQL Native Client]Shared Memory Provider: Timeout error [258].[SQL Native Client]Login timeout expired[SQL Native Client]Unable to complete login process due to delay in prelogin response
[SQL Native Client]Shared Memory Provider: Could not open a connection to SQL Server [121].[SQL Native Client]Login timeout expired[SQL Native Client]An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.
osql -E -S "<serverName> ,1433"Login failed for user ''. The user is not associated with a trusted SQL Server connection.
The server ERRORLOG/EventLog shows something similar to:
2005-08-11 12:46:04.29 Logon Error: 17806, Severity: 20, State: 2.2005-08-11 12:46:04.29 Logon SSPI handshake failed with error code 0x8009030c while establishing a connection with integrated security; the connection has been closed. [CLIENT: <IP address>]2005-08-11 12:46:04.29 Logon Error: 18452, Severity: 14, State: 1.2005-08-11 12:46:04.29 Logon Login failed for user ''. The user is not associated with a trusted SQL Server connection. [CLIENT: <IP address>]
HResult 0x274C, Level 16, State 1TCP Provider: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
Error: Microsoft SQL Native Client : An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections..Error: Microsoft SQL Native Client : Login timeout expired.
HResult 0x274D, Level 16, State 1TCP Provider: No connection could be made because the target machine actively refused it.
Peter Gvozdjak, SQL Server Protocols
Disclaimer: This posting is provided "AS IS" with no warranties, and confers no rights