-
Notifications
You must be signed in to change notification settings - Fork 0
error! xhr poll error #1
Comments
Hey, sorry for the long delay in getting to this. This seems to be caused when Streamtip's server has a lot of connections, and their own code just ignores the error and tries to reconnect, so that's all I'm going to do. You may still see multiple connected/authenticated events, but xhr ... won't throw an error now. |
This still causes problems actually and I don't like just ignoring it as a 'solution', reopening. |
I made some modifications to our nginx upstream configuration, as I believe some 0 content length responses on socket.io are causing nginx to think an upstream is encountering issues when it isn't. Please let me know if this helps (it appears to have on my end). |
@night I'm still getting many errors, and am struggling to connect and auth. After several minutes, I usually connect/auth. However, this usually lasts only a few seconds at most before the I'm running on a BuyVM VPS with Ubuntu 14.04 and Node.js 0.12.2. |
I cannot reproduce that, unfortunately. I've tested this locally with node 0.12.0. I also tested this on a BuyVM VPS running Debian 7 with node 0.10.38, and did not encounter this issue. I think there's something funky going on with your connection. Can you "curl -vvv https://streamtip.com" and see what's going on? It sounds like you're unable to connect, which I've encountered before when setting the VPS' main IP to be one of their DDoS protected IPs (although in that instance I was having trouble connecting to api.twitch.tv). |
Curiously, running this code on a DigitalOcean droplet results in far fewer xhr errors. They're still happening, but once every 10-20 seconds or so instead of constantly. |
Is your BuyVM IP 198.98.50.142? If so, nginx is logging your requests as the following:
I'm not sure why your requests are resulting in this error, so it will probably require more debugging. |
That is indeed my BuyVM IP. |
I'm curious if there is a misconfiguration on your end, since every failing request is only websockets. Is there something on your end blocking websockets? Websockets require HTTP 1.1, so if your client or something in between doesn't support that, it could be why it's failing. |
What changes if you enable multiplexing and modify your transports like the following:
|
There shouldn't be much room for misconfiguration. This BuyVM VPS is pretty bare. It's got node installed and I'm running NodeCG via PM2. Nothing else. NodeCG itself also uses Socket.IO for all its communication and that does not have issues. I can try wiping the VPS and starting fresh if you think it's a worthwhile route of investigation. Enabling multiplexing and modifying my transports did not seem to make a difference. Curiously, even if I removed |
If you're only testing in an environment with nodecg running, perhaps you should isolate with just this package. Additionally, client logs would be helpful. Debug instructions are here: http://socket.io/docs/logging-and-debugging/ You can debug like:
|
You're right, step one should have been isolating to just this package and trying that. Not sure why I didn't have the presence of mind to do that. Unfortunately, I'm getting the same error. Here's a gist with the debug output from a few seconds of script execution time: https://gist.github.com/Lange/cd70db7f1588096b68d2 |
Are you sure the correct version of socket.io is being loaded? Sometimes if you have a package in ~/node_modules node will prefer that over the node_modules in the app dir. |
There is no |
The socket.io in use by Streamtip is lower, 1.2.1 |
Manually installing |
It's unfortunate, but I couldn't tell you why you're having issues connecting. Maybe try downgrading from node 0.12.x to 0.10.x, or trying a different server completely. I've tried your client id and access token, and haven't been able to reproduce any issues over at BuyVM or locally. |
I've seen the error a handful of times locally and once on my vps (81.4.106.145 if it helps, all subsequent tests connected first try), but it's usually just shown once, socket reconnects, everything's fine, not continued errors. |
I tested on 0.10.38 on my BuyVM VPS this morning, no luck. I'm doing more tests on another DigitalOcean droplet and I'm having very few, if any, |
@MattMcNam Those dropped connections should be what I resolved earlier, as nginx was failing over an upstream if it returned a 5xx error (by default max_fails is set to 1 apparently). Please let me know if you are still seeing this issue often. Seeing it once in a while is normal, as sometimes updates are pushed or an uncaught error occurs (like in net calls in PayPal's sdk, for example) and requires node instances to restart. @lange I still have a good belief there's something funky going on with the connection, somewhere. Either the protocol isn't being sent properly or for some reason a websocket cannot be established. I read over the source code that returns a "transport error," and seems to only happen when there's a socket error. Maybe you can try experimenting with what you connect to. Change "https://streamtip.com" to the following:
|
Interesting results:
All the entries with a checkmark connected immediately and didn't show any xhr errors during the time I observed them, which was about 60 seconds each. |
This definitely seems like a configuration issue somewhere, as the IP addresses provided point to the two nodes Streamtip uses. I'm curious if there's some sort of reverse proxy (or something similar) empoyed that doesn't support the websocket connection and is causing it to be blocked. You might also check that the DNS is resolving properly to the listed IPs. There's definitely something wrong, but I don't believe it's an issue on Streamtip's end (as I can't seem to reproduce this). |
My VPS appears to be able to correctly resolve the address of streamtip.com, so perhaps we can use that as a workaround in the library. @MattMcNam, would it be a good idea to have streamtip-listener resolve the IP of streamtip.com on startup and connect the socket to the IP directly? |
Since this seems like a socket.io-client library issue, I'm not sure working around a bug is a good idea. Perhaps if you can reproduce the conditions needed to make this occur, then it could potentially be traced and fixed. Were you able to reproduce this on DigitalOcean? What about another virtual machine (or the same reinstalled) at BuyVM? This appears to be the same issue: socketio/socket.io#1942 |
I am receiving the following error over and over:
connected!
authenticated!
error! xhr poll error
connected!
authenticated!
error! xhr poll error
connected!
authenticated!
error! xhr poll error
connected!
authenticated!
error! xhr poll error
connected!
authenticated!
error! xhr poll error
connected!
authenticated!
error! xhr poll error
connected!
authenticated!
error! xhr poll error
The code I am using is directly copied from the example.
The text was updated successfully, but these errors were encountered: