Wordpress Intermittent Database Connection Error - Blog

WordPress Intermittent Database Connection Error

By admin 0 Comment March 5, 2019

WordPress intermittent database connection error

We are running Windows SQL Server 2012 Standard on Windows Server 2012. There is a SQL Database with an Access Front End which we migrated from older versions of Access and SQL. The Access front end communicates with the database most of the time without a problem. However, sometimes Access just stops responding and then the user gets the following error:

The person who maintains the Access and the SQL Databases provided the following summary: The spontaneous issue affects everyone connected to the SQL Server at the same time, and manifests itself in a slow or non-existent connection. It resolves itself in a few minutes to a few hours. The ODBC trace did not yield any useful information about the problem. We tested with up to 5 simultaneous users with no problem. When we observed the issue of Friday, only four users were in the database, and closing these connections did not immediately resolve the issue. There appeared to be no problems with the network for file system access to the server during the down time.

Based on this information, it definitely is not an issue with MS Access, the ODBC configuration, or the database structure. It appears to be an intermittent connectivity issue with SQL Server itself, perhaps due to configuration problems, licensing (as you mentioned), conflicts with other software/processes, or due to some other SQL Server process. Unfortunately, this is outside of my expertise and we do not have dedicated SQL Server or IT resources.

I had another IT Person look at the issue, he found the following:

Sally’s PC was getting SQL error. Logged into her PC to look at it (logged in as Sally and as cleAdmin ).

Looked at server name, want to verify that in the Control Panel > Adminstratrative Tools > ODBC > Connections There was no odbc connections under User DSN, System DSN or Fie DSN

Created new System DSN connection Specified server:
CLE-VM-SQL-FILE\CLESQLSERVER

The rest were default values Clicked test and it was successful

Unfortunately, the problem started again soon after these changes were made.

It was suggested there could be a hardware issue, so we have replaced the switch and made sure the drivers on the Network Adapters are current. Plus we have never seen any indication of a loss of network connectivity while testing using a PING Test.

Has anyone else experienced this issue and if so, how did you solve it?

WordPress intermittent database connection error

When I connect to a 4G network, I keep getting an intermittent Error 400.

My ISP claims one of the following:

  • A machine problem (I tell them it happens on all machines)
  • A router issue (I tell them it happens when I connect directly to the dongle I’m using)
  • Geographical coverage! It happens in many places, but not as recurring as it is in my current location
  • How true is that?
  • Can location cause this specific Error 400?
  • What can I do to fix that locally if at all possible?
  • What can I tell my ISP technical care to help them figure it out (When they tried the dongle on their machine, it did not fire any errors!)

Note: I get that error on all browsers, and I got it on all systems (Windows 8, Windows 10, Android’s Chrome), but I cannot confirm yet if I get any of that on Skype, WhatsApp, or other services that use the internet).

Also note: I have other providers, when I switch to those other providers, I get no issues.

I use no proxy servers.

Extra:

Here is an example of what I get on fiddler: 326 The Server did not return properly formatted HTTP Headers. HTTP headers should be terminated with CRLFCRLF. These were terminated with LFLF.

Extra:

One website was generous to give me the following error message upon a 400 error, does it mean anything?

When I connect to 4g network I keep getting an intermittent Error 400

There are a number of different causes for a "400 Bad Request Error"

See below for some troubleshooting steps you can follow to try and resolve the issue.

  • Most of these are clients side issues.
  • The ones that aren’t are issues with the web server
  • They are unlikely to be caused by your ISP (but anything is possible).

How To Fix a 400 Bad Request Error

The 400 Bad Request error is an HTTP status code that means that the request you sent to the website server, often something simple like a request to load a webpage, was somehow incorrect or corrupted and so the server couldn’t understand it.

400 Bad Request errors appear differently on different websites so you may see something from the short list below instead of just "400" or another simple variant like that:

How You Might See the 400 Error

  • "400 Bad Request"
  • "Bad Request. Your browser sent a request that this server could not understand."
  • "Bad Request – Invalid URL"
  • "HTTP Error 400 – Bad Request"
  • "Bad Request: Error 400"
  • "HTTP Error 400. The request hostname is invalid."
  • "400 – Bad request. The request could not be understood by the server due to malformed syntax. The client should not repeat the request without modifications."

