Closed Mds92 closed 6 years ago
Do you declare Application_PreSendRequestHeaders
in your Global.asax.cs
file?
No, I don't
I am experiencing the same issue after upgrading from 2.0.3 to 2.1. Like Mds92 I also do not have Application_PreSendRequestHeaders (only Application_Start and Application_Error).
I added server side tracing as described here, but unfortunately the transport.log files that were created did't contain any useful errors. Client side logging with DetailedErrorPolicy on just says that no transports could be initialized (all timed out).
When this occurs OnConnected is successfully called on the server (breakpoints are hit), which completes without throwing, but this is immediately followed by OnDisconnected. This happens for every transport it tries.
I have downgraded back to 2.0.3 in the meantime, everything is working perfectly again.
updated to 2.1.1,this issue fixed
This sounds very much like the Application_PreSendRequestHeaders issue. Note it can be added by other modules in your application even if you don't use it directly, e.g. Glimpse, Elmah. Please try upgrading to 2.1.1 to see if it fixes the issue for you.
Sorry I didn't see the comment by GliterZhang earlier. I just updated.
It's fixed for me too after upgrading to 2.1.1
I'm still running into this issue in 2.2. I have over 2.5 million of these errors (yes million). Any ideas on what is causing this? Chrome 43 and firefox 39 if that matters.
Upon looking at the logs. I get 69k Error: No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization.
from a single user over the course of a few hours. But I know they were connected cause I forced a refresh for their account and I got a WebSocket closed.
Application source: https://github.com/exceptionless/Exceptionless
Yeah I'm having this issue as well. I'm not specifying any transport and it still often says
Error: No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization
However, sometimes it doesn't, and I can't at all figure out why it happens sometimes and why it doesn't happen other times.
@mortenalbring Yep, we aren't specifying a transport either.. https://github.com/exceptionless/Exceptionless/search?utf8=%E2%9C%93&q=signalr
@niemyjski For what it's worth, it seems only to happen to me when my web application is running locally. When it's published to Azure, it doesn't seem to happen. It's still quite a nuisance when trying to debug things.
@mortenalbring we've only seen this when we are deployed in Azure :\
@niemyjski do you have the fixed for Azure?
I have a similar issue too. It seems to occur on IE 9. I cannot reproduce it locally but I can when it gets deployed. I am using signalr 2.2. Any thoughts? I did try increasing the TransportConnectTimeout timeout, but that didnt fix it for me as well.
Thanks VIkram
I also have the same error too. my signalr version is 2.2.0 and Jquery version is 2.1.4. Because This project is our first try to use signalr to implement real-time. so we don't have suffice knowledge to fix this kind of issues
Anyone please help
@BraveIT & @Robert-Sun You've provided very little information here about your project/s and scenarios. Consider running through the troubleshooting steps found on the asp.net/signalr website: http://www.asp.net/signalr/overview/testing-and-debugging/troubleshooting Also, add JavaScript tracing to get more insight into what's happening: http://www.asp.net/signalr/overview/testing-and-debugging/enabling-signalr-tracing#javascript If you still haven't resolved the issue, consider providing specific information about your project, diagnostic information (traces), hosting information, and anything else you feel might be relevant.
@garysharp Thanks for you help about this issue there is the detailed info [13:57:35 GMT+0800 (China Standard Time)] SignalR: Client subscribed to hub 'checkin'. jquery.signalR-2.2.0.min.js:8 [13:57:35 GMT+0800 (China Standard Time)] SignalR: Negotiating with '/signalr/negotiate?clientProtocol=1.5&connectionData=%5B%7B%22name%22%3A%22checkin%22%7D%5D'. jquery.signalR-2.2.0.min.js:8 [13:57:35 GMT+0800 (China Standard Time)] SignalR: webSockets transport starting. jquery.signalR-2.2.0.min.js:8 [13:57:35 GMT+0800 (China Standard Time)] SignalR: Connecting to websocket endpoint 'wss://f1data.qa.fellowshipone.com/signalr/connect?transport=webSockets&clie…33N5QviXjIeBT0&connectionData=%5B%7B%22name%22%3A%22checkin%22%7D%5D&tid=2'. jquery.signalR-2.2.0.min.js:8 [13:57:36 GMT+0800 (China Standard Time)] SignalR: Websocket opened. jquery.signalR-2.2.0.min.js:8 [13:57:40 GMT+0800 (China Standard Time)] SignalR: webSockets transport timed out when trying to connect. jquery.signalR-2.2.0.min.js:8 [13:57:40 GMT+0800 (China Standard Time)] SignalR: Closing the Websocket. jquery.signalR-2.2.0.min.js:8 [13:57:40 GMT+0800 (China Standard Time)] SignalR: webSockets transport failed to connect. Attempting to fall back. jquery.signalR-2.2.0.min.js:8 [13:57:40 GMT+0800 (China Standard Time)] SignalR: serverSentEvents transport starting. jquery.signalR-2.2.0.min.js:8 [13:57:40 GMT+0800 (China Standard Time)] SignalR: Attempting to connect to SSE endpoint 'https://f1data.qa.fellowshipone.com/signalr/connect?transport=serverSentEve…33N5QviXjIeBT0&connectionData=%5B%7B%22name%22%3A%22checkin%22%7D%5D&tid=6'. jquery.signalR-2.2.0.min.js:8 [13:57:40 GMT+0800 (China Standard Time)] SignalR: EventSource connected. jquery.signalR-2.2.0.min.js:8 [13:57:45 GMT+0800 (China Standard Time)] SignalR: serverSentEvents transport timed out when trying to connect. jquery.signalR-2.2.0.min.js:8 [13:57:45 GMT+0800 (China Standard Time)] SignalR: EventSource calling close(). jquery.signalR-2.2.0.min.js:8 [13:57:45 GMT+0800 (China Standard Time)] SignalR: serverSentEvents transport failed to connect. Attempting to fall back. jquery.signalR-2.2.0.min.js:8 [13:57:45 GMT+0800 (China Standard Time)] SignalR: foreverFrame transport starting. jquery.signalR-2.2.0.min.js:8 [13:57:45 GMT+0800 (China Standard Time)] SignalR: Forever Frame is not supported by SignalR on browsers with SSE support. jquery.signalR-2.2.0.min.js:8 [13:57:45 GMT+0800 (China Standard Time)] SignalR: foreverFrame transport failed to connect. Attempting to fall back. jquery.signalR-2.2.0.min.js:8 [13:57:45 GMT+0800 (China Standard Time)] SignalR: longPolling transport starting. jquery.signalR-2.2.0.min.js:8 [13:57:45 GMT+0800 (China Standard Time)] SignalR: Opening long polling request to 'https://f1data.qa.fellowshipone.com/signalr/connect?transport=longPolling&c…hRA94K33N5QviXjIeBT0&connectionData=%5B%7B%22name%22%3A%22checkin%22%7D%5D'. jquery.signalR-2.2.0.min.js:8 [13:57:50 GMT+0800 (China Standard Time)] SignalR: longPolling transport timed out when trying to connect. jquery.signalR-2.2.0.min.js:8 [13:57:50 GMT+0800 (China Standard Time)] SignalR: Aborted xhr request. jquery.signalR-2.2.0.min.js:8 [13:57:50 GMT+0800 (China Standard Time)] SignalR: longPolling transport failed to connect. Attempting to fall back. jquery.signalR-2.2.0.min.js:8 [13:57:50 GMT+0800 (China Standard Time)] SignalR: Fallback transports exhausted. index.html:515 SignalR Connecting: Error: No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization. jquery.signalR-2.2.0.min.js:8 [13:57:50 GMT+0800 (China Standard Time)] SignalR: Stopping connection. jquery.signalR-2.2.0.min.js:8 [13:57:50 GMT+0800 (China Standard Time)] SignalR: Fired ajax abort async = true.
About this problem, it's very unstable, sometimes it won't show up. but sometime, it's show up again and again. it's very weird, seems this issue has been fixed after the 2.1.1. but now I use the latest version, namely 2.2.0. there still exist this kind of issue.
I also longed the TransportTimeOut time from default 5 seconds to 15 seconds. Now I am building and deploy it to our server to have a test
@BraveIT Any developments on this issue? I am experiencing the same issue with SignalR Redis backplane using Autofac as dependency resolver. The issue only appears once I use resolver.UseRedis();
I have setup a side project where I use basic SignalR and Autofac and I introduced the Redis scaleout. Strangely, in this project it works without any issues.
Basically, this is the same code, in the same order. (the only difference is that in the project where it doesn't work I have also WebAPI. https://github.com/radu-matei/SignalRDependencyInjection
Any development in this issue would be great.
Thanks!
+1
@niemyjski, @BraveIT Make sure that your packages are up-to-date. For example, I am using Autoafac and WebAPI and my Autofac.WebApi2
integration was not up-to-date. Simply updating this package made the connection issues go away. Hope this helps!
I'm running all the latest packages.
Thanks -Blake Niemyjski
On Mon, Sep 21, 2015 at 11:20 AM, Radu Matei notifications@github.com wrote:
@niemyjski https://github.com/niemyjski, @BraveIT https://github.com/BraveIT Make sure that your packages are up-to-date. For example, I am using Autoafac and WebAPI and my Autofac.WebApi2 integration was not up-to-date. Simply updating this package made the connection issues go away. Hope this helps!
— Reply to this email directly or view it on GitHub https://github.com/SignalR/SignalR/issues/3148#issuecomment-142032676.
Do you install StackExchange.Redis.StrongName
as a dependency when installing Microsoft.AspNet.SignalR.Redis
? I found that when I don't install this, this behavior appears. Best of luck. (and the application continues to work even after I uninstall it - I can't keep it since I have StackExchange.Redis
already as a library and keeping them both causes conflicts).
Yes
Also, make sure that the Redis instance you are using is not part of a cluster, since it wil bounce messages from one instance to the other (using a cluster for pub/sub also caused me some tens of thousands of errors)
Experiencing the same issue with a new JavaScript client app. and SignalR 2.2. Happens whether or not a transport protocol is specified
Experiencing the same issue with version 2.2.0 now. Previously I experienced less problems with version 2.0.0. Now the production server is completely useless. All connections to the clients get dropped after one or more hours, resulting in the same error.
Did v2.1.1 help for you or not? Might downgrade perhaps those libs
In my case, it turned out to be an oversight, albeit, not a very straight forward oversight.
In my server initialization code, I specified a SQL connection string, in order to use MS SQL as my backplane. The problem was, I forgot to create the database specified in my connection string. Once I created the backplane database, no more errors. I thought I would have seen some kind of error in my server code but that wasn't the case.
I had this same issue using version 2.2 where it would fail with the error "No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization."
I found a StackExchange question (http://stackoverflow.com/questions/19848605/signalr-2-long-polling-protocol-request-actually-times-out-when-not-ran-locall) which was able to help me resolve the issue by increasing the timeout in both the JavaScript:
$.connection.hub.transportConnectTimeout = 3000;
and in my C# startup code:
GlobalHost.Configuration.TransportConnectTimeout = TimeSpan.FromSeconds(10);
I haven't experimented yet to see how short of a timeout I need or whether both timeouts are needed.
I have the same issue with version 2.2.0. I have tried the fixes from @cjprieb without succes.
Long time I belived the error I got was somehow related to SignalR, but finally it was caused by the "browserlink" "feature" in newer versions of VS.IDE (2015 in my case). If you test outside your IDE calling your web app and the error is gone, it is very likely an issue with "browserlink". To disable / enable browserlink, see Using Browser Link in Visual Studio 2013.
I can reproduce this error by turning on redis scaleout in the startup of the signalr server (v2.2.2). When turned on, no transport can be initialized. I'm using the following code:
RedisScaleoutConfiguration config = new RedisScaleoutConfiguration(ConfigurationManager.ConnectionStrings["RedisConnectionString"].ConnectionString, "website"); GlobalHost.DependencyResolver.UseRedis(config);
The connectionstring looks like this:
<add name="RedisConnectionString" connectionString="localhost:6379,ssl=False,abortConnect=False,connectTimeout=30000,SyncTimeout=15000"/>
I'm using Stackexchange.Redis.Strongname v 1.2.3
It's odd, because this exact same configuration did work on azure. We recently moved from azure to a VPS, with windows server 2016.
@elgerm - Are you sure SignalR is able to connect to Redis? I did run SignalR with Redis Scalout both locally and on Azure and did not encounter this problem.
@moozzyk Locally and azure yes, it works, but not on the VPS running 2016. I'll investigate further this weekend, the connectionstring I mentioned above is the same for redis caching in the API (stackexchange.redis) as for scaling out, I can confirm Redis is working fine with web API on the VPS, only signalr stops working when I uncomment the config section.
I'm getting the same issue in 2.2.2 (and it appears randomly), but everything was working perfectly during at least last 3 years before I implemented Scaleout with Redis I added the latest NuGet package Microsoft.AspNet.SignalR.Redis with StackExchange.Redis.StrongName (1.1.608) And setup it in the same order as described here But in my case Redis is standalone on Linux (not in Azure), website with SignalR on Widnows Server 2012 The issue appears randomly
+1 on 2.2.2
00:00:31.8838066 - XXXX - WS Connecting to: ws://localhost:8000/signalr/connect?clientProtocol=1.4&transport=webSockets&connectionData=[{"Name":"eventNotificationHub"}]&connectionToken=XXXXXX
00:00:36.8940132 - XXXX - WS: OnClose()
00:00:36.8950154 - XXXX - Auto: Failed to connect to using transport webSockets. System.TimeoutException: Transport timed out trying to connect
00:00:36.8960190 - XXXX - SSE: GET http://localhost:8000/signalr/connect?clientProtocol=1.4&transport=serverSentEvents&connectionData=[{"Name":"eventNotificationHub"}]&connectionToken=XXXXXX
00:00:36.9256022 - XXXX - SSE: OnMessage(Data: initialized)
00:00:41.9074870 - XXXX - Auto: Failed to connect to using transport serverSentEvents. System.TimeoutException: Transport timed out trying to connect
00:00:41.9255364 - XXXX - LP Connect: http://localhost:8000/signalr/connect?clientProtocol=1.4&transport=longPolling&connectionData=[{"Name":"eventNotificationHub"}]&connectionToken=XXXXXX
00:00:46.9311243 - XXXX - Auto: Failed to connect to using transport longPolling. System.TimeoutException: Transport timed out trying to connect
00:00:46.9562573 - XXXX - Disconnected
00:00:46.9567600 - XXXX - Transport.Dispose(XXXX)
00:00:46.9580938 - XXXX - Closed Exception thrown: 'System.TimeoutException' in mscorlib.dll
Any help is very much appreciated.
cc @anurse
@FabioGCMagalhaes can you collect server-side traces using the instructions here: https://docs.microsoft.com/en-us/aspnet/signalr/overview/testing-and-debugging/enabling-signalr-tracing ? You can log traces to the Windows Event Log or to Text Files. Once you've got a trace, can you share it on this issue (preferably via a Gist to avoid a long comment here on this thread). Also, when configuring tracing, I suggest using the <sources>
section from this config because it has more detailed tracing enabled: https://gist.github.com/moozzyk/5abdc2ff439c179832e143c6a72a3e0a
That will help to identify what is different about your scenario and why we can't reproduce it. Generally the error you are seeing (failing to connect any transport) happens because some error is happening on the server that isn't being exposed to the client.
@anurse Thanks for getting back to me!
I ran my server outside of the Service Fabric to be able to expose all that was going on inside and was able to figure out my problem. I was using GlobalHost.DependencyResolver.UseSqlServer(connectionString);, and connecting to a SQL Azure DB that was launching a System.PlatformNotSupportedException. Changing the DB to a non SQL Azure worked instantly.
Glad to hear you got it sorted out!
I'm going to close this issue as I don't see any further action items or questions here. For anyone on this thread who is still having an issue, feel free to open a new issue or comment further on this issue if you need assistance!
@AndreyGrunyov If you are still seeing an issue, can you collect server traces (see my comment above) and open a new issue for that? I just don't want it to get lost in this long thread :)
Hi Guys, some good tips in here. However, we are having this issue still and a high frequency. We are running our instance of Redis (v 4.4.2-35) and signalR (v 2.2.1). Any help on how to resolve this issue is appreciated.
SignalR Error: No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization.
at InitHandler.transportFailed[angular]
(anonymous) @ angular.js?3437:14195 angular.js?3437:14195 Could not Connect!
Have you collected the server traces I referenced above? This issue is generally masking a server-side issue that's preventing the transports from initializing, thus causing the client to fail to find a working transport.
Thank you @anurse ! We are enabling the traces tonight and will send it in the morning.
@anurse Here is what we see in the logs:
"_index": "cwl-2018.02.12",
"_type": "prod2",
"_id": "33862482539801661846243226071627628985197178478719664128",
"_version": 1,
"_score": null,
"_source": {
"Message": "OnError(a4f23c26-c11b-4a4c-8804-c74e67e73c9c, System.Net.WebSockets.WebSocketException (0x80070026): Reached the end of the file\r\n at System.Web.WebSockets.WebSocketPipe.<>cDisplayClass9_0.
More captures of the error SignalR.txt
Good morning @anurse! Did you have a chance to review the trace? Is the information provided enough to do a first analysis? Thanks in advance for your help.
This is an error that occurs external to SignalR. Something is terminating the underlying TCP connection out from under the WebSocket, hence the "end-of-file" error. As an example, see https://github.com/SignalR/SignalR/issues/3823 (though it could be something else causing the issue on your machine).
Thanks @anurse . Appreciate your feedback. I looked at the example and confirmed that we do not run \ have a firewall. Will do some more digging.
If you are using react or react-native, being connected to chrome-debugger can cause this issue as well!
I'm using MVC5 and SignalR 2.1.0 & Chrome 36 The following is my javascript code in webpage:
The following is auto generated script by ASP.NET & SignalR
It worked before, and now work sometimes, but most of the times the following error concurred:
The following is SignalR log: