locked
SignalR - WebSocket Error: Network Error 12030, The connection with the server was terminated abnormally RRS feed

  • Question

  • User1313376463 posted

    Trying to get SignalR working on our webserver(IIS 8, Server 2012, websockets installed, .NET 4.5) but having no joy.

    Works great on my local IIS, windows 8 and connects with websockets, all working brilliantly. I am using it for real time notifications/dashboard updates in a web forms project.

    <httpRuntime targetFramework="4.5"/>

    and

    <compilation strict="false" explicit="true" targetFramework="4.5" debug="false">

    Set in webconfig

    Local signalr logging:

    [11:26:17 GMT+0000 (GMT Standard Time)] SignalR: Client subscribed to hub 'notificationhub'.
    [11:26:17 GMT+0000 (GMT Standard Time)] SignalR: Negotiating with '/signalr/negotiate?clientProtocol=1.5&connectionData=%5B%7B%22name%22%3A%22notificationhub%22%7D%5D'.
    [11:26:17 GMT+0000 (GMT Standard Time)] SignalR: webSockets transport starting.
    [11:26:17 GMT+0000 (GMT Standard Time)] SignalR: Connecting to websocket endpoint 'ws://localhost:22038/signalr/connect?transport=webSockets&clientProtocol=1.5&connectionToken=W5PmClxV6R32xJpuP5It2NUDVvJXOESGJCrgQYb67z59ODUJFr13zQzgBgTYEfmr4XbgMmRGU3ZncQS3yZU2Hmh%2Fc3h%2F17fh9gRlUOUdnaVYcnls%2BQon%2F7R0ckNw8MnLcrG1pg%3D%3D&connectionData=%5B%7B%22name%22%3A%22notificationhub%22%7D%5D&tid=3'.
    [11:26:17 GMT+0000 (GMT Standard Time)] SignalR: Websocket opened.
    [11:26:17 GMT+0000 (GMT Standard Time)] SignalR: webSockets transport connected. Initiating start request.
    [11:26:18 GMT+0000 (GMT Standard Time)] SignalR: The start request succeeded. Transitioning to the connected state.
    [11:26:18 GMT+0000 (GMT Standard Time)] SignalR: Now monitoring keep alive with a warning timeout of 13333.333333333332, keep alive timeout of 20000 and disconnecting timeout of 30000
    hub start, connection id=01b7a623-5531-496c-a5e1-ab0876e2c1a6

    Server log:

    [11:24:01 GMT+0000 (GMT Standard Time)] SignalR: Client subscribed to hub 'notificationhub'.
    [11:24:01 GMT+0000 (GMT Standard Time)] SignalR: Negotiating with '/signalr/negotiate?clientProtocol=1.5&connectionData=%5B%7B%22name%22%3A%22notificationhub%22%7D%5D'.
    [11:24:02 GMT+0000 (GMT Standard Time)] SignalR: webSockets transport starting.
    [11:24:02 GMT+0000 (GMT Standard Time)] SignalR: Connecting to websocket endpoint 'ws://foo.co.uk/signalr/connect?transport=webSockets&clientProtocol=1.5&connectionToken=uibfnMomSreytNZY7UiusFWoTjNWO6%2FNIaBzIM%2FVVSBOXk6SNlyULUH%2FaGWoPynoEbx6sKRfShJG0zrd846uqgdgEK6xQIP2K5j3xfwtBlngGG3i6k%2FYoHNk5subReA3TsCxfw%3D%3D&connectionData=%5B%7B%22name%22%3A%22notificationhub%22%7D%5D&tid=10'.
    [11:24:03 GMT+0000 (GMT Standard Time)] SignalR: Websocket opened.
    SCRIPT12030: WebSocket Error: Network Error 12030, The connection with the server was terminated abnormally
    
    [11:24:03 GMT+0000 (GMT Standard Time)] SignalR: Unclean disconnect from websocket: [no reason given].
    [11:24:03 GMT+0000 (GMT Standard Time)] SignalR: Closing the Websocket.
    [11:24:03 GMT+0000 (GMT Standard Time)] SignalR: webSockets transport failed to connect. Attempting to fall back.
    [11:24:03 GMT+0000 (GMT Standard Time)] SignalR: serverSentEvents transport starting.
    [11:24:03 GMT+0000 (GMT Standard Time)] SignalR: This browser doesn't support SSE.
    [11:24:03 GMT+0000 (GMT Standard Time)] SignalR: serverSentEvents transport failed to connect. Attempting to fall back.
    [11:24:03 GMT+0000 (GMT Standard Time)] SignalR: foreverFrame transport starting.
    [11:24:03 GMT+0000 (GMT Standard Time)] SignalR: Binding to iframe's load event.
    [11:24:03 GMT+0000 (GMT Standard Time)] SignalR: Iframe transport started.
    [11:24:03 GMT+0000 (GMT Standard Time)] SignalR: foreverFrame transport connected. Initiating start request.
    [11:24:03 GMT+0000 (GMT Standard Time)] SignalR: The start request succeeded. Transitioning to the connected state.
    [11:24:03 GMT+0000 (GMT Standard Time)] SignalR: Now monitoring keep alive with a warning timeout of 13333.333333333332, keep alive timeout of 20000 and disconnecting timeout of 30000
    hub start, connection id=cd2af7f4-5f85-40bb-a0a6-f8f8060bedae

    Even though it appears to be connected using foreverFrame it does not fire the appropriate hub responses.

    Really frustrating, suspect something obvious is wrong but I cant figure it out.

    Monday, March 2, 2015 4:08 AM

