wordpress err_connection_reset in Chrome from specific country - php

I volunteer supporting a news website in Russia, which was hand-crafted in PHP back in 2002-2004. Needless to say, I was super excited when editors hired some folks to build a new version, based on WordPress.
The old site is running on mydomain.press. I put the new WordPress version, which is meant to replace the old one, on subdomain.mydomain.press.
And there's a mysterious problem with it.
When an editor is trying to access the site at subdomain.mydomain.press, her browser (Chrome in Russia) instantly reports err_connection_reset, in 9 cases out of 10. Not spinning trying to load the site - an instant error is reported.
On my machine (Canada) the same website opens no problem. Well, a little slow (hence I mentioned she's not even seeing the delay - the error is instant), but it opens in 10 out of 10 trials.
When her Chrome gets the content (in that 1/10 case), it also shows a slight delay. Only the error case is instantaneous. The old site at mydomain.press is opening 100% of the time.
Connecting remotely to her Windows machine (I'm using Mac OS X) via TeamViewer, I did observe the behaviour described when using Chrome. Interestingly enough, IE didn't show this problem - it loads consistently, except that once in ~10 reloads the page loads with a garbled styling. As if some css isn't loaded properly (but not in a way that would make it an invalid document, obviously).
I'm completely out of my depth. I tried disabling her Windows Defender to see if it's the culprit - nope. I've tried to reset her IP address (as suggested by the same page which offered the earlier way to try and fix the err_connection_reset) - no dice.
I'm not seeing either error from my own Chrome, nor the garbled css (though I didn't try with IExplorer from Canada).
I know they had some ISPs in Russia block them (silly political reason, AFAIK) in the past - but this doesn't look like blocking; she'd be 100% unable to view it otherwise. She's not under any firewall (nor is the website).
what else... nginx is the server used, the setup is "basic", I suppose (I'm not that proficient in configuring it to try anything fancy).
And to make things even more mysterious - the website at mydomain.press (the old version, php-hand-crafted) is opening just fine, 100% of trials.
Opening using the IP-address doesn't change the picture, so doesn't look like a DNS issue.
Any ideas?

There is an ongoing battle of Roskomnadzor against Telegram messenger in Russia, which affects subnets, DNS and DPI hardware around the country. Try to connect via proxy or VPN server outside Russia and see if the problem goes away.

Related

Images Fail to Load, net::ERR_CONTENT_LENGTH_MISMATCH

Problem
When you load up a page on my site, often times one (or several) images (jpg files that I have saved from Lightroom and/or Photoshop) will not appear. It instead looks like a broken link (ALT description appears) but no image. Hard reload of the browser solves problem (e.g. all images load properly after a hard reload).
Error Message
Chrome displays an "ERR_CONTENT_LENGTH_MISMATCH" warning for all images it does not load. (Sometimes the image will flash quickly before going to what looks like a dead image)
Setup
Running latest version of Wordpress (4.2.2) on a Shared Host. Site is SSL (https) if that matters. Images are located in an image upload folder (nothing complex like Imagemagick, etc) on the host.
My Troubleshooting
I have replicated the issue from multiple locations using various ISPs on various machines (both Mac & PC) and with various browsers (Chrome & Safari) some of which are not using any ad-blockers.
What I've tried is the following:
I asked the host if there was an issue on the server side. They claim no.
I've tried resetting the functions.php file. No impact.
I've disabled all plug-ins. No impact.
I've hardkeyed in the meta charset as UTF-8. No impact.
Checked if I'm using Gzip. I am not.
Enabled Wordpress Cache plugin. No impact.
Cleared .htaccess of all non-necessary redirects & commands. No
impact.
Replaced wp-admin and wp-includes folders from fresh install. No
impact.
Deleted Wordpress & Reinstalled from a Backup. No dice.
I've put source code from pages that have this issue into a test.html file and the images seem to load up fine doing that.
My Thoughts & Questions
The images are 100-200kb each and sometimes there are a fair amount of them on the page. Is something timing out and then once I hard reload, everything show up because the timeout isn't tripped? That is the best random guess I can gather without understanding the issue perfectly.
Any ideas of things I can try? Should I delete the whole database and start again? Everything I know about computers is self-taught and server issues are not a strong point for me. Even if you don't know what it might be, could someone explain what a content length mismatch is in general terms?
Thanks much!
When you request data from a web server, it responds first with some information about the data (HTTP headers) and then with the data. One of these pieces of information, an HTTP header, is called Content-Length. It tells the client how much data it should expect to receive from the server. When your browser gets an image, the server's response (very simplified looks like)
Content-Length: 100000
< the image, 100000 bytes of data >
The client knows the request is complete when it has received the amount of data told by Content-Length. Until it receives in this case 100KB (100000 bytes), it considers the image, for example, to not be done loading.
If the server breaks the request before the client receives the data from the server, or if the client receives more data than it received, the client will throw some sort of error and assume the data to be corrupted/unusable and dispose of it. How this is handled can vary between browsers.
How did you upload the images to your website? Myself, I have encountered this problem in a situation where the file's supposed size was stored in the database, and this was used to set the Content-Length header. The file size in the DB wasn't correct for the file. HOWEVER, I know that WordPress does not store file sizes in the database; media uploads are simply represented by a URL.
This could also happen if the web server runs out of resources and can no longer fulfill your requests; you said you had lots of images per page. If you are on a really lousy shared hosting plan, it may be the case that the host imposes limits, or that the server simply can't handle the traffic of all the sites it hosts.
I wanted to circle back on this in case someone else is experiencing this problem. It appears that there is some type of glitch between HTTPS and image retrieval that was causing the problem. While I don't understand WHY that is, I converted my site from SSL/HTTPS to simple HTTP (which I was able to do as it doesn't require encryption) and it appears all images load as they should.
If someone understands the "why", I'd love to understand what the issue actually is. Luckily, I was able to come up with workaround. So, while this doesn't answer my question, it does provide context of what is causing the problem and my common sense workaround.
You might see this problem with a shared hosting service. Free bandwidth is like free speech, not free beer. Resource outage policies are invoked during traffic spikes.
A distributed system architecture solves this by inserting a front-end CDN tier (eg. CloudFlare). CDNs cache your static resources and can vastly reduce the load on your host. In fact, for completely static sites the host can be shut down.
There are other advantages to CDNs, like attack detection, free SSL (not beer) and overall improved performance and security compared to shared hosting alone.
Many CDNs are free (as in speech). You could also upgrade to private hosting, but $ and you still might want a front-end tier.

PHP page loads partially

I have a couple of websites which load no problems on almost every computer/device I have tested them on. However, when I try to load certain pages within either of these sites on my work PC from within the corporate network both websites produce some but not all of the HTML output. They both stop at the same point each time. There are no errors reported from PHP.
If I use my work PC but disconnect from the corporate network and tether my phone to the PC I can again load the page no problems.
My question is, what settings within the corporate network would likely be causing this partial HTML output? I am assuming some kind of time-out (although the fact that they always stop at the exact same point of their output suggests something more like a length issue). What I really need to do is understand how I can replicate the issue on my dev computer so that I can put in some handling for when the issue might appear. Any ideas?
Thanks.
Should be the proxy or caching setting of your corporate network.
You can check by inspecting the header of the http responses, for Chrome you can go to Network panel in Developer tools and check individual requests and responses.
You are most likely not seeing the error because there is no error. I'm thinking that you are using a exit() function which is not showing rest of the page, you may have an if statement which is stopping the computers from corporate network accessing the rest of the page.

Sites up and down Intermittently with 'No data received' Error code: ERR_EMPTY_RESPONSE

I'm not very technical so apologies up front! Unfortunately, I've been left to figure this out though as the company who deal with my dedicated server are being less than helpful.
Really hoping someone can shed some light on this. We host around 100 websites and currently, all sites on our server are up and down like yoyos. There doesn't seem to be a pattern - it's very sporadic and intermittent. Usually, you can just click around one of the sites, for example www.innivo.com for a few mins and you’ll see the site drop out, and then after a few refreshes, it will come back, then back down – you get the idea.
In Chrome, I get: No data received
Unable to load the web page because the server sent no data.
Error code: ERR_EMPTY_RESPONSE
In Firefox I get:
The connection was reset
The connection to the server was reset while the page was loading.
The site could be temporarily unavailable or too busy. Try again in a few moments.
If you are unable to load any pages, check your computer's network connection.
If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web.
The server doesn’t go down completely, it just doesn’t seem to serve the page. This also agrees with the firewall theory I mentioned on the call.
We have paid a lot of money to a security company who have removed a few bits of malware in the hope that it would fix the problem, but they now say that the server is completely clean and exploit free. My service provider is saying they won't help until I upgrade PHP on the server but although I'm going to do this, I'm pretty sure that this won't fix the sites dropping out all the time.
I found this post which describes EXACTLY what is happening, but he doesn’t really say how to fix it, or even if his ever got fixed but it’s the closest thing I’ve found!
http://progblog10.blogspot.co.uk/2013/09/modsecurity-causes-sporadic-no-data.html
I looked for this on the server but mod_security didn’t seem to exist otherwise I would have tried to disable it to see if it made a difference. I think though, that this firewall theory sounds plausible. I wonder if we have some other type of firewall which was maybe activated or updated when we updated CPanel last week.
I'm running WHM / CPanel / Apache
Any help would be massively appreciated. Hoping that this has happened to someone else!
My personal experience. I have xplornet. I was unable to access a local site with none of my browsers. I have my computer, my Hughes, my printer, my monitor all plugged into a power bar. I shut off the computer, Unplugged everything including the plug in on the back of the hughes. Left it for a few minutes then plugged everything back in into different outlets on the power bar. I was able to access the site after that. Why I have no idea but it worked.
ive been struggling with this error and i think i have found the solution . I ran my website on local host( MAMP ) . Its worked fine so i called my hosting provider and they said i needed an upgrade cos my existing account did not support simultaneous connections . So i upgraded and its perfectly working

Drupal Load Balancing

So we have a drupal 6 website that is running good, but now we want to prepare it for a lot of traffic, so the next step is to have 2 web servers running the same site (the database is already running on a separate server) and then use a another server to do the load balancing between those 2.
So yesterday i mirrored the files of the original drupal server (that runs at lets say www.example.com) to the new server (that runs at lets say 123.123.123.123 - just an IP, no domain), than i edited the settings.php file of the second one to make sure that the base url is 123.123.123.123.
once i browsed to 123.123.123.123 to test out if the mirror of the site was working, i got a blank page.. looking at the source, the basic structure was there, but no content, and the CSS was pointing to the right place but still not showing.. I decided to browse to 123.123.123.123/admin/ and see what i could do.. went to the site performance and cleared the cache, didn't do a thing but then i noticed the original drupal was now showing blank... so i went to www.example.com/admin/, cleared the cache also, site was back, but it appeared the menu router was destroyed because i was getting "page not found" everywhere. So i went to the modules page and clicked save hopping that it would rebuild the menu router. It did the trick, site was back online and working good.
Obviously i stopped poking around with 123.123.123.123 and decided it was time to ask for some help from the experts...
What am i doing wrong? Any help would be greatly appreciated!!
Julien
I don't think that out of the box you can do this with D6.
There are a couple of things which will catch you out.
Settings are stored in the database so if your servers are not identical one server will not work.
The database is not set up to work with more than one server accessing it. This could cause race conditions or deadlocks.
Uploaded or generated files will not be mirrored on both servers so files will be missing.
Probably other things too but this is enough to be going on with.
So you have two options:
Go with something like pressflow which is D6 compatible and has options for working on mirrored servers.
Configure your server to handle the load.
Configuring your server may be a good starting point. Here are some tips
make sure Drupal caching is turned on
Use an optcode cache like apc, see some benchmarks here
Install cache router module to use apc for Drupal's cache
install Boost module
There is a much more in depth article here
I would suggest reading the article and doing everything you can on one server. While it is possible to go to 2 or even 200 servers it adds a lot of complexity to your system.

Ajax features broken across browsers (on one machine)

I have built a CMS system using jQuery and PHP, it has worked consistently for multiple users across different platforms over the past year or so.
Today as I was presenting it to a potential customer over the phone he ran into a problem in Internet Explorer 8, for some reason he was not able to log in to the system so I created a dirty hack to allow him in without authorizing, this allowed him to see the interface, but again, all features were still broken when it came to XMLHttpRequests, this puzzled me so I guided him through a Firefox 3.6 install over the phone with the same result, I have since checked with friends and family at remote locations and across platforms and they seem to be able to do everything he could not I have run out of ideas, so here is the question:
Has anyone ever run into this same problem and how did you solve it?
Update: I know JavaScript works, some of the other features works as intended, I have also checked for lingering console.log etc that could screw up the results, its all clear.
There are thousands of possible reasons, 2 that immedatly come to my mind are:
His/His companies Firewall might block those requests
He might have disabled scripts in IE8 and maybe firefox imported this setting (don't know about that)
Javascript and/or some of outbound requests may have been disabled completely or partially filtered by your customer's firewall/IPS/IDS.
Disable JavaScript and try to reproduce the problem on your machine. If result is the same - that's your problem.
It turned out that the issue was with an aggressive anti-virus program and he had checked the option to "Secure my privacy", part of that "Security" was to delete new cookies.

Categories