Open RIA Services User Support Debugging System.ServiceModel.FaultException in Service Trace Viewer on Server  Viewed 47036 time(s), 6 post(s)., 5/21/2014 5:56:29 AM - by samunro

samunro
samunro 5/21/2014 5:56:29 AM

Hi,

I am investigating some transient 404 responses that we are receiving in our Silverlight client from calls to our Open Ria Services domain service. I have set up tracing on the server and am starting to see some errors come through but have not so far made any headway on identifying the underlying issue. I have included two examples below. Can anyone provide any insight on what the problem might be?

They do not include much detail and do include the following text.

Fault Detail is equal to OpenRiaServices.DomainServices.Hosting.DomainServiceFault

I am wondering if I need to change my configuration to have more details included. I think that at least for the second example below, CustomErrors was set to Off. I have not so far configured includeExceptionDetailInFaults. Do these play a role for the trace logs on the server or are they only required to have exception details propagated to the client? Are they both required in that case?

Many thanks,

Scott

<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
<System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
<EventID>131076</EventID>
<Type>3</Type>
<SubType Name="Error">0</SubType>
<Level>2</Level>
<TimeCreated SystemTime="2014-05-20T17:19:27.8741377Z" />
<Source Name="System.ServiceModel" />
<Correlation ActivityID="{f635b3d7-c581-407a-8e74-de9947acb77f}" />
<Execution ProcessName="w3wp" ProcessID="52160" ThreadID="179" />
<Channel />
<Computer>SWAN</Computer>
</System>
<ApplicationData>
<TraceData>
<DataItem>
<TraceRecord Severity="Error" Channel="Operational" xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord">
<TraceIdentifier>http://msdn.microsoft.com/en-AU/library/System.ServiceModel.Diagnostics.TraceHandledException.aspx</TraceIdentifier>
<Description>Handling an exception. Exception details: System.ServiceModel.FaultException`1[OpenRiaServices.DomainServices.Hosting.DomainServiceFault]:  (Fault Detail is equal to OpenRiaServices.DomainServices.Hosting.DomainServiceFault).</Description>
<AppDomain>/LM/W3SVC/5/ROOT-3-130450765179299791</AppDomain>
<Exception>
<ExceptionType>System.ServiceModel.FaultException`1[[OpenRiaServices.DomainServices.Hosting.DomainServiceFault, OpenRiaServices.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null]], System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
<Message />
<StackTrace>
at OpenRiaServices.DomainServices.Hosting.InvokeOperationBehavior.OperationInvoker.InvokeCore(Object instance, Object[] inputs, Object[]&amp; outputs)
at OpenRiaServices.DomainServices.Hosting.DomainOperationInvoker.Invoke(Object instance, Object[] inputs, Object[]&amp; outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp; rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp; rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&amp; rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
</StackTrace>
<ExceptionString>System.ServiceModel.FaultException`1[OpenRiaServices.DomainServices.Hosting.DomainServiceFault]:  (Fault Detail is equal to OpenRiaServices.DomainServices.Hosting.DomainServiceFault).</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>131076</EventID>
<Type>3</Type>
<SubType Name="Error">0</SubType>
<Level>2</Level>
<TimeCreated SystemTime="2014-05-20T17:32:25.9027649Z" />
<Source Name="System.ServiceModel" />
<Correlation ActivityID="{dbb2ffdf-2f3a-4c13-a232-bfbcb198826d}" />
<Execution ProcessName="w3wp" ProcessID="52160" ThreadID="11" />
<Channel />
<Computer>SWAN</Computer>
</System>
<ApplicationData>
<TraceData>
<DataItem>
<TraceRecord Severity="Error" Channel="Operational" xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord">
<TraceIdentifier>http://msdn.microsoft.com/en-AU/library/System.ServiceModel.Diagnostics.TraceHandledException.aspx</TraceIdentifier>
<Description>Handling an exception. Exception details: System.ServiceModel.FaultException`1[OpenRiaServices.DomainServices.Hosting.DomainServiceFault]: Value cannot be null.
Parameter name: sourceStream (Fault Detail is equal to OpenRiaServices.DomainServices.Hosting.DomainServiceFault).</Description>
<AppDomain>/LM/W3SVC/5/ROOT-4-130450801689674500</AppDomain>
<Exception>
<ExceptionType>System.ServiceModel.FaultException`1[[OpenRiaServices.DomainServices.Hosting.DomainServiceFault, OpenRiaServices.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null]], System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
<Message>Value cannot be null.
Parameter name: sourceStream</Message>
<StackTrace>
at OpenRiaServices.DomainServices.Hosting.InvokeOperationBehavior.OperationInvoker.InvokeCore(Object instance, Object[] inputs, Object[]&amp; outputs)
at OpenRiaServices.DomainServices.Hosting.DomainOperationInvoker.Invoke(Object instance, Object[] inputs, Object[]&amp; outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp; rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp; rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&amp; rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
</StackTrace>
<ExceptionString>System.ServiceModel.FaultException`1[OpenRiaServices.DomainServices.Hosting.DomainServiceFault]: Value cannot be null.
Parameter name: sourceStream (Fault Detail is equal to OpenRiaServices.DomainServices.Hosting.DomainServiceFault).</ExceptionString>
</Exception>
</TraceRecord>
</DataItem>
</TraceData>
</ApplicationData>
</E2ETraceEvent>

This content has not been rated yet. 
150 Reputation 20 Total posts
1
ColinBlair
ColinBlair 5/21/2014 3:19:43 PM

I can't find a variable named sourceStream in the RIA Services code outside of a test method in the OData tests. I can tell you from the stack trace that the error happens when attempting to execute an Invoke method in your Domain Service.

If customerrors is turned on then RIA Services suppresses the actual error when it creates the fault so WCF logging will not see it.

This content has not been rated yet. 
1539 Reputation 130 Total posts
2
samunro
samunro 5/22/2014 1:02:04 PM

Hi Colin,

Thanks for the reply. The only thing I found when I searched our code base was a private variable in Silverlight code which is not involved in an invoke operation. I don't think this would be it.

        Dim webClient As New WebClient()

        Using sourceStream = Await webClient.OpenReadTaskAsync(uri)
            Using fileStream = saveDialog.OpenFile()
                sourceStream.CopyTo(fileStream)
            End Using
        End Using

Do you have any ideas on how I could track this down?

Also, you wrote that having CustomErrors on will mean that error details are not logged. Does this mean that I need to set CustomErrors to Off in Production to get error details logged there? Is RemoteOnly sufficient? Is there some other means of control which is not going to mean that users start seeing the ASP.Net default error pages?

Cheers,

Scott

This content has not been rated yet. 
150 Reputation 20 Total posts
3
ColinBlair
ColinBlair 5/23/2014 12:24:04 PM

I think CustomErrors needs to be turned completely off to allow the errors to be logged by WCF logging, the RIA Services hosting code specifically checks for that. What you can do is override the OnError method of the DomainService and log the error yourself from there.

This content has not been rated yet. 
1539 Reputation 130 Total posts
4
samunro
samunro 5/26/2014 6:45:24 AM

Thanks Colin,

We are already logging from DomainService.OnError but these issues do not seem to get channelled through there. It is sounding like I will need to turn off CustomErrors completely to ensure that we do not lose any error details.

Do you think that it would make sense to control logging with some other configuration so that CustomErrors and RIA Services logging can be turned on and off independently?

Cheers,

Scott

This content has not been rated yet. 
150 Reputation 20 Total posts
5
ColinBlair
ColinBlair 5/27/2014 8:22:01 PM

Logging is handled by WCF, it isn't something that we have any control over. If RIA Services is leaking exception information to WCF for logging, it is also leaking it to the client.

This content has not been rated yet. 
1539 Reputation 130 Total posts
6