Answers

  • User71929859 posted

    So I am going to assume there is some kind of Proxy server inbetween my "work" pc and the web server. Of which I have no access to. (Assuming Proxy server over Firewall).

    That could be the problem.

    Also you need to use latest browsers in order to support websockets. So check your browser versions in your office as well.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, March 27, 2015 8:13 PM

All replies

  • User1918509225 posted

    Hi Chronicbint,

    Thanks for your post here.

    please try to update SinglaR application web.config like  below:

    <system.webServer>
       <modules runAllManagedModulesForAllRequests="true">
       </modules>
    </system.webServer> 

    For more information,please refer to the link about how to deploy signlar in windows server 2012 :

    http://blogs.msdn.com/b/timlee/archive/2013/03/21/hosting-a-signalr-application-on-windows-2008r2-and-iis-7-5.aspx

    Please refer to the simialr issue which may give your a right direction:

    http://stackoverflow.com/questions/16900536/signalr-applications-do-not-work-under-iis

    Best Regards,

    Kevin Shen.

    Monday, March 2, 2015 8:43 PM
  • User1313376463 posted

    Hi

    Already got that in the web.config.

    Further server logging gives this error.

    SignalR.Transports.WebSocketTransport Error: 0 : OnError(cda3efb1-c32e-4a6e-b5ba-9b4080fef3c8, System.Net.WebSockets.WebSocketException (0x800703E3):
    The I/O operation has been aborted because of either a thread exit or an application request
    at System.Web.WebSockets.WebSocketPipe.<>c__DisplayClass7.<ReadFragmentAsync>b__6(Int32 hrError, Int32 cbIO, Boolean fUtf8Encoded, Boolean fFinalFragment, Boolean fClose)
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at System.Web.WebSockets.AspNetWebSocket.<DoWork>d__2d`1.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at System.Web.WebSockets.AspNetWebSocket.<>c__DisplayClass1a.<<ReceiveAsyncImpl>b__18>d__1c.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
    at Microsoft.AspNet.SignalR.WebSockets.WebSocketMessageReader.<ReadMessageAsync>d__0.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
    at Microsoft.AspNet.SignalR.TaskAwaiterHelper.PreserveCultureAwaiter`1.GetResult()
    at Microsoft.AspNet.SignalR.WebSockets.WebSocketHandler.<ProcessWebSocketRequestAsync>d__e.MoveNext())

    Going to fallback to the example chat application and see if that has issues.

    Tuesday, March 3, 2015 4:19 AM
  • User1313376463 posted

    After testing it on my home connection it connects using Websockets correctly. So I am going to assume there is some kind of Proxy server inbetween my "work" pc and the web server. Of which I have no access to. (Assuming Proxy server over Firewall).

    [10:33:15 GMT+0000 (GMT Standard Time)] SignalR: Client subscribed to hub 'notificationhub'.

    [10:33:15 GMT+0000 (GMT Standard Time)] SignalR: Negotiating with '/signalr/negotiate?clientProtocol=1.5&connectionData=%5B%7B%22name%22%3A%22notificationhub%22%7D%5D'.
    [10:33:16 GMT+0000 (GMT Standard Time)] SignalR: webSockets transport starting.
    [10:33:16 GMT+0000 (GMT Standard Time)] SignalR: Connecting to websocket endpoint 'ws://blah/signalr/connect?transport=webSockets&clientProtocol=1.5&connectionToken=IxxvgxBhvbsruv2uk0pK%2FPB708bJGvoOJD0oR0vVPgBip%2B7uGy68HEMOw1ikq7%2BuiyX7XqN%2FwYK%2BKgkrBlz9HHuI5HSDQEwRHvSr2Ey1pg2B7FaviRLFcNu8mg2dRWHVKbAkdw%3D%3D&connectionData=%5B%7B%22name%22%3A%22notificationhub%22%7D%5D&tid=6'.
    [10:33:16 GMT+0000 (GMT Standard Time)] SignalR: Websocket opened.
    [10:33:16 GMT+0000 (GMT Standard Time)] SignalR: webSockets transport connected. Initiating start request.
    [10:33:16 GMT+0000 (GMT Standard Time)] SignalR: The start request succeeded. Transitioning to the connected state.
    [10:33:16 GMT+0000 (GMT Standard Time)] SignalR: Now monitoring keep alive with a warning timeout of 13333.333333333332, keep alive timeout of 20000 and disconnecting timeout of 30000
    hub start, connection id=7f3eba16-9e7b-450e-a740-a69fa91047b6

    Wednesday, March 11, 2015 6:40 AM
  • User1313376463 posted

    Just as another note, not actually related to the websocket error but the reason the javascript events were not firing.

    The application pool worker processes was set to 3, so the user connection mapping(in memory) never contained all correct users/connection ids. Changed to 1, all working.

    Tuesday, March 17, 2015 11:04 AM
  • User71929859 posted

    So I am going to assume there is some kind of Proxy server inbetween my "work" pc and the web server. Of which I have no access to. (Assuming Proxy server over Firewall).

    That could be the problem.

    Also you need to use latest browsers in order to support websockets. So check your browser versions in your office as well.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, March 27, 2015 8:13 PM