vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Administrative and Maintenance Tools - Suppress-o-matic - Stop database error spam (https://vborg.vbsupport.ru/showthread.php?t=228146)

Mecho 04-27-2014 09:14 AM

Quote:

Originally Posted by Zachery (Post 2494960)
Are you saying you were getting db errors after installing it? What errors?

the normal "mysql server gone" database error. so i meant addon was not working for me for unknown reason and i got lots of that db error in a second.

Zachery 04-27-2014 05:36 PM

What were the specific errors you were getting?

Mecho 04-28-2014 10:25 AM

i have stopped mysql service to check if i get 1 email only or attached by mysql server gone database error emails. i got tons of emails like usual .

i156 03-25-2015 11:49 AM

I added this plugin and it seemed to stop all emails being sent from the site. I removed the code and the file and my site still is not sending any emails (error emails, user registration emails, etc). What can I do to fix this?

i156 03-25-2015 12:23 PM

When I run the email diagnostics I get:

The mailing function returned an error while trying to send the mail.
The following errors were outputted by PHP when attempting to send mail:

Warning: 554 Unexpected response from SMTP server when ending transmission in ..../includes/class_mail.php on line 710

kh99 03-25-2015 12:24 PM

I don't see anything in this mod that could do that. My guess is that it's a coincidence of some kind. Did you try this mod because someone told you you were sending too much email? Maybe your host decided to do something about it on their end?

i156 03-25-2015 12:40 PM

No, I added it to stop cut down on the error emails that come through when mysql goes down. I've switch to sendmail for now which is working.

i156 03-25-2015 12:44 PM

Now what I can't figure out is I have it working with SMTP using my hosts' SMTP. But when I switch back to using Amazon SES which is what I used before I get that error.

kh99 03-25-2015 01:18 PM

Hmm...did you change the email address they are being sent to or from? Sometimes some servers will complain if the 'From' address isn't one they like. I guess there's no more information in the error message when you use the diagnostics?

i156 03-25-2015 01:26 PM

Quote:

Originally Posted by kh99 (Post 2541492)
Hmm...did you change the email address they are being sent to or from? Sometimes some servers will complain if the 'From' address isn't one they like. I guess there's no more information in the error message when you use the diagnostics?

That was exactly it. I switched from my domain email to my gmail account. Switched it back and it is working. Thanks.

kerrghann 07-07-2015 02:21 PM

This seems to be exactly what I want. I'll give it a go. Thanks for the mod.

joyboy2001 12-28-2015 07:29 PM

Is this working with 4.2.x ?

Zachery 01-01-2016 03:26 PM

Still works fine.

Islamic Board 07-23-2016 03:15 AM

We have SQLite3 installed on php 5.4 and this mod doesn't work. How can we modify this to work with SQLite3?

AusPhotography 07-26-2016 07:32 AM

SQLite3 requires recoding the plugin slightly.
I've done it - easy

Kym

Zachery 07-26-2016 09:40 AM

Do you have the errors or notes regarding it? I don't have a test bed for this right now but if you let me know we can look into fixing it.

Islamic Board 07-27-2016 06:49 PM

Quote:

Originally Posted by Zachery (Post 2573961)
Do you have the errors or notes regarding it? I don't have a test bed for this right now but if you let me know we can look into fixing it.

We have modified it slightly to work with SQLite3. There doesn't seem to be any errors thrown by this script at the moment but when we tested it, we still receive multiple db error emails of the same error message, even within 1 second.

Below is the modified script for SQLite3.
Code:

/**********************************************\
|* DB Error Mail Suppressomatic (squall14716) *|
\**********************************************/
if ($sqlitedb = new SQLite3(DIR.'/sqlite3dberrors.sqlite', 0666, $sqliteerror)) {
    // Time between errors. 1800 (30 minutes) by default.
    // Modify config.php for easy changing of this. For example:
    // $config['dbems']['timebetweenerrors'] = 1800;
    //($vbulletin->config['dbems']['timebetweenerrors'] ? $timebetweenerrors = $vbulletin->config['dbems']['timebetweenerrors'] : $timebetweenerrors = 60);
    $timebetweenerrors = 60; // seconds

    // Database opened and ready. Let's check to see if there are recent errors of this type.
    $sqlitequery = $sqlitedb->query("SELECT * FROM dberrors WHERE time > ".(TIMENOW - $timebetweenerrors).
        " AND errorcode = '".$this->errno."' ORDER BY time DESC");
    $suppresserrormail = false;
    while ($sqliteresult = $sqlitequery->fetchArray(SQLITE3_ASSOC)) {
        if ($sqliteresult['script'] == $scriptpath) {
            if ($sqliteresult['errorcode'] == $this->errno) {
                // Script is the same and the errorcode is the same. Let's supress this error e-mail.
                $suppresserrormail = true;
            }
        }
        if ($sqliteresult['error'] == $this->error) {
            // Error message is the same. Supress this error e-mail.
            $suppresserrormail = true;
        }
    }

    if ($suppresserrormail == false) {
        $sqlitedb->exec("INSERT INTO dberrors (time, error, errorcode, ipaddress, script) VALUES (".TIMENOW.
            ", '".SQLite3::escapeString($this->error)."', '".$this->errno."', '$ipaddress', '$scriptpath')");
    } else {
        $technicalemail = "";
    }

    // Clean the SQLite table of all irrelevant data.
    $sqlitedb->exec("DELETE FROM dberrors WHERE time < ".(TIMENOW - $timebetweenerrors));

}
/**************************************************\
|* End DB Error Mail Suppressomatic (squall14716) *|
\**************************************************/


Using the dumpdberror script given in this thread, we can see that there was a single db error written in the database file, only once. It has not updated after that in subsequent tests.


All times are GMT. The time now is 03:14 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01246 seconds
  • Memory Usage 1,759KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (17)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete