Sales Order List Crash

Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
edited 2012-04-14 in NAV Three Tier
Hi guys! In these days we faced strange problem.
In the Sales Order List (9305) we've a custom action that launch a custom procedure.
The problem is that, ever and anon, using this action the RTC crashes. What I can't understand is why... because if you reopen the client and launch again this function with the same datas it works...
Note: this procedure have been working for years in 4.0 SP1 db.
I attach the error on my client:
Type: Microsoft.Dynamics.Nav.Client.NavClientClosingException
Message: The connection to the server has been lost. The application will close.
StackTrace:
     at Microsoft.Dynamics.Nav.Client.ExceptionHandler.DoExecute(Func`1 execute)
     at Microsoft.Dynamics.Nav.Client.ExceptionHandler.DoRethrowWithCatchException(Exception exception)
     at Microsoft.Dynamics.Nav.Client.ExceptionHandler.Application_ThreadException(Object sender, ThreadExceptionEventArgs e)
     at System.Windows.Forms.Application.ThreadContext.OnThreadException(Exception t)
     at System.Windows.Forms.Control.WndProcException(Exception e)
     at System.Windows.Forms.Control.ControlNativeWindow.OnThreadException(Exception e)
     at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
     at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
     at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
     at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
     at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
     at System.Windows.Forms.Application.Run(ApplicationContext context)
     at Microsoft.Dynamics.Nav.Client.WinClient.RunCore()
     at Microsoft.Dynamics.Nav.Client.ExceptionHandler.ExecuteAndCatchExceptions(Func`1 execute)
     at Microsoft.Dynamics.Nav.Client.ExceptionHandler.DoExecute(Func`1 execute)
     at Microsoft.Dynamics.Nav.Client.WinClient.Run()
Source: Microsoft.Dynamics.Nav.Client
----------------------------------
Type: Microsoft.Dynamics.Nav.Types.NavConnectionLostException
Message: The connection to the server has been lost. The application will close.
StackTrace:
     at Microsoft.Dynamics.Nav.Client.ExceptionHandler.<>c__DisplayClass2.<DoRethrowWithCatchException>b__0()
     at Microsoft.Dynamics.Nav.Client.ExceptionHandler.ExecuteAndCatchExceptions(Func`1 execute)
