Service (Instance Restart Issue)

Question Status

Unanswered
Vikas Tanwar asked a question on 21 Apr 2017 1:09 AM

Hi All , I am facing an issue from a long ,

My client have restart the Server 2 times during night as it is on amazon cloud to reduce and then increase the instance size , for costing purpose they reduce the size on Cloud.

For this purpose , they have to restart the Server in Night and again restart early morning.

As , the a no. Job queues maintained, about 50 , so during restart activity , the Job Queues get Stuck .

Job queues are setup to be started from NAS . As server is restarted Job Queues are not Started .

I also have given them a powershell Script to Restart Services to be RAN after 10 to 15 mins after Server Restart.

But Still the Issue is not resolved

And in Event Viewer this is the error  every time

Server instance: UtsavWebService
Tenant ID: default
Session type: WebServiceClient
Session ID: 249364
User: NAVAPP\navadmin
Type: System.Data.SqlClient.SqlException
ClientConnectionId: 3b325cee-98ae-468f-9c6e-6b91a4fbe803
Class: 20
LineNumber: 0
Number: 0
State: 0
Source: .Net SqlClient Data Provider
ErrorCode: -2146232060
Message: The connection is broken and recovery is not possible. The connection is marked by the client driver as unrecoverable. No attempt was made to restore the connection.
StackTrace:
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.SqlConnection.ValidateAndReconnect(Action beforeDisconnect, Int32 timeout)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)
at Microsoft.Dynamics.Nav.Runtime.NavSqlConnection.ExecuteFunction[T](Func`1 function, NavSqlCommand command)
HResult: -2146232060

Server instance: UtsavNasService
Tenant ID: default
Session type: Background
Session ID: 24
User:
Type: System.Data.SqlClient.SqlException
ClientConnectionId: 1fd024b9-6189-4f5c-ba58-a462cd10000f
Class: 11
LineNumber: 0
Number: 0
State: 0
Source: .Net SqlClient Data Provider
ErrorCode: -2146232060
Message: The connection is broken and recovery is not possible. The client driver attempted to recover the connection one or more times and all attempts failed. Increase the value of ConnectRetryCount to increase the number of recovery attempts.
StackTrace:
at System.Data.SqlClient.SqlConnection.<ReconnectAsync>d__113.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Data.SqlClient.AsyncHelper.WaitForCompletion(Task task, Int32 timeout, Action onTimeout, Boolean rethrowExceptions)
at System.Data.SqlClient.SqlInternalConnectionTds.ExecuteTransactionYukon(TransactionRequest transactionRequest, String transactionName, IsolationLevel iso, SqlInternalTransaction internalTransaction, Boolean isDelegateControlRequest)
at System.Data.SqlClient.SqlInternalConnection.BeginSqlTransaction(IsolationLevel iso, String transactionName, Boolean shouldReconnect)
at System.Data.SqlClient.SqlConnection.BeginTransaction(IsolationLevel iso, String transactionName)
at Microsoft.Dynamics.Nav.Runtime.NavSqlConnection.ExecuteFunction[T](Func`1 function, NavSqlCommand command)
HResult: -2146232060
----------------------------------
Type: System.Data.SqlClient.SqlException
ClientConnectionId: de0b0bcc-ddaa-4777-916d-5b0069743d8c
Class: 20
LineNumber: 0
Number: 10054
Server: 192.168.0.6
State: 0
Source: .Net SqlClient Data Provider
ErrorCode: -2146232060
Message: A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)
StackTrace:
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionFactory.<>c__DisplayClass31_0.<TryGetConnection>b__0(Task`1 _)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Data.SqlClient.SqlConnection.<ReconnectAsync>d__113.MoveNext()
HResult: -2146232060
----------------------------------
Type: System.ComponentModel.Win32Exception
NativeErrorCode: 10054
ErrorCode: -2147467259
Message: An existing connection was forcibly closed by the remote host
HResult: -2147467259

Server instance: UtsavNasService
Tenant ID: default
Session type: Background
Session ID: 6
User:
Type: System.Data.SqlClient.SqlException
ClientConnectionId: 98f47aff-85cd-4f53-877c-1dbcb4ee0629
Class: 11
LineNumber: 0
Number: 0
State: 0
Source: .Net SqlClient Data Provider
ErrorCode: -2146232060
Message: The connection is broken and recovery is not possible. The client driver attempted to recover the connection one or more times and all attempts failed. Increase the value of ConnectRetryCount to increase the number of recovery attempts.
StackTrace:
at System.Data.SqlClient.SqlConnection.<ReconnectAsync>d__113.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Data.SqlClient.AsyncHelper.WaitForCompletion(Task task, Int32 timeout, Action onTimeout, Boolean rethrowExceptions)
at System.Data.SqlClient.SqlInternalConnectionTds.ExecuteTransactionYukon(TransactionRequest transactionRequest, String transactionName, IsolationLevel iso, SqlInternalTransaction internalTransaction, Boolean isDelegateControlRequest)
at System.Data.SqlClient.SqlInternalConnection.BeginSqlTransaction(IsolationLevel iso, String transactionName, Boolean shouldReconnect)
at System.Data.SqlClient.SqlConnection.BeginTransaction(IsolationLevel iso, String transactionName)
at Microsoft.Dynamics.Nav.Runtime.NavSqlConnection.ExecuteFunction[T](Func`1 function, NavSqlCommand command)
HResult: -2146232060
----------------------------------
Type: System.Data.SqlClient.SqlException
ClientConnectionId: 73f11b53-14fa-4777-ab1a-94e3837e25ff
Class: 20
LineNumber: 0
Number: 64
Server: 192.168.0.6
State: 0
Source: .Net SqlClient Data Provider
ErrorCode: -2146232060
Message: A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 0 - The specified network name is no longer available.)
StackTrace:
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionFactory.<>c__DisplayClass31_0.<TryGetConnection>b__0(Task`1 _)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Data.SqlClient.SqlConnection.<ReconnectAsync>d__113.MoveNext()
HResult: -2146232060
----------------------------------
Type: System.ComponentModel.Win32Exception
NativeErrorCode: 64
ErrorCode: -2147467259
Message: The specified network name is no longer available
HResult: -2147467259

Reply
Mahesh responded on 21 Apr 2017 1:31 AM

Hi,

Do you mean that your NAV Server Instance keeps on restarting?

Reply
Vikas Tanwar responded on 21 Apr 2017 2:27 AM

Hi Mahesh Thanks , for the reply ,

No , Actually , my NAS Sevice does not updates that results my Job Queues not get Started.

I need to forcefully restart that NAS Service  , then my JOB Queues get Started

My actual concern is Job Queues get Stopped

Reply
Manish Sharma responded on 21 Apr 2017 4:49 AM

Assuming your NAS service is a separate one. Try putting the service startup in automatic(delay) option.

Reply
Vikas Tanwar responded on 10 May 2017 7:03 AM

Hi Manish I put it in Delay Option,

Nowadays , in NAS Service , suppose there are 10 job queues, but many times, one or more Job Queues Stuck with Hearbeat time of earlier and others so the correct Heart beat i.e of current Time , don't now how to solve.

Reply