简体   繁体   English

WCF “预计会有更多数据,但已达到 EOF。” 客户端异常,但请求在服务器端命中

[英]WCF "More data was expected, but EOF was reached." exception at client side, but the request hit in server side

I am seeing the logs which has the below exception at client side while calling WCF service (NetTcpBinding) in service side.在服务端调用 WCF 服务(NetTcpBinding)时,我看到在客户端出现以下异常的日志。 But the crusial part is even the client facing the exception in their application but the request was successfully hit the WCF service.但关键部分甚至是客户端在其应用程序中面临异常,但请求已成功命中 WCF 服务。

Message: More data was expected, but EOF was reached.消息:预计会有更多数据,但已达到 EOF。

Message: Error while reading message framing format at position 1 of stream (state: Start) Stack Trace:消息:在 stream 的 position 1 处读取消息帧格式时出错(状态:开始)堆栈跟踪:
at System.ServiceModel.Channels.ClientDuplexConnectionReader.EnsureDecoderAtEof()在 System.ServiceModel.Channels.ClientDuplexConnectionReader.EnsureDecoderAtEof()
at System.ServiceModel.Channels.SessionConnectionReader.Receive(TimeSpan timeout)在 System.ServiceModel.Channels.SessionConnectionReader.Receive(时间跨度超时)
at System.ServiceModel.Channels.SynchronizedMessageSource.Receive(TimeSpan timeout)在 System.ServiceModel.Channels.SynchronizedMessageSource.Receive(时间跨度超时)
at System.ServiceModel.Channels.TransportDuplexSessionChannel.Receive(TimeSpan timeout)在 System.ServiceModel.Channels.TransportDuplexSessionChannel.Receive(时间跨度超时)
at System.ServiceModel.Channels.TransportDuplexSessionChannel.TryReceive(TimeSpan timeout, Message& message)在 System.ServiceModel.Channels.TransportDuplexSessionChannel.TryReceive(时间跨度超时,消息和消息)
at System.ServiceModel.Dispatcher.DuplexChannelBinder.Request(Message message, TimeSpan timeout)在 System.ServiceModel.Dispatcher.DuplexChannelBinder.Request(消息消息,TimeSpan 超时)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)在 System.ServiceModel.Channels.ServiceChannel.Call(字符串操作,Boolean 单向,ProxyOperationRuntime 操作,Object[] 输入,Object[] 输出,TimeSpan 超时)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)在 System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime 操作)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) Exception rethrown在 System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage 消息) 异常重新抛出

I suspect it may be occured due to below reasons, since i could not see the data that was sent to the WCF service due to some scurity issue.我怀疑它可能是由于以下原因而发生的,因为由于某些安全问题,我看不到发送到 WCF 服务的数据。 Scenarios:场景:

  1. The data that was sent to the WCF service might have EOF character.发送到 WCF 服务的数据可能具有 EOF 字符。
  2. The data size that was sent to the WCF service would be larger than the size that was configured (maxReceivedMessageSize) in the WCF configuration at client side.发送到 WCF 服务的数据大小将大于在客户端的 WCF 配置中配置的大小 (maxReceivedMessageSize)。

I was trying to reproduce the scenario in my local machine, i am unable to reproduce it.我试图在我的本地机器上重现该场景,但我无法重现它。 For the first scenario, i included the EOF byte (0x1A) in the payload data to sent to WCF service.对于第一种情况,我在有效载荷数据中包含 EOF 字节 (0x1A) 以发送到 WCF 服务。 but it does not throw any exception at client side.但它不会在客户端抛出任何异常。 for the second scenario, i configured the maxReceivedMessageSize value less than the payload data size, it throws the exception, but it was different exception.对于第二种情况,我将 maxReceivedMessageSize 值配置为小于有效负载数据大小,它会引发异常,但它是不同的异常。

What could be the reason for this exception?此异常的原因可能是什么? How to reproduce this exception in my local?如何在我的本地重现此异常?

The issue is because of load balancer timeout configuration.问题是由于负载平衡器超时配置。

The EOF exception is occurred at client side, when the WCF service processes the request more than load balancer configuration time. EOF 异常发生在客户端,当 WCF 服务处理请求超过负载均衡器配置时间时。

Thanks @Lan Huang for navigating me to the right direction.感谢@Lan Huang 引导我走向正确的方向。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM