Closed amea20 closed 1 year ago
I have tried a different approach to publishing by accessing the container and running the Publish-NAVApp command, which returns the following error message:
Publish-NAVApp : An internal WebSocket error occurred. Please see the innerException, if present, for more details.
At line:1 char:1
+ Publish-NAVApp -ServerInstance BC -Path '.\Company_App_ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (0:Int32) [Publish-NAVApp], CommunicationException
+ FullyQualifiedErrorId : MicrosoftDynamicsNavServer$BC/nav-systemapplication,Microsoft.Dynamics.Nav.Apps.Manageme
nt.Cmdlets.PublishNavApp
Publish-NAVApp : The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for
communication because it is in the Faulted state.
At line:1 char:1
+ Publish-NAVApp -ServerInstance BC -Path '.\Company_App_ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Publish-NAVApp], CommunicationObjectFaultedException
+ FullyQualifiedErrorId : MicrosoftDynamicsNavServer$BC/nav-systemapplication,Microsoft.Dynamics.Nav.Apps.Manageme
nt.Cmdlets.PublishNavApp
Here are 2 errors reported in the event viewer:
Type: System.ServiceModel.CommunicationException
Message: An internal WebSocket error occurred. Please see the innerException, if present, for more details.
StackTrace:
Server stack trace:
at System.ServiceModel.Channels.WebSocketTransportDuplexSessionChannel.ThrowOnPendingException(Exception& pendingException)
at System.ServiceModel.Channels.WebSocketTransportDuplexSessionChannel.WebSocketMessageSource.Receive(TimeSpan timeout)
at System.ServiceModel.Channels.SynchronizedMessageSource.Receive(TimeSpan timeout)
at System.ServiceModel.Channels.TransportDuplexSessionChannel.Receive(TimeSpan timeout)
at System.ServiceModel.Channels.TransportDuplexSessionChannel.TryReceive(TimeSpan timeout, Message& message)
at System.ServiceModel.Dispatcher.DuplexChannelBinder.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at Microsoft.Dynamics.Nav.Management.NavCommand.WriteError(Exception exception, ErrorCategory category, Object target, Boolean rethrow)
at Microsoft.Dynamics.Nav.Management.NavCommand.WriteError(Exception exception)
at Microsoft.Dynamics.Nav.Apps.Management.Cmdlets.PublishNavApp.PublishToService()
at Microsoft.Dynamics.Nav.Apps.Management.Cmdlets.PublishNavApp.InternalProcessRecord()
at Microsoft.Dynamics.Nav.Management.NavCommand.ProcessRecord()
Source: Microsoft.Dynamics.Nav.Management
HResult: -2146233087
StackTrace:
Server stack trace:
at System.ServiceModel.Channels.WebSocketTransportDuplexSessionChannel.ThrowOnPendingException(Exception& pendingException)
at System.ServiceModel.Channels.WebSocketTransportDuplexSessionChannel.WebSocketMessageSource.Receive(TimeSpan timeout)
at System.ServiceModel.Channels.SynchronizedMessageSource.Receive(TimeSpan timeout)
at System.ServiceModel.Channels.TransportDuplexSessionChannel.Receive(TimeSpan timeout)
at System.ServiceModel.Channels.TransportDuplexSessionChannel.TryReceive(TimeSpan timeout, Message& message)
at System.ServiceModel.Dispatcher.DuplexChannelBinder.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at Microsoft.Dynamics.Nav.Management.NavCommand.WriteError(Exception exception, ErrorCategory category, Object target, Boolean rethrow)
at Microsoft.Dynamics.Nav.Management.NavCommand.WriteError(Exception exception)
at Microsoft.Dynamics.Nav.Apps.Management.Cmdlets.PublishNavApp.PublishToService()
at Microsoft.Dynamics.Nav.Apps.Management.Cmdlets.PublishNavApp.InternalProcessRecord()
at Microsoft.Dynamics.Nav.Management.NavCommand.ProcessRecord()
----------------------------------
Type: System.Net.WebSockets.WebSocketException
ErrorCode: 0
WebSocketErrorCode: Success
NativeErrorCode: 0
Message: An internal WebSocket error occurred. Please see the innerException, if present, for more details.
StackTrace:
at System.Net.WebSockets.WebSocketBase.ThrowIfConvertibleException(String methodName, Exception exception, CancellationToken cancellationToken, Boolean aborted)
at System.Net.WebSockets.WebSocketBase.<ReceiveAsyncCore>d__45.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.ServiceModel.Channels.WebSocketTransportDuplexSessionChannel.WebSocketMessageSource.<ReadBufferedMessageAsync>d__34.MoveNext()
Source: System
HResult: -2147467259
StackTrace:
at System.Net.WebSockets.WebSocketBase.ThrowIfConvertibleException(String methodName, Exception exception, CancellationToken cancellationToken, Boolean aborted)
at System.Net.WebSockets.WebSocketBase.<ReceiveAsyncCore>d__45.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.ServiceModel.Channels.WebSocketTransportDuplexSessionChannel.WebSocketMessageSource.<ReadBufferedMessageAsync>d__34.MoveNext()
----------------------------------
Type: System.Net.Sockets.SocketException
ErrorCode: 10054
Message: An existing connection was forcibly closed by the remote host
SocketErrorCode: ConnectionReset
NativeErrorCode: 10054
StackTrace:
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Net.WebSockets.WebSocketConnectionStream.<ReadAsync>d__21.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Net.WebSockets.WebSocketBase.WebSocketOperation.<Process>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Net.WebSockets.WebSocketBase.<ReceiveAsyncCore>d__45.MoveNext()
Source: mscorlib
HResult: -2147467259
StackTrace:
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Net.WebSockets.WebSocketConnectionStream.<ReadAsync>d__21.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Net.WebSockets.WebSocketBase.WebSocketOperation.<Process>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Net.WebSockets.WebSocketBase.<ReceiveAsyncCore>d__45.MoveNext()
Type: System.ServiceModel.CommunicationObjectFaultedException
Message: The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state.
StackTrace:
Server stack trace:
at System.ServiceModel.Channels.CommunicationObject.ThrowIfDisposedOrNotOpen()
at System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at 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.BusinessCentral.AdminApi.IAdminService.CloseAdminConnection()
at Microsoft.Dynamics.Nav.Management.ServerInstanceConnection.DoCloseAdminConnection(IAdminService adminService)
at Microsoft.Dynamics.Nav.Management.ServerInstanceConnection.CloseAdminConnection()
at Microsoft.Dynamics.Nav.Management.ServerInstanceConnection.InternalEndProcessing()
at Microsoft.Dynamics.Nav.Apps.Management.Cmdlets.PublishNavApp.InternalEndProcessing()
at Microsoft.Dynamics.Nav.Management.NavCommand.EndProcessing()
Source: mscorlib
HResult: -2146233087
StackTrace:
Server stack trace:
at System.ServiceModel.Channels.CommunicationObject.ThrowIfDisposedOrNotOpen()
at System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at 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.BusinessCentral.AdminApi.IAdminService.CloseAdminConnection()
at Microsoft.Dynamics.Nav.Management.ServerInstanceConnection.DoCloseAdminConnection(IAdminService adminService)
at Microsoft.Dynamics.Nav.Management.ServerInstanceConnection.CloseAdminConnection()
at Microsoft.Dynamics.Nav.Management.ServerInstanceConnection.InternalEndProcessing()
at Microsoft.Dynamics.Nav.Apps.Management.Cmdlets.PublishNavApp.InternalEndProcessing()
at Microsoft.Dynamics.Nav.Management.NavCommand.EndProcessing()
Could you try this with HyperV isolation?
It errors with the same Powershell error messages and event log messages.
Not sure if there's a timeout somewhere that can be configured to resolved this, because testing with a small app works without issues.
In our case we´ve just found a workaround to solve this problem, it was related with one particular codeunit that has a case statement with 4000 expressions. I remembered that a couple of months ago the compiler of the container downloaded as major version gave us an stack overflow when compiling because of this codeunit, in the current major version the error is not at compilation time but at publish time, in this case splitting the case statement in four smaller case statements has solved our problem. Try to find if a particlar part of your code is provoking this error.
Sadly, there were no compilation errors in NextMajor for the past few months, making it difficult to determine what changes are needed.
@amea20 - could you email me a copy of your .app file, and a small script which creates a container and publishes the .app file to provoke this error - then i will try and troubleshoot.
Thanks Freddy. Email has been sent to you including a script and the app file.
Hi there Freddy,
Please provide an update concerning this matter.
I think this problem was resolved in the public preview, did you try that?
Thanks Freddy. I'm running it now with 4.0.15-preview921.
Sadly, it still returned the same errors as above.
Hi Freddy,
Please provide an update concerning this matter.
Kind regards, Ahmed
Hello,
Closing this ticket as Microsoft are looking into this in a different support platform.
Thank you for your time.
Describe the issue When creating a nextminor or nextmajor container (Regardless of the country), publishing our app fails due to an internal websocket error.
Scripts used to create container and cause the issue
Full output of scripts
Additional context