Source: Microsoft.Dynamics.Nav.Client
----------------------------------
Type: Microsoft.Dynamics.Nav.Types.NavConnectionLostException
Message: The connection to the server has been lost. The application will close.
StackTrace:
     at Microsoft.Dynamics.Nav.Client.ServerInvocationManager.WaitForServerResponse(IAsyncResult asyncResult, ThreadCallbackContext threadEventContext)
     at Microsoft.Dynamics.Nav.Client.ServerInvocationManager.CallServer[T](CallServerMethod`1 callServerMethod)
     at Microsoft.Dynamics.Nav.Client.ServerInvocationHandler.CallServer[T](CallServerMethod`1 callServerMethod)
     at Microsoft.Dynamics.Nav.Client.ConnectionStateManager.CallServer[T](CallServerMethod`1 callServerMethod)
     at Microsoft.Dynamics.Nav.Client.ServerInvocationHandler.CallServer[T](CallServerMethod`1 callServerMethod)
     at Microsoft.Dynamics.Nav.Client.ServiceConnectionBase.CallServer[T](CallServerMethod`1 callServerMethod)
     at Microsoft.Dynamics.Nav.Client.ServiceConnection.ActionField(NavRecordState& state, NavDataSet recDataSet, String controlTriggerMethodName)
     at Microsoft.Dynamics.Nav.Client.DataBinder.NstDataAccess.ActionMethod(String triggerName)
     at Microsoft.Dynamics.Nav.Client.Actions.InvokePageTriggerAction.InvokeTrigger(LogicalControl logicalControl, UISession uiSession)
     at Microsoft.Dynamics.Nav.Client.Actions.InvokePageTriggerAction.InvokeCore(Boolean async, LogicalControl logicalControl, Object state, UISession uiSession)
     at Microsoft.Dynamics.Framework.UI.Action.InvokeCoreWithErrorHandling(Boolean async, LogicalControl logicalControl, Object state, UISession uiSession)
     at Microsoft.Dynamics.Framework.UI.Action.DoInvoke(LogicalControl logicalControl, UISession uiSession)
     at Microsoft.Dynamics.Framework.UI.ActionControl.Invoke()
     at Microsoft.Dynamics.Framework.UI.Windows.ActionControlAdapterBase.DefaultInvokeAction(LogicalControlAdapter adapter, ActionControl actionControl)
     at Microsoft.Dynamics.Framework.UI.Windows.ActionControlAdapterBase.DefaultInvokeAction(LogicalControlAdapter adapter)
     at Microsoft.Dynamics.Framework.UI.Windows.ActionControlAdapterBase.OnInvoke()
     at Microsoft.Dynamics.Framework.UI.WinForms.ActionPaneActionControlAdapter.<InitializeNativeControl>b__0(Object sender, EventArgs e)
     at Microsoft.Dynamics.Framework.UI.WinForms.Controls.ActionItem.OnButtonClick()
     at Microsoft.Dynamics.Framework.UI.WinForms.Controls.ActionButton.OnMouseUp(MouseEventArgs e)
     at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
     at System.Windows.Forms.Control.WndProc(Message& m)
     at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
     at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
     at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Source: Microsoft.Dynamics.Nav.Client.ServiceConnection
----------------------------------
Type: Microsoft.Dynamics.Nav.Types.NavConnectionLostException
Message: The connection to the server has been lost. The application will close.
StackTrace:
     at Microsoft.Dynamics.Nav.Client.ConnectionStateManager.HandleCommunicationFailure[T](CallServerMethod`1 callServerMethod, Exception e, Int32 messageNumber, String sessionId)
     at Microsoft.Dynamics.Nav.Client.ConnectionStateManager.CallServer[T](CallServerMethod`1 callServerMethod)
     at Microsoft.Dynamics.Nav.Client.ServerInvocationHandler.CallServer[T](CallServerMethod`1 callServerMethod)
     at Microsoft.Dynamics.Nav.Client.ServiceConnectionBase.CallServer[T](CallServerMethod`1 callServerMethod)
     at Microsoft.Dynamics.Nav.Client.ServiceConnectionBase.CallServer(CallServerMethod callServerMethod)
     at Microsoft.Dynamics.Nav.Client.ServiceConnection.EndClientCall(Object result)
     at Microsoft.Dynamics.Nav.Client.ServiceClientCallback.<>c__DisplayClass1c.<CommittedDataFromServer>b__1b()
     at Microsoft.Dynamics.Nav.Client.ServiceClientCallback.<>c__DisplayClass1.<RunClientRequest>b__0()
     at Microsoft.Dynamics.Nav.Client.ServerInvocationManager.WaitForServerResponse(IAsyncResult asyncResult, ThreadCallbackContext threadEventContext)
Source: Microsoft.Dynamics.Nav.Client.ServiceConnection
----------------------------------
Type: System.ServiceModel.FaultException
Action: http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher/fault
Message: The server was unable to process the request due to an internal error.  For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.
StackTrace:
  
  Server stack trace: 
     in System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
     in System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
     in System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
     in System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
     in System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
     in System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
  
  Exception rethrown at [0]: 
     at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
     at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
     at Microsoft.Dynamics.Nav.Types.INavService.EndClientCall(Object value)
     at Microsoft.Dynamics.Nav.Client.ServiceConnection.<>c__DisplayClassa1.<EndClientCall>b__a0()
     at Microsoft.Dynamics.Nav.Client.ServiceConnectionBase.<>c__DisplayClass1.<CallServer>b__0()
     at Microsoft.Dynamics.Nav.Client.ServerCallContext`1.InvokeCall(Object instance)
     at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
     at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
     at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)
  
  Exception rethrown at [1]: 
     at System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase)
     at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData& msgData)
     at System.Threading.WaitCallback.EndInvoke(IAsyncResult result)
     at Microsoft.Dynamics.Nav.Client.ServerInvocationManager.CallServer[T](CallServerMethod`1 callServerMethod)
     at Microsoft.Dynamics.Nav.Client.ServerInvocationHandler.CallServer[T](CallServerMethod`1 callServerMethod)
     at Microsoft.Dynamics.Nav.Client.ConnectionStateManager.CallServer[T](CallServerMethod`1 callServerMethod)
Source: mscorlib

and the 2 errors generated on the server:
1

Service: MicrosoftDynamicsNavServer$NAV24
User: ***
Type: System.ArgumentException
Message: An item with the same key has already been added.
StackTrace:    at Microsoft.Dynamics.Nav.Runtime.NavApplicationMethod.InvokeMethod(Object obj, String methodName, Object[] args)
Source: Microsoft.Dynamics.Nav.Ncl
----------------------------------
Type: System.Reflection.TargetInvocationException
Message: Exception has been thrown by the target of an invocation.
StackTrace:
     at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
     at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
     at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
     at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
     at Microsoft.Dynamics.Nav.Runtime.NavApplicationMethod.InvokeMethod(Object obj, String methodName, Object[] args)
Source: mscorlib
----------------------------------
Type: System.ArgumentException
Message: An item with the same key has already been added.
StackTrace:
     at Microsoft.Dynamics.Nav.Service.NSClientCallback.SendCommittedDataToClient(CommittedDataRequest committedDataRequest)
     at Microsoft.Dynamics.Nav.Service.NSClientCallback.SendCommittedDataToClient(NavDataSet recDataSet, NavRecordState dataSetState)
     at Microsoft.Dynamics.Nav.Service.NsFormDataAccess.GetCommittedData(Object sender, EventArgs e)
     at Microsoft.Dynamics.Nav.Runtime.NavConnection.FireDataCommitted()
     at Microsoft.Dynamics.Nav.Runtime.NavConnection.Commit()
     at Microsoft.Dynamics.Nav.Runtime.ALDatabase.ALCommit()
     at Microsoft.Dynamics.Nav.BusinessApplication.Page9305.Control1101366007_OnAction()
Source: Microsoft.Dynamics.Nav.Service
----------------------------------
Type: System.ArgumentException
Message: An item with the same key has already been added.
StackTrace:
     in System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
     in System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
     in Microsoft.Dynamics.Nav.Client.ServiceClientCallback.<>c__DisplayClassa.<OpenDialog>b__9()
     in Microsoft.Dynamics.Nav.Client.ServiceClientCallback.<>c__DisplayClass1.<RunClientRequest>b__0()
     in Microsoft.Dynamics.Nav.Client.ServerInvocationManager.WaitForServerResponse(IAsyncResult asyncResult, ThreadCallbackContext threadEventContext)
Source: mscorlib


2.
Service: MicrosoftDynamicsNavServer$NAV24
User: ***
Type: System.ArgumentException
Message: An item with the same key has already been added.
StackTrace:
     at Microsoft.Dynamics.Nav.Runtime.NavApplicationMethod.InvokeMethod(Object obj, String methodName, Object[] args)
     at Microsoft.Dynamics.Nav.Service.NSField.ActionField(NavConnection con)
     at Microsoft.Dynamics.Nav.Service.NSField.Action(NavConnection connection)
     at Microsoft.Dynamics.Nav.Service.NSService.<>c__DisplayClass21.<ActionField>b__20(Connection connection)
     at Microsoft.Dynamics.Nav.Service.NSService.ExecuteOperation[T](String operationName, ServiceOperation`1 operation, Connection connection, Boolean revertLanguageChanges, WindowsIdentity impersonationIdentity)