The 400 Bad Request error displays inside the Internet browser window, just as web pages do. 400 Bad Request errors, like all errors of this type, could be seen in any operating system and in any browser.

In Internet Explorer, a "The webpage cannot be found message" indicates a 400 Bad Request error. The IE title bar will say "HTTP 400 Bad Request" or something very similar to that.

Windows Update can also report HTTP 400 errors but they display as error code 0x80244016 or with the following message:

A 400 error that’s reported for a link within a Microsoft Office application will often appear as "The remote server returned an error: (400) Bad Request." message within a small pop-up window.

Cause of 400 Bad Request Errors

The 400 Bad Request error is oftentimes caused by entering or pasting the wrong URL in the address window but there are some other relatively common causes as well.

Note: Web servers running Microsoft IIS often give more specific information about the cause of a 400 Bad Request error by suffixing a number after the 400 as in HTTP Error 400.1 – Bad Request, which means Invalid Destination Header. You can see a complete list here.

How To Fix the 400 Bad Request Error

Check for errors in the URL.

The most common reason for a 400 Bad Request error is because the URL was typed wrong or the link that was clicked on points to a URL with a specific kind of mistake in it, like a syntax problem.

Important: This is most likely the problem if you get a 400 Bad Request error. Specifically, check for extra, typically non-allowed, characters in the URL like a percentage character. While there are perfectly valid uses for something like a % character, you won’t often find one in a standard URL.

Clear your browser’s cookies, especially if you’re getting a Bad Request error with a Google service.

Many sites report a 400 error when a cookie it’s reading is corrupt or too old.

Clear your DNS cache, which should fix the 400 Bad Request error if it’s being caused by outdated DNS records that your computer is storing.

Do this in Windows by executing ipconfig /flushdns from a Command Prompt window.

Important: This is not the same as clearing your browser’s cache (next thing to try below).

Clear your browser’s cache.

A cached, but corrupt copy of the web page you’re trying to access, but are getting the 400 error on, could be the root of the problem.

Clearing your cache is unlikely the fix for the majority of 400 bad Request issues, but it’s quick and easy, and so worth trying.

While this is not a common fix, try troubleshooting the problem as a 504 Gateway Timeout issue instead, even though the problem is being reported as a 400 Bad Request.

In some relatively rare situations, two servers may take too long to communicate (a gateway timeout issue) but will incorrectly, or at least unhelpfully, report the problem to you as a 400 Bad Request.

Contact the website directly that hosts the page.

It’s possible that the 400 Bad Request error actually isn’t anything wrong on your end and it’s something they need to fix, in which case letting them know about it would be very helpful.

Tip: If an entire site is down with a 400 Bad Request error, searching Twitter for #websitedown, as in #facebookdown or #gmaildown is often helpful. It certainly won’t contribute anything to fixing the issue, but at least you’ll know you’re not alone!

WordPress intermittent database connection error

What can I do to configure SSH on both client and servers to prevent Write Failed: broken pipe errors? It often occurs if you sleep your client computer and resume later.

10 Answers

I have tried this in /etc/ssh/ssh_config for Linux and Mac:

This is how often, in seconds, it should send a keepalive message to the server. If that doesn’t work then train a monkey to press enter every two minutes while you work.

You could set either ServerAliveInterval in /etc/ssh/ssh_config of the client machine or ClientAliveInterval in /etc/ssh/sshd_config of the server machine. Try reducing the interval if you are still getting the error.

Configuration for a single user can be set in file

/.ssh/config both on the server and client side. Make sure the file has correct permissions chmod 644

/.ssh/config. – H2ONaCl Dec 14 ’12 at 13:26

SSH sessions may break due to numerous and possibly unavoidable reasons.

A useful utility which can be used to mitigate problems caused by this is called screen . Screen is a powerful utility that allows you to control multiple terminals which will stay alive independently of the ssh session. For example, if you run screen in an ssh session you will see a new terminal open and you can use that to run jobs. Lets say your ssh session dies in the process. Running screen -d then screen -r will reopen the last session and you will be able to continue from there. Make sure you read some of the documentation before using it.

