PDA

View Full Version : Make "connection failed" message more friendly


Pilot
Sun 22nd Jul '01, 1:09pm
I run VB on a shared web server which in turn uses a shared MySQL server at the same hosting site.

The shared MySQL server has a concurrent connection limit and sometimes due to other web site's usage the limit is reached and some of my users get the MySQL connection refused "error".

Now the problem really is the way this "error" is handled by VB. It gives the user a cryptic error message and send me an Email when this happens.

What it should do is display a (customisable) message indicating that the database server is busy and to try again in a few moments by pressing refresh on the browser.

This would be far better than sending me an Email with "Database error in vBulletin: Link-ID == false, connect failed" in it.

It's not an error - it's an temporary environmental constraint and should be handled differently to an error. I can do without dozens of pointless Emails in my inbox each day (and I can't turn it off without losing any real errors that might happen).

Thanks (any advice on how I can "fix" this myself in 2.0.1 also appreciated).

Wayne Luke
Sun 22nd Jul '01, 2:20pm
It is an Error... MySQL is erroring out on the connection..

To change it you can edit db_mysql.php but only touch this file if you really know what you are doing. Without it working perfectly, you won't have a forum for people to connect to.

Pilot
Sun 22nd Jul '01, 3:55pm
Call it what you like, it is caused by a temporary server constraint and should be handled in a more customisable way. It is not an error that can be corrected by anything within my control yet it is Emailing me messages all day long!

This is the suggestion forum, not the bugs forum remember!

Also can you make the Error Emails contain the actual error type in the Email subject field - at least then I can delete all these duplicate "connection" error Emails without having to read them first.

tubedogg
Sun 22nd Jul '01, 5:08pm
It actually is in your control - your board should not be subject to connection errors due to others' over-using their connections. If your host had it setup correctly you would get a set number of connections, as would everyone else, and over that would error out, but you would not be subject to others using connections of yours and vice-versa.

I also agree with Wayne - it *is* an error. If the board doesn't load for whatever reason, that's an error. Maybe it should be customizable, but it would have to be done in the PHP files because if the database can't be reached (as this error indicates) there's no way for a custom error template to be pulled out.

Pilot
Mon 23rd Jul '01, 7:32am
You need to allow me to suppress certain types of error emails then.

Eg.

In config.php have a list of error codes NOT to email for.

Or at least put the error code in the subject field of the Email.

I can't change the host setup on a shared server - therefore it is not under my control. Don't forget most of us do not have our own dedicated server like you developers do!!

Wayne Luke
Mon 23rd Jul '01, 1:00pm
Originally posted by Pilot
You need to allow me to suppress certain types of error emails then.

Eg.

In config.php have a list of error codes NOT to email for.

Or at least put the error code in the subject field of the Email.

I can't change the host setup on a shared server - therefore it is not under my control. Don't forget most of us do not have our own dedicated server like you developers do!!

Well... MySQL has hundreds if not thousands of possible error messages. All of which are not documented. This makes listing them in config.php very prohibitive.

If you want to list the error in your subject you can look for this line in db_mysql.php:

@mail ($technicalemail,"$this->appshortname Database error!",$message);


and changing it to:

@mail ($technicalemail,"$this->appshortname Database error, $this->errno: $this->errdesc",$message);


You might also want to talk to your host and see if they can manage MySQL properly so that you don't have this problem. The main thing they can do is increase the maximum connections allowed from the default of 100 to a much higher number like 300 or 500.

tubedogg
Mon 23rd Jul '01, 4:49pm
Originally posted by Pilot
I can't change the host setup on a shared server - therefore it is not under my control. Don't forget most of us do not have our own dedicated server like you developers do!!I'm not a developer, nor do I have a dedicated server. However if my host was setup this way, they would no longer be my host. It's that simple.

Kengan
Thu 26th Jul '01, 6:06am
Originally posted by Pilot
I run VB on a shared web server which in turn uses a shared MySQL server at the same hosting site.

The shared MySQL server has a concurrent connection limit and sometimes due to other web site's usage the limit is reached and some of my users get the MySQL connection refused "error".

Now the problem really is the way this "error" is handled by VB. It gives the user a cryptic error message and send me an Email when this happens.

What it should do is display a (customisable) message indicating that the database server is busy and to try again in a few moments by pressing refresh on the browser.

This would be far better than sending me an Email with "Database error in vBulletin: Link-ID == false, connect failed" in it.

It's not an error - it's an temporary environmental constraint and should be handled differently to an error. I can do without dozens of pointless Emails in my inbox each day (and I can't turn it off without losing any real errors that might happen).

Thanks (any advice on how I can "fix" this myself in 2.0.1 also appreciated).


I know some webmaster may used a socket method to connect with SQL database , Try to use :

$servername='localhost:/home/yourdomain/mysql.sock';

in your config.php and see how is going !

;)