Wierd error when using request logger

We’re getting an odd error when request logging is turned on, has anyone seen anything like this before?

TargetInvocationException Exception has been thrown by the target of an invocation. 
unknown System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
unknown System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
unknown System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
unknown ServiceStack.Text.TypeSerializer.HasCircularReferences(Object value, Stack`1 parentValues)
unknown ServiceStack.PlatformExtensions.ToSafePartialObjectDictionary(T instance)
unknown ServiceStack.Text.TypeSerializer.SerializeAndFormat(T instance)
unknown ServiceStack.Host.ServiceRunner`1.LogRequest(IRequest req, Object requestDto, Object response)
unknown ServiceStack.Host.ServiceRunner`1+<ExecuteAsync>d__13.MoveNext()

Caused by: InvalidOperationException Timeouts are not supported on this stream.
unknown System.IO.Stream.get_ReadTimeout()

Haven’t seen that before but that should be prevented with this commit which is available from v5.0.3 that’s now available on MyGet.

Looks like this fixed it, thanks!

1 Like

Just to add a bit more here. That seemed to initially fix it, but we then noticed that any large responses would just cause the endpoint to timeout. Not entirely sure right now if these went hand in hand as we had not been testing larger requests (MB in size - like a PDF download). It seems to be due to writing the response DTO as part of the log. We’ve since disabled response DTO logging for now until we can investigate further.