Client configuration

Try creating the file:

Add the contents:

Now ssh to your server and see if your problem is fixed. ClientAliveInterval option is only useful when configuring the ssh server (aka sshd), it does not change a thing on the ssh client side, so don’t use it in the above configuration file.

This will send a hello-are-you-there signal to the server if no packets have been received in the preceding 30 seconds (as specified above). However, if the number of consecutive hello-are-you-there signals reach ServerAliveCountMax then ssh will disconnect from the server. This value is defaulting to 3 (so 3*30 = 90 seconds without server activity), increase it if it suits your needs. There are alot more config options to the .ssh/config file and you could read:

For more information on other options. You may not want to apply this to every server you connect to which this example will. Or restrain it to only a particular server by replacing the line Host * with Host (replace by an IP address, see ssh_config man page).

Server configuration

Similarly you can tell the server to be gentle with your clients. The configuration file is /etc/ssh/sshd_config .

You can either deactivate it by setting ClientAliveInterval to 0 or tweak ClientAliveInterval and ClientAliveCountMax to set a maximum ssh client inactivity without responding to the probes. One advantage of this settings over TCPKeepAlive is that the signals are sent through the encrypted channels, so it is less likely to be spoofable.

WordPress intermittent database connection error

We have a just completed a migration from SQL 2000 to SQL 2008 R2 and have started to intermittently receive SqlExceptions with the following two error messages:

  • A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 – The semaphore timeout period has expired.)
  • A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 – The semaphore timeout period has expired.)

We have 3 web servers connecting to this SQL Server running around 100 applications (all accessing the same 8 databases on the SQL Server).

Because these exceptions were not occurring on the 2000 server, we feel like it is unlikely to be an application issue (however, we are not ruling it out). Traffic on the web sites is typical, ruling out a high traffic issue. The old SQL 2000 box had 4 CPUs and 8 GB RAM, while the new one has 24 GB RAM and 16 CPUs (which is currently and during the issue underutilized).

These errors occurred for a period of about 5 minutes several hours ago and have not as yet reoccurred.

The sys.dm_os_ring_buffers system view does not show entries for these disconnects, and there are no corresponding event log entries on either the server or the client.

Some googling has found a few similar reports, however nothing seems definitive(see links below). Has anyone seen errors like this after migrating from SQL 2000 to SQL 2008 R2?

We have tracked down and fixed this issue in our environment. The description as I understand it is below (please excuse potential inaccuracies below; This is the way I (as a software developer) understand the descriptions given to me by our Network Administrator (who also was working with our hosting company).

The cause was eventually tracked down as a network configuration issue involving the Load Balancer. We had expected that the Load Balancer was sitting between the internet and our web servers, and that all of our servers were communicating freely with each other. Unfortunately the network was set up in such a way that all network traffic (including traffic between the SQL Servers and Web Servers) was passing through the Load Balancer. The Load Balancer was configured to limit bandwidth passing through it, and when the limit was exceeded it simply dropped packets. The limit was often exceeded when large file transfers were occurring between the servers (eg, when database backups were copied off of the database server, etc). This was hard for us to see as we didn’t have access to the Load Balancer (only our hosting provider could access it), and as far as we could tell we were far from saturating our network interfaces. Additionally, these issues were extremely sporadic (on the order of a handful of minutes every 3-5 months).

The fix was to rearrange the environment so our internal network traffic did not go through the LB; I believe the network was rearranged to fit a One-armed Load Balancing Architecture. Since making this change we have not experienced the intermittent connectivity issues.

If I’m understanding correctly you’ve not only changed your software but also your hardware – so there are plenty of changes that could be causing this connection error. I’ve seen plenty of recommendations to double check your NIC drivers and motherboard firmware (!!) to fix this. Yikes!

Anyway – you should be able to see this error in your server application log. From here you may be able to get an idea the date/time the exception occured so you can compare it to the individual client/application event to narrow down what’s happening when this exception pops up.

You can also use Netmon to trace the connections from the clients to the server. You’ll want to give it a couple of days to reproduce the error. This should narrow it down a bit and at least give you and idea of what is failing.

Add Comment

Your email address will not be published. Required fields are marked *