SignalR:Value不能为null,参数名称:s

时间:2016-01-29 09:00:41

标签: signalr

我有一个非常简单的SignalR应用程序,它在本地运行,但在部署到我们的生产环境时无法加载数据。

以下是页面加载时发出的请求序列(所有GET个请求):

<app root>                                              200         document    3.9 KB  2.02 s  
before?v=aouETsYNiw4bnMn0RnzIytKnjAOu8acJr3MpfMJz-SM1   200         stylesheet  2.5 KB  58 ms   
after?v=Cv-lJK82snhp2-MwHnIVee8Cx24YmVhR0dcLmnhweHc1    200         script      220 KB  342 ms  
negotiate?connectionData=%5B%7B%22name...               200         xhr         704 B   77 ms   
connect?transport=serverSentEvents&con...               (failed)    eventsource 593 B   2.1 min

beforeafter请求分别是样式和脚本包。最后两个网址被截断以使桌子适合;他们在这里:

negotiate?connectionData=%5B%7B%22name%22%3A%22builds%22%7D%5D&clientProtocol=1.3&_=1454056625582   
connect?transport=serverSentEvents&connectionToken=6lFEhj6WReyyEc%2BYmsTAX3%2Fi4EA5KzOR6SaLY0JwfjFMJHq0uYMrKOv4rF7Va1sswGcFce3wKQ5XhhwUMP6Oot8iDx%2Fo24SMnRJXEim2dPmFtmcLqTksRwGeSHf26z5Xw3nLUX19%2BoW4s7kJSXLPRQ%3D%3D&connectionData=%5B%7B%22name%22%3A%22builds%22%7D%5D&tid=5

connectionData参数进行解码的Url会产生[{"name":"builds"}],这似乎是正确的,因为builds是我在服务器端配置的唯一集线器的正确名称。

正如您在日志中看到的那样,最后一次请求需要两分钟才能报告状态,然后只是说“失败”。如果我在调试器中右键单击它并选择“在新选项卡中打开”,我会得到(没有延迟)黄色死亡屏幕,说明以下错误:

  

值不能为空。   参数名称:s

[ArgumentNullException: Value cannot be null. Parameter name: s]
    System.IO.StringReader..ctor(String s) +14275218
    Microsoft.AspNet.SignalR.Json.JsonSerializerExtensions.Parse(JsonSerializer serializer, String json) +74   
    Microsoft.AspNet.SignalR.Hubs.HubRequestParser.Parse(String data, JsonSerializer serializer) +28   
    Microsoft.AspNet.SignalR.Hubs.HubDispatcher.OnReceived(IRequest request, String connectionId, String data) +85   
    Microsoft.AspNet.SignalR.<>c__DisplayClassc.<ProcessRequest>b__7() +42
    Microsoft.AspNet.SignalR.TaskAsyncHelper.FromMethod(Func`1 func) +64  
    System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +144   
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +84   
    Microsoft.AspNet.SignalR.Transports.<ProcessSendRequest>d__10.MoveNext() +655
    System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +144   
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +84
    Microsoft.Owin.Mapping.<Invoke>d__0.MoveNext() +827
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +32   
    Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContext.EndFinalWork(IAsyncResult ar) +208   
    System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +434
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288

搜索此错误我得到一些点击,表明我在服务器上存在权限问题,但我已对应用程序文件夹赋予Everyone完全访问权限,但行为没有变化。它在本地工作,但不在服务器上工作(即使从服务器浏览到localhost)。

我还应该尝试什么?

更新:感谢JF Beaulieu在评论中的一些指导,我现在已经进入了下一步。与我在评论中发布的不同,请求确实在很长一段时间(2到3分钟之间)后返回,然后立即再次发送(并再次花2-3分钟回复)。请求的标题和内容如下:

Request URL:https://my.domain.name/signalr/poll?transport=longPolling&connectionToken=A64ByteEncodedString&messageId=d-EC6B29D5-B%2C0%7CC%2C0%7CD%2C0%7CE%2C0%7CF%2C0&connectionData=%5B%7B%22name%22%3A%22builds%22%7D%5D&tid=6&callback=jQuery2110622865846613422_1454336540065&_=1454336540071
Request Method:GET
Status Code:200 OK
Remote Address:192.168.16.243:443

Request Headers
Accept:text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01
Accept-Encoding:gzip, deflate, sdch
Accept-Language:en-US,en;q=0.8
Authorization:Negotiate AVeryLongTokenString
Connection:keep-alive
Content-Type:application/json; charset=UTF-8
DNT:1
Host:my.domain.name
Referer:https://my.domain.name/
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36
X-Requested-With:XMLHttpRequest
Query String Parameters
view source
view URL encoded
transport:longPolling
connectionToken:A64BitEncodedString
messageId:d-EC6B29D5-B,0|C,0|D,0|E,0|F,0
connectionData:[{"name":"builds"}]
tid:6
callback:jQuery2110622865846613422_1454336540065
_:1454336540071

Response Headers
Cache-Control:no-cache
Content-Type:application/javascript; charset=UTF-8
Date:Mon, 01 Feb 2016 14:33:35 GMT
Expires:-1
Persistent-Auth:true
Pragma:no-cache
Server:Microsoft-IIS/8.5
Transfer-Encoding:chunked
X-AspNet-Version:4.0.30319
X-Content-Type-Options:nosniff
X-Powered-By:ASP.NET

Response Content
jQuery2110622865846613422_1454336540065({"C":"d-8D14CCD4-B,0|C,0|D,0|E,0|F,0","M":[]});

0 个答案:

没有答案