Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebSocket is closed before the connection is established. with Win2012 + IIS 8 on Windows Azure. #2780

Closed
nilangjoshi opened this issue Dec 26, 2013 · 6 comments

Comments

@nilangjoshi
Copy link

I am facing am issue while deploying the SignalR code to the Windows azure Environment. Please fins the Error Trace at Client Browser as below.

[14:50:59 GMT+0530 (India Standard Time)] SignalR: No hubs have been subscribed to.  The client will not receive data from hubs.  To fix, declare at least one client side function prior to connection start for each hub you wish to subscribe to. jquery.signalR-2.0.0.min.js?ver=1.0:8
[14:50:59 GMT+0530 (India Standard Time)] SignalR: Negotiating with '/signalr/negotiate?oloc=103&connectionData=%5B%5D&clientProtocol=1.3'. jquery.signalR-2.0.0.min.js?ver=1.0:8
[14:50:59 GMT+0530 (India Standard Time)] SignalR: Connecting to websocket endpoint 'ws://xyz.test.com/signalr/connect?transport=webSockets&connectionToken=zXAoOLKBbRqOno6IR8Xcgw4lPZmWkaUNsmIrVdqOlJ5FXuEad9PJKSjTkNKbEqLmbg2WCiJVATWYw9lJS%2BygxF1RjjwpbwWdPVyes5qdIREIPGcCpiMDouPeXnkPm4uw3Wo3aQ%3D%3D&oloc=103&connectionData=%5B%5D&tid=4'. jquery.signalR-2.0.0.min.js?ver=1.0:8
[14:51:04 GMT+0530 (India Standard Time)] SignalR: webSockets timed out when trying to connect. jquery.signalR-2.0.0.min.js?ver=1.0:8
[14:51:04 GMT+0530 (India Standard Time)] SignalR: Closing the Websocket. jquery.signalR-2.0.0.min.js?ver=1.0:8
WebSocket connection to 'ws://smartdev.gep.com/signalr/connect?transport=webSockets&connectionToken=zXAoOLKBbRqOno6IR8Xcgw4lPZmWkaUNsmIrVdqOlJ5FXuEad9PJKSjTkNKbEqLmbg2WCiJVATWYw9lJS%2BygxF1RjjwpbwWdPVyes5qdIREIPGcCpiMDouPeXnkPm4uw3Wo3aQ%3D%3D&oloc=103&connectionData=%5B%5D&tid=4' failed: WebSocket is closed before the connection is established. jquery.signalR-2.0.0.min.js?ver=1.0:8
[14:51:04 GMT+0530 (India Standard Time)] SignalR: Attempting to connect to SSE endpoint 'http://xyz.test.com/signalr/connect?transport=serverSentEvents&connecti…dIREIPGcCpiMDouPeXnkPm4uw3Wo3aQ%3D%3D&oloc=103&connectionData=%5B%5D&tid=4'. jquery.signalR-2.0.0.min.js?ver=1.0:8
[14:51:09 GMT+0530 (India Standard Time)] SignalR: serverSentEvents timed out when trying to connect. jquery.signalR-2.0.0.min.js?ver=1.0:8
[14:51:09 GMT+0530 (India Standard Time)] SignalR: EventSource calling close(). jquery.signalR-2.0.0.min.js?ver=1.0:8
[14:51:09 GMT+0530 (India Standard Time)] SignalR: This browser supports SSE, skipping Forever Frame. jquery.signalR-2.0.0.min.js?ver=1.0:8
[14:51:09 GMT+0530 (India Standard Time)] SignalR: Opening long polling request to 'http://xyz.test.com/signalr/connect?transport=longPolling&connectionTok…dIREIPGcCpiMDouPeXnkPm4uw3Wo3aQ%3D%3D&oloc=103&connectionData=%5B%5D&tid=4'. jquery.signalR-2.0.0.min.js?ver=1.0:8
[14:51:10 GMT+0530 (India Standard Time)] SignalR: Long poll complete. jquery.signalR-2.0.0.min.js?ver=1.0:8
[14:51:10 GMT+0530 (India Standard Time)] SignalR: LongPolling connected. 

I can also see few errors occurring at the Server Side as Follow

Request information: 
    Request URL: http://XYZ.cloudapp.net/signalr/connect?transport=webSockets&connectionToken=TeXryZf0sKG+X58NT+SnhsQ8+n9POWpQt+wSDhJu7zXsIg9ZqCBylaHbAYTOlNWlMpowzinqeQkmJ7bb9HFwTPmN+X1QBD63hPpTULHTUPE0slre6Toes0f/dmPO2wBS5ozcPw==&oloc=103&connectionData=[]&tid=5 
    Request path: /signalr/connect 
    User host address: 130.110.137.60 
    User: test@test.com 
    Is authenticated: True 
    Authentication Type: Federation 
    Thread account name: NT AUTHORITY\NETWORK SERVICE 

Thread information: 
    Thread ID: 20 
    Thread account name: NT AUTHORITY\NETWORK SERVICE 
    Is impersonating: False 
    Stack trace:    at Microsoft.AspNet.SignalR.Transports.WebSocketTransport.AcceptWebSocketRequest(Func`2 callback)
   at Microsoft.AspNet.SignalR.PersistentConnection.ProcessRequest(HostContext context)
   at Microsoft.Owin.Mapping.MapMiddleware.<Invoke>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Owin.Cors.CorsMiddleware.<Invoke>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
@davidfowl
Copy link
Member

Did you figure out why it's failing? I can't tell much from the log other than it threw an exception. Can you try a new app and try to narrow the problem down?

@lfr
Copy link

lfr commented Mar 19, 2014

I have a similar issue, did you find a fix? My issue is here:
http://stackoverflow.com/questions/22385335/using-signalr-with-vip-redirection

@nilangjoshi
Copy link
Author

It turn out to be following two issues.

  1. Handling of SignalR on ARR.
  2. Magic File was not getting loaded from CDN.

@gainskills
Copy link

gainskills commented Feb 23, 2017

@nilangjoshi , Thanks for your hints. Did the two points resolved issue?

@nilangjoshi
Copy link
Author

It does. everything seems to be working perfect for us since almost 2 years now.

@analogrelay analogrelay removed this from the Triaged milestone Jun 27, 2018
@aspnet-hello
Copy link

This issue has been closed as part of issue clean-up as described in https://blogs.msdn.microsoft.com/webdev/2018/09/17/the-future-of-asp-net-signalr/. If you're still encountering this problem, please feel free to re-open and comment to let us know! We're still interested in hearing from you, the backlog just got a little big and we had to do a bulk clean up to get back on top of things. Thanks for your continued feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants