calzoneman / sync

Node.JS Server and JavaScript/HTML Client for synchronizing online media
Other
1.47k stars 232 forks source link

Connection Issues #226

Closed awused closed 11 years ago

awused commented 11 years ago

Well it happened again.

I'm not sure exactly what happened, but it failed to load http://cytu.be/assets/js/swf.js and http://cytu.be/assets/js/iourl.js.

This time I did not try clearing the cookies and it eventually timed out after ten minutes. Manually entering those links into Chrome didn't work but Opera did. After some indeterminate amount of time I tried refreshing Chrome and it loaded without issue and logged me in with my cookie.

Will update with more information if/when it happens again.

nuclearace commented 11 years ago

How many other people have told you this is happening to them?

awused commented 11 years ago

Two others for sure. Might have been one or two more as one of them told me in mumble and I gave him instructions to fix it. I'm not sure if there were a few other people chiming in with "me too"s there. I'm assuming they had the same issue

calzoneman commented 11 years ago

Did this happen before my patch from Saturday? If so, it might be a cloud flare issue

calzoneman commented 11 years ago

@Suwako which ISP do you use? Those scripts are served from the same web server as everything else but perhaps cloud flare is throttling you for making requests too quickly or it thinks you are a threat or something

awused commented 11 years ago

I doubt it. This usually happens first thing in the morning. Also I run Naoko off of a VPS that is completely separate from me and she does not have these problems.

calzoneman commented 11 years ago

But Naoko isn't downloading the client side js from the web server...

calzoneman commented 11 years ago

I just find it very odd that those two files would fail but not the others.

awused commented 11 years ago

I think it's more a symptom of something weird than the actual problem. It's happened enough that it's not some one-off fluke. I wish I could get more details from the other people I know who have run into this issue.

At least one sent me a Steam message with "What's been going on with Cytube? It's been down for days" because he couldn't get in. I told him to clear his cookies and try logging in in a different browser first. Wasn't sure which thing worked for him, either should have had the same effect of invalidating the token, but he was able to get in after that.

calzoneman commented 11 years ago

I am going to try turning down the security settings on cloud flare. The reason I suspect it is (1) I see threat reports on the cf control panel and (2) I have not heard of this issue happening on 6irc which is not behind cf

calzoneman commented 11 years ago

I wonder if perhaps cloud flare has something to do with the cookies too since as I explained I only set cookies for session data

awused commented 11 years ago

Well after a surprise BSOD out of nowhere it happened again. It is consistently those two files.

Also if I try going to cytube.calzoneman.net/?channel=animu it won't even try to load swf.js, it'll just get stuck on iourl.

Also clearing cookies and logging into another browser was just a placebo and had no effect this time around. Clearing Chrome cache also did nothing. Opera loads without issue. Firefox doesn't work even though it wasn't logged in or anything.

calzoneman commented 11 years ago

I don't think this is a code problem. I am not doing anything tricky with the script loading and if there were a code problem I would not expect it to behave this way (consistently happens to only certain individuals). I will look into my web configuration when I get a chance.

awused commented 11 years ago

And now they both work in Chrome and Firefox, at the same time.

I am better there's some web trap or pitfall Chrome and FF are getting stuck in that Opera dodges for some reason. I haven't looked at the code, maybe some redirects are weird?

Even with http://cytu.be/r/animu a good number of things are still 302 redirects.

calzoneman commented 11 years ago

I haven't observed the requests myself, perhaps you could pastebin them since I'm on mobile this week. Perhaps there is a common extension among people who have this issue? The chromium and Firefox installations on my dev system are pretty vanilla.

calzoneman commented 11 years ago

Oh yes I remember all of the js files come from ./ which gets redirected to /

awused commented 11 years ago

My Chrome is completely vanilla, my FF only has firebug.

calzoneman commented 11 years ago

But that doesn't break any browser I've ever used so it must either be an extension issue or something on my end

awused commented 11 years ago

I think it might be something in the middle.

I have noticed, but can't confirm if it actually helps, that letting the two requests timeout (with 504 errors that take 10-20 minutes) seems to shock the site into working. Possibly started it working for my friend on Steam too; he was having trouble and at about the same time as I could he started being able to connect.

That makes it seem like a caching issue of some kind with Opera somehow ignoring it or automatically bypassing it if it's unresponsive.

calzoneman commented 11 years ago

Perhaps related to https://support.cloudflare.com/entries/22052913-Why-am-I-getting-a-cloudflare-nginx-502-or-504-gateway-error- ?

calzoneman commented 11 years ago

Also, if the people having the issue are geographically close, I would suspect a CDN issue

awused commented 11 years ago

https://support.cloudflare.com/entries/22052913-Why-am-I-getting-a-cloudflare-nginx-502-or-504-gateway-error-

Yeah it's probably this. I'm not sure why Opera would dodge it, but this sounds like it.

calzoneman commented 11 years ago

Well perhaps the Opera thing is due to User-Agent. According to that article you should complain to them with the output of trace route to http://cytu.be and the result of http://cytu.be/cdn-cgi/trace

calzoneman commented 11 years ago

I just got a 504 timeout on a channel from my location. Don't have a computer here or I'd try to complain. Ill see if I can report something to cloudflare

calzoneman commented 11 years ago

@suwako if you can get me a tracert to cytu.be I will see if I can open a ticket with them

awused commented 11 years ago

I already opened a ticket based on Naoko's traceroute since she just ran into the issue earlier. Also built a cache in Naoko so she won't constantly pull down io_url.js if she has a working one. It'll also help her dodge issues like this in the future, not that they're very likely.

Here is her traceroute, though it's probably better if you pull up your own for your own submission.

traceroute to cytu.be (108.162.196.123), 30 hops max, 60 byte packets 1 192.168.105.3 (192.168.105.3) 0.546 ms 0.639 ms 0.815 ms 2 10gigabitethernet7-6.core3.fmt2.he.net (65.49.10.217) 2.031 ms 1.991 ms 1.980 ms 3 10gigabitethernet10-1.core1.sjc2.he.net (184.105.222.14) 9.279 ms 9.295 ms 9.175 ms 4 equinix.xe-2-0-0.cr1.sjc1.us.nlayer.net (206.223.116.61) 1.740 ms 2.486 ms 1.784 ms 5 ae1-40g.ar2.sjc1.us.nlayer.net (69.22.143.118) 7.882 ms 7.857 ms 7.782 ms 6 as13335.xe-8-0-5.ar2.sjc1.us.nlayer.net (69.22.130.146) 24.845 ms 112.177 ms as13335.xe-9-0-2.ar2.sjc1.us.nlayer.net (69.22.153.74) 112.245 ms 7 108.162.196.123 (108.162.196.123) 2.405 ms 2.357 ms 2.329 ms

curl http://cytu.be/cdn-cgi/trace fl=4f10 h=cytu.be ip=173.255.221.202 ts=1374630215.493 visit_scheme=http uag=curl/7.26.0 colo=SJC spdy=off

calzoneman commented 11 years ago

I opened a ticket as well after running into the issue from vacation wifi

calzoneman commented 11 years ago

Cloudflare's twitter has reported that they resolved issues with SJC and IAD data centers. Further issues should be brought up with them.

awused commented 11 years ago

As of right now the issue is still occurring. Response from cloudflare:

Hello,

When curling this asset on CloudFlare, there is a MISS at first. CF-Cache-Status: MISS Curling the same resource: http://cytu.be/assets/js/swf.js showing Cache-Control: public, max-age=0 Are you using Varnish caching?

I am able to curl the domain through the datacenter in SJC and the specific machine shown..

We are seeing a number of error messages however in SJC.

upstream timed out (110: Connection timed out) while reading response header from upstream

GET /assets/js/iourl.js HTTP/1.1

Can you check the server logs and I will also check with our engineering team for any issues.

Thanks in advance

awused commented 11 years ago

I think you should turn off cloudflare for a few days since these issues seem to be widespread right now. Checking their twitter shows a lot of people with what look like the same problems.

calzoneman commented 11 years ago

@Suwako please try using http://cftest.cytu.be temporarily to see if this resolves your issue. If it does, then we know for sure the problem is between me and cloudflare.

How long has this been happening? The domain has been behind cloudflare since May.

calzoneman commented 11 years ago

Can you ask if they have similar errors from other colos?

calzoneman commented 11 years ago

Actually if there's a way to continue the thread on my account (calzoneman@gmail.com) that would be preferable because I have some questions for them

calzoneman commented 11 years ago

Can I assume by your lack of response that the URL provided above worked? If so, I'd like to contact Cloudflare about it.

calzoneman commented 11 years ago

@Suwako any news?

awused commented 11 years ago

Oh right. Wasn't logged in to my email that I get github alerts on. Anyway the connection issues seem to be fixed for now, even on Cloudflare.