How to fix MS SQL issue under under load with SV Server in Docker

0 Likes

We discovered, that if SV Server is running as Docker container and is connected to MS SQL running on remote machine, it can throw following error under load:

2022-03-12 17:39:57,204 ERROR [Server Statistics Aggregator] HP.SV.ServerCommon.Statistics.ServerStatisticsAggregator TryGetCurrentServerStatistics:96  Failed to read server statistics - Could not open Hibernate Session for transaction
Spring.Transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction
 ---> 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: TCP Provider, error: 25 - Connection string is not valid)
 ---> System.Net.Sockets.SocketException (0x80004005): Success
   at System.Data.SqlClient.SNI.SSRP.GetPortByInstanceName(String browserHostName, String instanceName)
   at System.Data.SqlClient.SNI.SNIProxy.CreateTcpHandle(DataSource details, Int64 timerExpire, Object callbackObject, Boolean parallel)
   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.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.Open()
   at Spring.Data.NHibernate.LocalSessionFactoryObject.DbProviderWrapper.GetConnection()
   at NHibernate.AdoNet.ConnectionManager.GetConnection()
   at Spring.Data.NHibernate.HibernateTransactionManager.DoBegin(Object transaction, ITransactionDefinition definition)

To fix this, you need to specify port in your SV_DB_DATASOURCE environment variable. For example:

SV_DB_DATASOURCE=192.168.153.185,10672\SQLExpress

Labels:

Support Tip
Comment List
Related
Recommended