View Full Version : Administrative and Maintenance Tools - Suppress-o-Matic - Stop database error spam
GeekyDesigns
07-14-2009, 10:00 PM
What is Suppress-o-matic?
Suppress-o-matic is a change to the way vBulletin handles database error emails. It limits sending the same error email repeatedly to your inbox every time a database error is generated. On a busy site if a table is crashed or mysql itself goes down you could recieve several thousand emails. This causes the email server to bog down, and possibly the server itself if there is enough traffic generating emails.
Why do I want Suppress-o-matic?
It should be pretty clear, you still get the vital information that your vBulletin forum is offline for whichever reason, without the hassle of having to delete and manage your inbox afterwords.
Why do I have to edit the files?
If the database is down, there is no way to get to the plugins. Plugins are stored in the vBulletin database.
Isn't there a vBulletin Option for this?
There is an option to disable some emails, assuming that the settings table can be read. If it cannot then it doesn't work. It even states this on the option itself.
Can't I just remove my tech email from the config file?
This doesn't keep you up to date. What if a serious error like error 28 (no space left) crops up? This means that your server could potentially have serious issues. Not resolving these problems could cause major issues.
Are you considering adding more functionality to Suppress-o-matic?
We have plans to add a repair feature at some point in time, with an on/off switch.
What is SQlite?
SQLite is a tiny database engine that is found in PHP. It is very lite, and requires only that php have the extension. There is no other dedicated server for it. You can find more information here: http://en.wikipedia.org/wiki/SQLite
Whats required?
PHP5
SQLITE2 or newer (found in most php installations)
1 file edit
1 file to upload
Future versions:
Repair table feature
Project Credits:
Zachery - Project Planning, design goals, pestering.
Link14716 - Hard work.
This works for vBulletin 4.0 as well as 3.7+. vB4 thread located here (https://vborg.vbsupport.ru/showthread.php?t=228146).
Link14716
07-15-2009, 06:57 AM
Q: How do I change the time interval between error e-mails?
Add the following to your /includes/config.php file:
$config['dbems']['timebetweenerrors'] = 1800;
Change 1800 to the time interval that you want, in seconds. By default, it is 1800 seconds (30 minutes).
Link14716
07-15-2009, 07:00 AM
If something does not work as it should, slap me around until I fix it. This is a beta that I threw together. It Works For Me(tm) but that's as far as it has been tested.
Oblivion Knight
07-15-2009, 07:14 AM
Installed (on demand). Thanks.. ;)
sensimilla
07-15-2009, 07:29 AM
I might need it, my mailbox is just full all over. Waiting for the GOLD.
Hostboard
07-15-2009, 02:22 PM
I just got 2000 DB error messages the other day...LOL...
saadessa
07-15-2009, 03:31 PM
thank you i will try later
jaredwilli
07-16-2009, 01:46 PM
*installs*
thanks
Gladius2007
07-20-2009, 11:46 AM
Zachery, why on earth isn't this part of the stock vB? It's been suggested dozens of times and it should have been included years ago.
Zachery
07-20-2009, 11:52 AM
I know it has, and in the past i knew that Scott was looking into it. Where it got lost in versions I'm not sure.
But, its here now, and hopefully in the future some sort of stock verison can be intergrated.
Gladius2007
07-20-2009, 03:25 PM
I sure hope so.
gwerzal
07-20-2009, 10:11 PM
should defo be part of the stock vb
Thank you
Zachery
07-22-2009, 03:44 PM
Havent had any reported bugs yet, And Link14716 is curretly without interwebs.
Though we have plans to impliment the listed features and get this pushed out as a final shortly here.
cheesegrits
07-23-2009, 05:29 PM
Thankyou thankyou thankyou. Thankyou.
Been having One Of Those Days (several in a row, actually), where I'm on the road and MySQL goes tits up ... thought my Crackberry was going to self destruct with the volume of vB error msgs.
Hoping this makes it into the core product ASAP.
-- hugh
Zachery
07-24-2009, 11:27 AM
Thankyou thankyou thankyou. Thankyou.
Been having One Of Those Days (several in a row, actually), where I'm on the road and MySQL goes tits up ... thought my Crackberry was going to self destruct with the volume of vB error msgs.
Hoping this makes it into the core product ASAP.
-- hugh
Let us know how well its working :)
Zachery
07-30-2009, 03:22 PM
Since we've had no reported issues, I'm pulling the beta tag.
MentaL
08-02-2009, 04:36 PM
isnt this default in vb?
Zachery
08-02-2009, 07:43 PM
isnt this default in vb?
Nope, that is why we released it.
Right now, if there is a db error, your email will be sent 1 mail for every time someone visits the page with the db error message. (100 guests + 100 regulars) x 10-15 refreshes = lost of database error emails. This stops it dead cold, 10,000 page requests with the same database error, 1 mail is sent.
MentaL
08-02-2009, 11:57 PM
vbulletin options
HelpError
Handling & Logging
--> Disable Database Error Email Sending
Link14716
08-03-2009, 12:03 AM
This doesn't disable e-mail sending, this stops it from destroying your inbox. Pretty big difference.
Stopping DB error mails entirely is as simple as removing the technical address from config.php. No need for anything special for that, but this isn't what the mod does.
Zachery
08-03-2009, 01:48 AM
vbulletin options
HelpError
Handling & Logging
--> Disable Database Error Email Sending
Also doesn't stop connection, and crashed table emails if the system cannot connect or read the database.
There is a pretty big note about this.
GeekyDesigns
08-13-2009, 01:14 PM
Updated the description text, should read much better.
matthewhotdude
08-13-2009, 02:00 PM
Installed dunno if it works tho, anyway to test?
This is good, but I think it could be taken a little further. For instance, if you get an error, you get an email. But you don't get duplicates for X time after wards.
That works, but how do I know I have a REAL problem or not then? Meaning it could of just been a quick outage where a query failed for whatever reason. Or, it might be something really serious where things are completely down.
I guess what I'm saying is, maybe some way to email saying "We just received 350 error reports for this same error, you should check it out ASAP" type of message.
I dunno, maybe I'm not explaining it well but... hopefully it's enough to spark what I mean and maybe a better idea than only suppression.
Zachery
08-14-2009, 09:14 PM
This is good, but I think it could be taken a little further. For instance, if you get an error, you get an email. But you don't get duplicates for X time after wards.
That works, but how do I know I have a REAL problem or not then? Meaning it could of just been a quick outage where a query failed for whatever reason. Or, it might be something really serious where things are completely down.
I guess what I'm saying is, maybe some way to email saying "We just received 350 error reports for this same error, you should check it out ASAP" type of message.
I dunno, maybe I'm not explaining it well but... hopefully it's enough to spark what I mean and maybe a better idea than only suppression.
Its a pretty good idea, we'll take it into consideration for sure :)
Zachery
08-15-2009, 05:08 AM
Installed dunno if it works tho, anyway to test?
messup the config by using a bad password
Sarthek
08-16-2009, 11:50 AM
Finally, some very useful mod. I tagged it for now, will give it a try in coming weeks.
Our "record" so far: over 18.000 emails in less than day.
janslu
09-10-2009, 09:59 PM
I have it installed but I got php errors when my database had too many connections. The error logged was:
[10-Sep-2009 23:35:50] PHP Warning: SQLiteDatabase::unbufferedQuery() [<a href='sqlitedatabase.unbufferedquery'>sqlitedatabase.unbufferedquery</a>]: near "ORDER": syntax error in forum/includes/class_core.php on line 1015
[10-Sep-2009 23:35:50] PHP Fatal error: Call to a member function fetch() on a non-object in forum/includes/class_core.php on line 1017
Any idea what might be the problem?
Line 1015 of modified class_core.php is:
$sqlitequery = $sqlitedb->unbufferedQuery("SELECT * FROM dberrors WHERE time > ".(TIMENOW - $timebetweenerrors)." AND errorcode = ".$this->errno." ORDER BY time DESC");
Link14716
09-11-2009, 02:37 AM
I have it installed but I got php errors when my database had too many connections. The error logged was:
[10-Sep-2009 23:35:50] PHP Warning: SQLiteDatabase::unbufferedQuery() [<a href='sqlitedatabase.unbufferedquery'>sqlitedatabase.unbufferedquery</a>]: near "ORDER": syntax error in forum/includes/class_core.php on line 1015
[10-Sep-2009 23:35:50] PHP Fatal error: Call to a member function fetch() on a non-object in forum/includes/class_core.php on line 1017
Any idea what might be the problem?
Line 1015 of modified class_core.php is:
$sqlitequery = $sqlitedb->unbufferedQuery("SELECT * FROM dberrors WHERE time > ".(TIMENOW - $timebetweenerrors)." AND errorcode = ".$this->errno." ORDER BY time DESC");
Try to change that line to $sqlitequery = $sqlitedb->unbufferedQuery("SELECT * FROM dberrors WHERE time > ".(TIMENOW - $timebetweenerrors)." AND errorcode = '".$this->errno."' ORDER BY time DESC");
I wish it gave more details about the syntax error so I could see exactly what its problem is.
cbtrussell
10-06-2009, 11:26 PM
Excellent, exactly what I was looking for to help get a handle on all of the error messages we get when the db is being backed up. Great work, thank you!
viper357
11-26-2009, 08:04 AM
I know you say it works on 3.7+ but would I run any risk by trying to install it on a 3.6.12 board? Thanks.
Link14716
11-26-2009, 06:49 PM
I know you say it works on 3.7+ but would I run any risk by trying to install it on a 3.6.12 board? Thanks.
I haven't tested it on 3.6, but I can't think of a reason that it wouldn't work on it.
yahya komeet
12-14-2009, 05:43 AM
thank you i will try it
bleros
02-24-2010, 04:56 AM
thank you bro
CILGINKRAL_
02-24-2010, 09:13 AM
Thank You :)
wowglider
07-07-2010, 08:02 AM
After i got 50k error emails because of broken mysql slave i now installed this... :)
Absolutely amazing modification. May be one of the most directly useful modifications on this website.
Having database errors spit out a single email instead of hundreds of emails is HUGE and I recommend this mod to everybody. Despite ridding your email inbox of server error spam, you don't want your server to build up a huge email queue during high load times. This will save anyone who installs it a lot of headache.
Mahz approved.
BirdOPrey5
07-07-2010, 11:05 PM
I've been lucky enough to not ever need this, but now installed just in case- thanks.
ZomgStuff
09-08-2010, 03:55 PM
Anyone try this on 4.0?
BirdOPrey5
09-08-2010, 05:12 PM
Anyone try this on 4.0?
The author links to the 4.0 version in his description.
Zachery
09-09-2010, 09:02 PM
Anyone try this on 4.0?
https://vborg.vbsupport.ru/showthread.php?t=228146
psychonikeo
09-19-2010, 11:42 AM
Installed, but still get tons of mails?
adwade
10-11-2010, 10:43 PM
What is "your base vBulletin directory"? Is that the /forums directory that it's referring to, or the one above it /public_html on the server?
Zachery
10-12-2010, 07:12 PM
Wherever you have your vBulletin files installed to, if all of the vBulletin files and folders are in the /forum/s directory than that is the correct one.
If you have the product installed and are getting tons of emails, check the permissions on your sqlite database.
6impy
10-22-2010, 06:10 PM
I'm having a similar issue as psychonikeo.
sqlitedberrors.sqlite has the right permissions.
I echo'ed out: DIR .'/sqlitedberrors.sqlite' and it has the correct path.
I took a look in the sqlitedberrors.sqlite file and nothing is changing.
SQLite is properly installed because error_log is not spitting out any PHP errors for unrecognized commands.
Is there any way to see what the result/error of a query is?
$sqlitedb->queryExec("INSERT INTO dberrors (time, error, errorcode, ipaddress, script) VALUES (".TIMENOW.", '".sqlite_escape_string($this->error)."', '".$this->errno."', '$ipaddress', '$scriptpath')");
Edit:
Could it be the version of SQLite I'm running?
PDO Driver for SQLite 3.x enabled
PECL Module version (bundled) 1.0.1 $Id: pdo_sqlite.c 272374 2008-12-31 11:17:49Z sebastian $
SQLite Library 3.3.7
---
SQLite support enabled
PECL Module version 2.0-dev $Id: sqlite.c 282740 2009-06-25 00:07:20Z scottmac $
SQLite Library 2.8.17
SQLite Encoding iso8859
6impy
10-23-2010, 06:30 PM
I fixed the problem I was having and thought I would share it with others who run into it.
For whatever reason, I needed to put the sqlitedberrors.sqlite file in a subfolder of the forum directory that was chmod'ed to 666 (sqlitedberrors.sqlite also being chmod'ed to 666)
e.g.
/path/to/web/forum/sqlite/sqlitedberrors.sqlite
instead of:
/path/to/web/forum/sqlitedberrors.sqlite
Then I modified the very first line of modified code (below the comments) that goes into /includes/class_core.php from:
if ($sqlitedb = new SQLiteDatabase(DIR .'/sqlitedberrors.sqlite', 0666, $sqliteerror)) {
to (look after the DIR part for the added subfolder)
if ($sqlitedb = new SQLiteDatabase(DIR .'/sqlite/sqlitedberrors.sqlite', 0666, $sqliteerror)) {
It's working perfectly and now I don't get hundreds of text messages when my database goes down.
Cheers,
Drew
Zachery
10-23-2010, 10:21 PM
sounds like a permission error on the host OS/PHP more than SQLite.
6impy
10-24-2010, 01:04 AM
That could be the case, but I tried changing ownership of the file and giving 777 to it. Nothing seemed to allow an update the content of the sqlite file. It would always spit out a query error on the insert. I even tried writing completely separate sqlite code to test it out. It only worked when I stuck it in a folder that was also writable.
Anyway, it may be of help to someone else...
adwade
10-27-2010, 12:40 AM
I've been lucky enough to not ever need this, but now installed just in case- thanks.
DITTO!
hm...different one here.
I got emails with the db-errors, but also the sqlite-file was modifed und data has been inserted.
Why do I still get emails? Is there a way to check this?
Thx
Zachery
12-02-2010, 08:14 PM
What were the emails that you got?
just the normal error-message you get when an error occurs.
I'll go into more details here.
I got the error-mails (board has another language though, but that wouldn't matter?)
and then I checked the sqlite-file.
It was last modified at the date of the db-error.
then I downloaded it and checked if there was an entry. And I could find the ip of the last db-error.
Just one IP, in the mails were more...
That's quite strange, the db file has been accessed, but the mails were still sent... hm..
Here's the message, but that's the standard-one, which I got 10 times. With the same timestamp. Just a little error, normally I get more. It only differs in ips and paths.
Datenbankfehler in vBulletin :
mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (11)
/var/www/xxx/forum/includes/class_core.php on line 311
MySQL-Fehler :
Fehler-Nr. :
Fehler-Zeit : Wednesday, 24.11.2010 @ 10:32:01
Datum : Wednesday, 24.11.2010 @ 10:32:01
Skript : http://www.xxx/forum/ajax.php
Referrer : http://www.xxx/forum/xxx
IP-Adresse : 62.154.195.71
Benutzername :
Klassenname : vB_Database
MySQL-Version :
OK, strange enough: the last times I had db-errors there was only one mail.
And there always one entry in the sqlite-DB.
Floezen
01-25-2011, 11:14 AM
I installed this Plug-In about 2 weeks ago without problems.
Now, that there seemed to occur some database error, the error mail says: To many Connections.
But the page shows following:
Warning: SQLiteDatabase::queryExec() [sqlitedatabase.queryexec]: unable to open database file in /path_to_dir/httpdocs/includes/class_core.php on line 1032
Warning: SQLiteDatabase::queryExec() [sqlitedatabase.queryexec]: unable to open database file in /path_to_dir/httpdocs/includes/class_core.php on line 1038
Is that what it is supposed to show???
Regards
Florian
Zachery
01-26-2011, 05:31 PM
Did you set the permissions correctrly?
Floezen
02-14-2011, 08:26 PM
I would say, yes:
-rw-rw-rw- 1 user psacln 5120 Jan 3 23:35 sqlitedberrors.sqlite
Zachery
02-15-2011, 09:51 PM
Did you try 777?
Romamo
05-17-2011, 01:55 AM
I have a more simple decision: http://tracker.vbulletin.com/browse/VBIV-12105
Patch limits email sending to 1 per minute.
6impy
05-17-2011, 03:59 AM
Thanks for sharing!
Zachery
05-19-2011, 09:39 PM
I have a more simple decision: http://tracker.vbulletin.com/browse/VBIV-12105
Patch limits email sending to 1 per minute.
Doesn't your fix disable other error emails as well? You can configure your email error limit. You only get one email per error type per X time period.
realmr
08-21-2011, 04:58 PM
I am getting error, up on adding as mentioned in the instructions:
Fatal error: Class declarations may not be nested in /home/frm1/public_html/forum/includes/class_core.php on line 1103
Hornstar
04-25-2012, 07:12 PM
Can't believe I've only found this now. This is really good.
Zachery
04-25-2012, 08:04 PM
Some users might be having problems (depending on their setup)
We'll look at updating the product in the near future.
In the short run, you can move the sql file into its own folder and chmod it. You'll need to update the code manually to reflect this.
creative-friend
09-12-2013, 06:48 PM
Will This work in 4.x.x....??
Zachery
09-12-2013, 07:01 PM
There is a vB4 version https://vborg.vbsupport.ru/showthread.php?t=228146
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.