Source: Microsoft.Dynamics.Nav.Ncl
----------------------------------
Type: System.Reflection.TargetInvocationException
Message: Exception has been thrown by the target of an invocation.
StackTrace:
     at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
     at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
     at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
     at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
     at Microsoft.Dynamics.Nav.Runtime.NavApplicationMethod.InvokeMethod(Object obj, String methodName, Object[] args)
Source: mscorlib
----------------------------------
Type: System.ArgumentException
Message: An item with the same key has already been added.
StackTrace:
     at Microsoft.Dynamics.Nav.Service.NSClientCallback.SendCommittedDataToClient(CommittedDataRequest committedDataRequest)
     at Microsoft.Dynamics.Nav.Service.NSClientCallback.SendCommittedDataToClient(NavDataSet recDataSet, NavRecordState dataSetState)
     at Microsoft.Dynamics.Nav.Service.NsFormDataAccess.GetCommittedData(Object sender, EventArgs e)
     at Microsoft.Dynamics.Nav.Runtime.NavConnection.FireDataCommitted()
     at Microsoft.Dynamics.Nav.Runtime.NavConnection.Commit()
     at Microsoft.Dynamics.Nav.Runtime.ALDatabase.ALCommit()
     at Microsoft.Dynamics.Nav.BusinessApplication.Page9305.Control1101366007_OnAction()
Source: Microsoft.Dynamics.Nav.Service
----------------------------------
Type: System.ArgumentException
Message: An item with the same key has already been added.
StackTrace:
     in System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
     in System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
     in Microsoft.Dynamics.Nav.Client.ServiceClientCallback.<>c__DisplayClassa.<OpenDialog>b__9()
     in Microsoft.Dynamics.Nav.Client.ServiceClientCallback.<>c__DisplayClass1.<RunClientRequest>b__0()
     in Microsoft.Dynamics.Nav.Client.ServerInvocationManager.WaitForServerResponse(IAsyncResult asyncResult, ThreadCallbackContext threadEventContext)
Source: mscorlib

What I can't stand is not to replicate the error that apparently happens at random.
Many thx for your help!
~Rik~
It works as expected... More or Less...

