SignalR giving 'The ConnectionId is in the incorrect format' -


I have a signal R project that was working without problems in my development environment, but once it Production was taken, almost every call will fail with error

The connection ID is in the wrong format.

I saw some other items on the stack overflow about the same error message, but none of them was a solution that helps.

I'm using Signal R 2.0.2 and effectively a load balancer.

Event code: 3005 Event message: An uncontrolled exception occurred. Event Time: 2/11/2014 9: 11:27 PM Event Time (UTC): 2/12/2014 3:11:27 AM Event ID: cff1fd93fa6d4b83b1848078a905371c Event sequence: 73 Event occurrence: 10 Event Description Code: 0 Application Information:

  Application Domain: / LM / W3SVC / 2 / Route 3-130366479327251392 Trust Level: Full Application Virtual Path: / Application Path: C: \ inetpub \ wwwroot \ & LT; Remvoved & gt; Machine Name: BSDUSHC1WW09 Process Information: Process ID: 7088 Process Name: w3wp.exe Account Name: & lt; Removed & gt; Exception information: Exception type: InvalidOperationException Exception message: ConnectionId the wrong format  

Microsoft.AspNet.SignalR.PersistentConnection.GetConnectionId (HostContext context, string connectionToken) Microsoft.AspNet.SignalR.PersistentConnection on .ProcessRequest (HostContext reference) on .HubDispatcher.ProcessRequest (HostContext reference Microsoft.AspNet.SignalR.Hubs) Microsoft.Owin.Mapping.MapMiddleware.d__0.MoveNext () Microsoft.AspNet.SignalR.PersistentConnection.ProcessRequest (IDictionary`2 Environment) --- where the exception was on the end system of the stack trace from the previous location. Runtime Option Services Option Dispatch Info () On System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication on Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContext.IntegrinalPoPlayWork (IAsyncResult ar). IExecutionStep.Execute (on System.Web.HttpApplication.ExecuteStep) (IExecutionStep step, Boolean & amp; full synchronous)

request information: Reque St. URL: http: /// signalr / connect transport = serverSentEvents & Amp; ConnectionToken = GZlhDBCjkD1 / bL1rc4Rlq2PVKYRs0B9nN7b71cU / E6x7sCsFvR1DqM / rBnDhg + URwkYyBlGmrczV59XIn / goyt9x0xXOd8Gs3Qswo1oXqSttH2QPO548C0fbdBvvlUupzS4S0Rl + aShoQwnj + qFDpA == & amp; ConnectionData = [{"name": ""}]

request path: / signal / connect / user host address: 10.240.14.26 users: & lt; Removed & gt; Authenticated: Correct authentication type: Thread account name negotiation: & lt; Removed & gt; Thread information: Thread ID: 23 Thread account name: & lt; Removed & gt; Is holding the wrong stack trace on Microsoft.AspNet.SignalR.PersistentConnection.GetConnectionId (HostContext

context, string connectionToken) Microsoft.AspNet.SignalR.PersistentConnection.ProcessRequest (HostContext reference Microsoft.AspNet.SignalR.Hubs.HubDispatcher.ProcessRequest (HostContext reference on)) on Microsoft.AspNet.SignalR.PersistentConnection.ProcessRequest (IDictionary`2 environment) on Microsoft.Owin.Mapping.MapMiddleware.d__0.MoveNext () - - The end of the stack trace from the previous location where the exception was thrown- on the system time. On Microsoft Expansion Services.express DispatchInfo.of.off. SystemWeb IntegratedPipeline.IntegratedPiplineContract Enterprinel Work (IASINCRSRL AR) system. Web. Hpapackification. Sinkaventaksakyusnteep .System.Web.HttpApplication.IExecutionStep.Execute () is (IExecutionStep step System.Web.HttpApplication.ExecuteStep, Boolean & amp; completedSynchronously)

share a machine key .

In Signlar documents is no clear mention so I connectionToken is encrypted using a key machine in the above event log messages. When an application server hits 1, then a connection tone is assigned using that machine's machine key. If the application then hits the server 2 with that fixed connection, the token can not decrypt machine 2 token unless there is a matching machine key.

There are countless resources about setting up a machine key online so I will leave only the easiest one click on the website in IIS 8 (maybe 7 too) and open the key setting of the machine. In the right Actions pane, click on Generate Key or verification key and decryption key Generate "a unique key for each application under sections' Uncheck the checkbox.


Comments