是什么导致我的间歇性System.Net.WebException错误?
我有一个应用程序使用Microsoft Dynamics CRM的API来插入和更新记录。每当我连续过程的记录屈指可数,我打了以下错误试图使更新之一时:是什么导致我的间歇性System.Net.WebException错误?
2013-02-14 10:25:56,382 - Updating lead in dynamics with leadid [3cdaa9d4-c276-e211-99b6-005056ab0822]
2013-02-14 10:25:58,737 - GetProperty
System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Authentication failed because the remote party has closed the transport stream.
at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)
at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.ConnectStream.WriteHeaders(Boolean async)
--- End of inner exception stack trace ---
at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request)
at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at Microsoft.Crm.SdkTypeProxy.Metadata.MetadataService.Execute(MetadataServiceRequest Request)
at Integration.Crm.Services.Dynamics.LeadService.GetPickListvalue(String pickListlable, String logicalAttributeName) in C:\code\DynamicsIntegration\Services\LeadService.cs:line 1256
谷歌搜索的时候,我发现为什么这个错误(System.IO.IOException: Authentication failed because the remote party has closed the transport stream.
)可能occurr有几个原因,但在所有情况下,由于配置错误或证书损坏,每次发生时,都会发生此问题。
什么在世界上可能触发这个错误间歇?
它与Web请求的内容无关,因为我可以在5分钟后处理相同的请求,并且它可以工作。对此服务器的所有请求约有10%会导致此错误。
编辑:这里有人用similar problem使用SharePoint,但每次都发生错误。
使用CRM诊断工具打开跟踪日志记录:http://crmdiagtool2011.codeplex.com以查看是否收到任何其他错误信息(假设您正在使用On Premise)。我猜你的SQL连接从你的CRM服务器到SQL数据库有一些不太正确的地方。
我会试试这个。谢谢达里尔。 – 2013-02-16 02:34:00
虽然我得到的错误似乎是在调用服务器和CRM REST API之间的网络层 - 而不是数据库层。 – 2013-02-16 02:39:49
什么版本的CRM?数据块传输有多大? – 2013-02-15 06:53:30
之间有什么东西(代理,防火墙,...)? – ccellar 2013-02-15 10:11:04
你是不是在多个线程之间共享上下文/ IOrganization服务? – Daryl 2013-02-15 11:52:28