Answers

  • XDURXDUR Member Posts: 1
    Hi, did you find a solution for this problem? I'm experiencing the same problem.
  • Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    XDUR wrote:
    Hi, did you find a solution for this problem? I'm experiencing the same problem.
    I'm sorry but, as I wrote before, this error occurred randomly and we haven't find a solution yet.
    ~Rik~
    It works as expected... More or Less...
  • beranberan Member, Microsoft Employee Posts: 80
    First of all thanks for giving a dump of both exception logs - the one from the client and the one from the server. The one from the server is especially interesting, when you see a NavClientClosingException in the client exception log. This means that the connection is lost for 'some' reason, but many times the exception dump from the server has the reason. This does not mean it is a problem in the server but could also be in the client code. But we can see by looking at the exception log from the server. But please still give us the two exception logs for the case the problem is coming from the client.

    In the case of this problem then it should be fixed. We released it in sp1 with build 32775 under KB article 2613306 as hotfix ID 437859. The problem occurs if the talk between the client/server is "too" slow for the client to handle the continuous 'send commited data' to the client. Now with the change the client just wait with the second one until the first one has done the initial setup.

    So please verify that you have installed build 32775 (or newer) for the client and the same build (or newer) for the server. If you still see the crash then don't hesitate to send us a hotfix with the two exception logs.
    Eric Beran
    Software Design Engineer II
    Dynamics NAV Office 365
    Microsoft

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    beran wrote:
    First of all thanks for giving a dump of both exception logs - the one from the client and the one from the server. The one from the server is especially interesting, when you see a NavClientClosingException in the client exception log. This means that the connection is lost for 'some' reason, but many times the exception dump from the server has the reason. This does not mean it is a problem in the server but could also be in the client code. But we can see by looking at the exception log from the server. But please still give us the two exception logs for the case the problem is coming from the client.

    In the case of this problem then it should be fixed. We released it in sp1 with build 32775 under KB article 2613306 as hotfix ID 437859. The problem occurs if the talk between the client/server is "too" slow for the client to handle the continuous 'send commited data' to the client. Now with the change the client just wait with the second one until the first one has done the initial setup.

    So please verify that you have installed build 32775 (or newer) for the client and the same build (or newer) for the server. If you still see the crash then don't hesitate to send us a hotfix with the two exception logs.
    Many thx beran for this information I'll check this and I let you know.
    thx again!
    ~Rik~
    It works as expected... More or Less...
  • Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    beran wrote:
    First of all thanks for giving a dump of both exception logs - the one from the client and the one from the server. The one from the server is especially interesting, when you see a NavClientClosingException in the client exception log. This means that the connection is lost for 'some' reason, but many times the exception dump from the server has the reason. This does not mean it is a problem in the server but could also be in the client code. But we can see by looking at the exception log from the server. But please still give us the two exception logs for the case the problem is coming from the client.

    In the case of this problem then it should be fixed. We released it in sp1 with build 32775 under KB article 2613306 as hotfix ID 437859. The problem occurs if the talk between the client/server is "too" slow for the client to handle the continuous 'send commited data' to the client. Now with the change the client just wait with the second one until the first one has done the initial setup.

    So please verify that you have installed build 32775 (or newer) for the client and the same build (or newer) for the server. If you still see the crash then don't hesitate to send us a hotfix with the two exception logs.
    Hi beran.
    We did a check and the system where this problem occurs has build 32275 installed.
    Next Monday we'll have a go live and in this system we installed the build 32775. We did some tests and the error above didn't occur.
    After the go live the this procedure will be put under stress and we will be able to let you know if the issue is solved with this build change.
    Thanks again for your help.
    ~Rik~
    It works as expected... More or Less...
  • mihail_kolevmihail_kolev Member Posts: 379
    I've seen this error once, when I was migrating 3.7 database to 2009 (no SP). In some table there was a key that include some field called "Date", but in 2009 the ID of this field was changed. So I kept the field to transfer the data from it later. While merging the tables I had a key field1,field2,Date_ (the renamed field). I can't remember the scenario but removing the key was my solution.
    -Mihail- [MCTS]
  • Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    Hi beran.
    We did a check and the system where this problem occurs has build 32275 installed.
    Next Monday we'll have a go live and in this system we installed the build 32775. We did some tests and the error above didn't occur.
    After the go live the this procedure will be put under stress and we will be able to let you know if the issue is solved with this build change.
    Thanks again for your help.
    Hi beran,

    after 2 months we can say that the issue is solved using a newer build as you suggest.
    In this moment we're using build 33137.

    many thanks for the help!
    ~Rik~
    It works as expected... More or Less...
  • beranberan Member, Microsoft Employee Posts: 80
    Good to hear. :-).

    We are working hard in the Nav teams to deliver a high quality of Nav 2013.
    Eric Beran
    Software Design Engineer II
    Dynamics NAV Office 365
    Microsoft

    This posting is provided "AS IS" with no warranties, and confers no rights.
Sign In or Register to comment.