Forum / Password Vault Manager - Bug Report

System.Data.SqlClient.SqlException (0x80131904)

  • Create an Issue
  • Cancel

Good Day,
When trying to connect to our SQL Database we get the following error:
System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
When we are local we don't have any issue, but when remote we cannot connect.
How can we troubleshoot this error? Is there a way to have the détails on how PVM tries to connect to the SQL Server.
Thanks


Helder


Here's the full trace:
LoadConnections [Microsoft SQL Server/SQL Azure : CCSO_Connexions]...
OfflineManager.GetDataSourceSettings : 1 ms
OfflineManager.LoadConnections...
Offline Security Info
>>>>>>>>>>>>>>>>>>>>>
> CanAdd: True
> CanAddCredentials: True
> CanAddDataEntries: True
> CanDelete: True
> CanDeleteCredentials: True
> CanDeleteDataEntries: True
> CanEdit: True
> CanEditCredentials: True
> CanEditDataEntries: True
> GroupInfos:
> be8a66e2-11b7-4886-8d47-889685cfc001
> e45c604d-4c60-4671-9232-74df456c82b4
> 4897892f-7387-42a3-a2b2-b14260ba4280
> cd5adf62-6afe-43a8-98df-b7593d508759
> 4209f867-11b2-4173-b4d7-bda07d6504da
> 4e6d79a8-6de6-422f-9470-b5e7914bbfc7
> 6fefe415-a94f-4626-a7d8-d37f6e4565a4
> 4b097bee-b8c6-4af3-bf2d-2f5604c2ed1e
> 3abcdec0-d196-4238-b5b1-980f8c1276e4
> 2f5bd3bc-0b4c-419d-988d-dabf6b9a8ba3
> IsAdministrator: False
> OfflineHash:
> OfflineUser:
> SecurityValues:
> UserInfoID: f6591350-342a-44a6-ab63-07b27b925191
> UserOverrideString:
>>>>>>>>>>>>>>>>>>>>>
LoadConnectionsFromOfflineFile...
DeserializeData : 0 ms
ReadFromOffline : 0 ms
LoadConnectionsFromOfflineFile : 3 ms
Preloaded: 0
Offline cache version: 0x0000000000000000
OfflineManager.LoadConnections : 16 ms
Offline Mode : ReadOnly
Caching Type : IntelligentCaching
Current cache version: 0x0000000000000000
LoadConnectionsFromDataSource...
LoadDataSourceSettingsFromDataSource...
IsDataSourceOnline...
IsDataSourceOnline : 0 ms
Silent: System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
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.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover)
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 newSecurePassword, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
at System.Data.SqlClient.SqlConnection.Open()
at Devolutions.RemoteDesktopManager.Business.DataSources.SQLServerConnectionDataSource.cb237041e20b5e69dd4663ff2ed975633(String c18973cea236a9feff75c32ca7d1697d5, String ceb81d1ee93f91e0bc57f34876c263863, String& ce1d94e27ad6e76e9e5fb7089d71c2bfa)
ClientConnectionId:00000000-0000-0000-0000-000000000000
Error Number:-1,State:0,Class:20
GetDataSourceSettings : 46113 ms
LoadDataSourceSettingsFromDataSource : 46118 ms
LoadConnectionsFromDataSource : 46121 ms
LoadConnections [Microsoft SQL Server/SQL Azure : CCSO_Connexions] : 46153 ms
TreeView.LoadConnectionList...
Tree view is loading 0 connections
BeginUpdate...
LoadConnectionList...
LoadConnectionList : 0 ms
ApplyGroupCustomImages : 0 ms
LoadConnectionInTreeNode : 0 ms
PreCreateGroups : 0 ms
BeginUpdate : 13 ms
TreeView.LoadConnectionList : 20 ms
LoadConnectionList...
LoadConnectionList : 0 ms

Clock5 yrs

Hello,
This is clearly a SQL Server configuration issue. Could you make sure that SQL Server is accessible from all the machine?

https://technet.microsoft.com/en-us/library/ms165718(v=sql.105).aspx

David Hervieux

signaturesignature

Clock5 yrs

Hello,

If you look at our troubleshooting topic for SQL Server http://help.remotedesktopmanager.com/troubleshooting_sqlserver.htm
you will see a section titled "Universal Data Link (.udl) file"

This will prove that the SQL Instance is indeed reachable from your workstation. That doesnt necessarily mean that RDM/PVM has access though, we have seen a lot of issues where the Firewall was blocking our applications. If the UDL test is successful, you could turn off the firewall temporarily just to prove if its a factor or not.

Best regards,



Maurice Côté

signaturesignature

Clock5 yrs

Thanks for troubleshooting links.

Like I said, when Im local on the network PVM works great.
But when remote using a VPN to the office, i get that error.

We have port 1433 open in the firewall. Do we need anything else?
Sadly we cannot ask to turn off the firewall since its the Corporative Firewall. We can onbly request
to have ports open and redirected to specific servers/apps.

I still be trying the UDL test and Ill get back with an udpate

Thanks

Clock5 yrs

ah, I didnt get that when you mentioned "Local"

For VPNs, if the administrator of the remote device has not enable split-tunneling, connecting to the VPN may direct ALL network traffic through the VPN, thereby making the SQL Server unreachable from that point on.

If you do use a VPN entry that is in your data source to launch that vpn, you will notice two settings in the advanced tab:

Go offline on connection
Go online on disconnect

These will switch the DATASOURCE to the offline mode automatically when you launch the vpn, obviously you must have enable the Offline mode on your data source for this to work.

Best regards,



Maurice Côté

signaturesignature

Clock5 yrs

hello

ping is one type of IP communication, SQL Server connections are another

does the UDL test work from home?



Maurice Côté

signaturesignature

Clock5 yrs

I created the file on the server. But I don't understand how I reach that file using PVM.

Ill review the instructions later.

thanks

Clock5 yrs

After setting the UDL on both my laptop and on the server... I was able to test.

On server it self... UDL works A1.

On my laptop I was unable to connect to Server.

So If I correctly understood, this points to either a network issue or firewall port configuration.

Any recommended setup for the firewall port other than 1433.

Clock5 yrs