none
ProtocolException being thrown at the head node

    Question

  • I have a service on my head node with an OperationContract that throws an exception. Whenever it does so, in the service log I see "Handling an exception", with the details of the fault that was passed back to the client. This is as expected.

    However, for each one of these messages in the service log I also see one more error and three warnings:

     

    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">

    <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">

    <EventID>131075</EventID>

    <Type>3</Type>

    <SubType Name="Error">0</SubType>

    <Level>2</Level>

    <TimeCreated SystemTime="2011-08-25T19:39:28.0126835Z" />

    <Source Name="System.ServiceModel" />

    <Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" />

    <Execution ProcessName="HpcServiceHost" ProcessID="3616" ThreadID="6" />

    <Channel />

    <Computer>hpc</Computer>

    </System>

    <ApplicationData>

    <TraceData>

    <DataItem>

    <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Error">

    <TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.Diagnostics.ThrowingException.aspx</TraceIdentifier>

    <Description>Throwing an exception.</Description>

    <AppDomain>ServiceDomain</AppDomain>

    <Exception>

    <ExceptionType>System.ServiceModel.ProtocolException, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>

    <Message>The channel received an unexpected input message with Action 'http://tempuri.org/IHpcService/DoTask' while closing. You should only close your channel when you are not expecting any more input messages.</Message>

    <StackTrace>

    at System.ServiceModel.Channels.FramingDuplexSessionChannel.OnClose(TimeSpan timeout)

    at System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan timeout)

    at System.ServiceModel.Channels.ServiceChannel.OnClose(TimeSpan timeout)

    at System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan timeout)

    at System.ServiceModel.Dispatcher.MessageRpc.CloseChannel()

    at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessageCleanup(MessageRpc&amp; rpc)

    at System.ServiceModel.Dispatcher.MessageRpc.ProcessError(Exception e)

    at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)

    at System.ServiceModel.Dispatcher.ChannelHandler.DispatchAndReleasePump(RequestContext request, Boolean cleanThread, OperationContext currentOperationContext)

    at System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest(RequestContext request, OperationContext currentOperationContext)

    at System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(IAsyncResult result)

    at System.ServiceModel.Diagnostics.Utility.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)

    at System.ServiceModel.AsyncResult.Complete(Boolean completedSynchronously)

    at System.ServiceModel.Channels.FramingDuplexSessionChannel.TryReceiveAsyncResult.OnReceive(IAsyncResult result)

    at System.ServiceModel.Diagnostics.Utility.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)

    at System.ServiceModel.AsyncResult.Complete(Boolean completedSynchronously)

    at System.ServiceModel.Channels.SynchronizedMessageSource.SynchronizedAsyncResult`1.CompleteWithUnlock(Boolean synchronous, Exception exception)

    at System.ServiceModel.Channels.SynchronizedMessageSource.ReceiveAsyncResult.OnReceiveComplete(Object state)

    at System.ServiceModel.Channels.SessionConnectionReader.OnAsyncReadComplete(Object state)

    at System.ServiceModel.Channels.StreamConnection.OnRead(IAsyncResult result)

    at System.ServiceModel.Diagnostics.Utility.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)

    at System.ServiceModel.AsyncResult.Complete(Boolean completedSynchronously)

    at System.ServiceModel.Channels.ConnectionStream.ReadAsyncResult.OnAsyncReadComplete(Object state)

    at System.ServiceModel.Channels.SocketConnection.FinishRead()

    at System.ServiceModel.Channels.SocketConnection.AsyncReadCallback(Boolean haveResult, Int32 error, Int32 bytesRead)

    at System.ServiceModel.Diagnostics.Utility.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)

    at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)

    </StackTrace>

    <ExceptionString>System.ServiceModel.ProtocolException: The channel received an unexpected input message with Action 'http://tempuri.org/IHpcService/DoTask' while closing. You should only close your channel when you are not expecting any more input messages.</ExceptionString>

    </Exception>

    </TraceRecord>

    </DataItem>

    </TraceData>

    </ApplicationData>

    </E2ETraceEvent>

     

    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">

    <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">

    <EventID>524292</EventID>

    <Type>3</Type>

    <SubType Name="Warning">0</SubType>

    <Level>4</Level>

    <TimeCreated SystemTime="2011-08-25T19:39:28.0439335Z" />

    <Source Name="System.ServiceModel" />

    <Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" />

    <Execution ProcessName="HpcServiceHost" ProcessID="3616" ThreadID="6" />

    <Channel />

    <Computer>hpc</Computer>

    </System>

    <ApplicationData>

    <TraceData>

    <DataItem>

    <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Warning">

    <TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.CommunicationObjectCloseFailed.aspx</TraceIdentifier>

    <Description>Failed to close System.ServiceModel.Channels.ServerSessionPreambleConnectionReader+ServerFramingDuplexSessionChannel</Description>

    <AppDomain>ServiceDomain</AppDomain>

    <Source>System.ServiceModel.Channels.ServerSessionPreambleConnectionReader+ServerFramingDuplexSessionChannel/34678979</Source>

    </TraceRecord>

    </DataItem>

    </TraceData>

    </ApplicationData>

    </E2ETraceEvent>

     

    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">

    <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">

    <EventID>262170</EventID>

    <Type>3</Type>

    <SubType Name="Warning">0</SubType>

    <Level>4</Level>

    <TimeCreated SystemTime="2011-08-25T19:39:28.0439335Z" />

    <Source Name="System.ServiceModel" />

    <Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" />

    <Execution ProcessName="HpcServiceHost" ProcessID="3616" ThreadID="6" />

    <Channel />

    <Computer>hpc</Computer>

    </System>

    <ApplicationData>

    <TraceData>

    <DataItem>

    <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Warning">

    <TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.Channels.SocketConnectionAbort.aspx</TraceIdentifier>

    <Description>SocketConnection aborted</Description>

    <AppDomain>ServiceDomain</AppDomain>

    <Source>System.ServiceModel.Channels.SocketConnection/66166301</Source>

    </TraceRecord>

    </DataItem>

    </TraceData>

    </ApplicationData>

    </E2ETraceEvent>

     

    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">

    <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">

    <EventID>524292</EventID>

    <Type>3</Type>

    <SubType Name="Warning">0</SubType>

    <Level>4</Level>

    <TimeCreated SystemTime="2011-08-25T19:39:28.0439335Z" />

    <Source Name="System.ServiceModel" />

    <Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" />

    <Execution ProcessName="HpcServiceHost" ProcessID="3616" ThreadID="6" />

    <Channel />

    <Computer>hpc</Computer>

    </System>

    <ApplicationData>

    <TraceData>

    <DataItem>

    <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Warning">

    <TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.CommunicationObjectCloseFailed.aspx</TraceIdentifier>

    <Description>Failed to close System.ServiceModel.Channels.ServiceChannel</Description>

    <AppDomain>ServiceDomain</AppDomain>

    <Source>System.ServiceModel.Channels.ServiceChannel/39774547</Source>

    </TraceRecord>

    </DataItem>

    </TraceData>

    </ApplicationData>

    </E2ETraceEvent>

     

    Why am I getting these? If I run the EchoService sample and invoke EchoFault("argumentexception") I don't get ProtocolExceptions. The pattern I'm using in my service is identical to that used in the EchoService sample.

    When I look at the service definition for IEchoService, the only difference I can see is that EchoFault has FaultContractAttribute and ServiceKnownTypeAttribute applied. Thinking that maybe the absence of these attributes on my contract was somehow causing the channel to get faulted prematurely, I added them to my operation. However, when I update my service reference in the client, these attributes are not generated in the proxy.

    What am I missing?

    Thursday, August 25, 2011 7:50 PM