Error while sending QUERY packet. wp-db.php on line 1803

Home Forums BulletProof Security Pro Error while sending QUERY packet. wp-db.php on line 1803

Viewing 13 posts - 31 through 43 (of 43 total)
  • Author
    Posts
  • #29669
    AITpro Admin
    Keymaster

    Additional info posted:  https://wordpress.org/support/topic/warning-error-while-sending-query-packet-pid82827?replies=14#post-8459040
    Note to self: I am reposting things in this forum for sanity sake so I can track the overall progress of this issue since this issue is posted in several separate locations.

    Oh and meant to mention some other testing things that I checked. I did do a before and after check directly in the WP Core code in /wp-includes/wp-db.php on line 1803 to see if WP was altering max_allowed_packets in any way. The before and after checking results were the same. Obviously the wp-db.php code does not have any code that is intended to do anything with or to max_allowed_packets so I was just looking for a logic flaw somewhere and none were found.

    So since this is just an insignificant “after the fact” error that does not prevent a backup from being successful then one of these 2 things below is true.

    1. The issue does have to do with a particular user’s MySQL (or other DB type) max_allowed_packet and wait_timeout variable values/settings. Executing the function in my previous post will confirm or eliminate this possibility if Max values are set and the same error is still being outputted.

    2. There is a logic flaw in the MySQL (or other DB type) error checking code itself. Something like a “timing” issue of when the error check (or a secondary error check) is actually performed relative to the execution/processing of the Query (most likely). A very general example would look something like this below and the only relative point being made here is “when” the catch happens and not the error checking code itself. It could be something that has changed in WP 4.5 where a “timing” issue similar to this type of thing could occur (very unlikely). ie the order of function processing changed or something similar to that effect.

    
    foreach ( $x as $y ) {
    	try {
    		if ( $y->something() ) {
    			// whatever is being processed
    		}
    	} catch (RuntimeException $e) {}
    }
    
    #29681
    Krzysztof
    Participant

    Great work! Many thanks!

    I have a lot on my head recently and can not dig in into it. Will do it ASAP 🙁

    #30524
    AITpro Admin
    Keymaster

    Additional info posted (tracking for sanity):  https://wordpress.org/support/topic/warning-error-while-sending-query-packet-pid82827?replies=30#post-8727317

    Actually what makes more sense as the root cause of the problem is this:http://stackoverflow.com/questions/30753674/error-while-sending-query-packet

    You guessed right MySQL have limitation for size of data, you need to break your query in small group of records or you can Change your max_allowed_packet by using SET GLOBAL max_allowed_packet=524288000;

    ———————————-

    So here is the hypothetical scenario that appeared that uninstalling/reinstalling the plugin worked to fix the problem. The root cause of the issue/problem is the Data Type or the Data itself in a particular DB Table. For whatever odd reason or maybe just a coincidence or maybe an old problem with a particular DB table no longer exists after uninstalling/reinstalling the plugin. For that to be true the plugin would have to reusing or storing something that was previously part of the root problem, which actually has something to do with the Data Type or Data itself. So let’s say whatever the problem was that previously existed for a particular DB Table no longer exists and then you uninstall/reinstall the plugin and whatever old stored data (setting) no longer exists in that plugin. Then when you reinstall the plugin and root problem Data Type or Data in a particular DB no longer exists then the root problem is gone and the plugin settings do not store that problem.

    If nothing has changed in how the plugin does what is does then the error should still be occurring. So logically the root cause has to do with the DB itself or a particular DB Table/Type/Data or of course a DB config setting.

    Another possible clue that I was looking at was maybe this has to do with SSL? I would be curious to know how many people have SSL websites that are experiencing this particular issue/problem/error.

    #30807
    Nik
    Participant

    [Topic has been merged into this relevant Topic]
    Hello,

    I installed BPS Pro, ran the Wizard.  All codes were green except the one below was colour coded black.

    Warning: Error while sending QUERY packet. PID=583978 in /home/xxxxx/public_html/example.com/wp-includes/wp-db.php on line 1860

    I had initially ran into 500 internal error in the installation.  Resolved it with your suggestion at discussion: http://forum.ait-pro.com/forums/topic/set-up-wizzard-gave-500-internal-server-error/

    Please advise how to best resolve the above warning issue.

    Thanks,

    Nik

    #30815
    AITpro Admin
    Keymaster

    @ Nik – Did the Setup Wizard complete successfully?  Was BPS Pro setup successfully?  Where exactly in the Setup Wizard did you see the error message?  Re-run the Wizard and copy and paste the error message and surrounding text so I can see which Wizard setup section the error occurred in.

    #30817
    Nik
    Participant

    Thanks AIT pro for your reply.

    I ran the pre-installation wizard and wizard again.  The issue is resolved.

    Nik

    #30818
    AITpro Admin
    Keymaster

    @ Nik – I don’t think the error was related to BPS at all.  So not sure why it showed up anywhere in the BPS Setup Wizard verification checks text or page, unless the error just happened to be displayed on the BPS Setup Wizard page and it looked like the error was related to BPS when it was actually caused by and related to another plugin you have installed.  Do you have a Backup plugin installed?  If so, what is the name of that Backup plugin.

    #30819
    Nik
    Participant

    Hi AIT,

    Thanks for your advice.  I do not have a backup plugin, nor was there a theme or plugin conflict.  Below is the line coding 1860

    if ( preg_match( '/^\s*(insert|replace)\s/i', $query ) ) {

    Did the test on a newly installed website.  Had the same issue, but was resolved when I ran the pre-installation wizard, then wizard again.

    Looked at the phpMyAdmin database table.  The database looks fine.  No sure why the error line popped up on the 1st wizard run.

    BTW, Great job with the plugin, thanks.

    Nik

    I just checked the PHP Log after sending off my reply.  Looks I am getting the same error message, but this time it showed up in the PHP Error Log.

    [02-Sep-2016 04:13:02 UTC] PHP Warning:  Error while sending QUERY packet. PID=887733 in /home/xxxxx/public_html/xxx/wp-includes/wp-db.php on line 1860

    It didn’t show up when I ran the pre-installation wizard, then the wizard, the 2nd and 3rd time.  The messages were all green, and no error was displayed.

    Will review your troubleshooting steps again.

    Nik

    #30821
    Nik
    Participant

    Sorry AIT,

    The pre-installation wizard and wizard setup were “successful”, on 1st and 2nd wizard run, all green text, no red.

    The only exception with the 1st run was, an error note was found in the line under, BulletProof Security Pro AutoRestore|Quarantine Final Setup.  The error note disappeared on the 2nd wizard run, but appeared in the PHP Error Log.

    AutoRestore|Quarantine DB Options created or updated Successfully!
    ARQ Root File Backup - files backed up to /wp-content/bps-backup/autorestore/root-files Successfully!
    ARQ wp-admin File Backup - files backed up to /wp-content/bps-backup/autorestore/wp-admin Successfully!
    ARQ wp-includes File Backup - files backed up to /wp-content/bps-backup/autorestore/wp-includes Successfully!
    ARQ wp-content File Backup - files backed up to /wp-content/bps-backup/autorestore/wp-content Successfully!
    
    Warning: Error while sending QUERY packet. PID=182121 in /home/xxxxx/public_html/xxx/wp-includes/wp-db.php on line 1860
    bps_autorestore_cron_frequency DB Option created or updated Successfully!
    bps_autorestore_cron DB Option created or updated Successfully!
    bps_autorestore_cron_override DB Option created or updated Successfully!
    bps_autorestore_cron_filecheck DB Option created or updated Successfully!
    bps_autorestore_cron_forced DB Option created or updated Successfully!
    bps_autorestore_cron_end DB Option created or updated Successfully!
    ARQ Root File Backup Verified
    ARQ wp-admin File Backup Verified
    ARQ wp-includes File Backup Verified
    ARQ wp-content File Backup Verified
    The AutoRestore Cron has been turned On

    Nik

    #30823
    AITpro Admin
    Keymaster

    @ Nik – These 2 replies (links below) in this forum topic are the latest theories for why this error occurs.  This forum topic was started about 5 months ago when this error all of a sudden started appearing in several different plugins after WP 4.5 was released.  No one has been able to figure out exactly why the error occurs, but it appears to be an insignificant error that does not affect anything.  I tried to recreate/reproduce this error on several different test servers and was never able to reproduce the error during testing.  What Database do you have?  MySQL, MariaDB, etc.

    http://forum.ait-pro.com/forums/topic/php-warning-error/page/3/?view=all#post-29669
    http://forum.ait-pro.com/forums/topic/php-warning-error/page/3/?view=all#post-30524

    #30824
    Nik
    Participant

    Hi AIT,

    I use MySQL database.  I reviewed your useful links.
    The error appeared in my SSL and non-SSL websites.  Agree that the root cause of the issue/problem is possibly the Data Type.
    Both SSL and non-SSL websites appear to be running fine.
    Appreciate your great work.  Thanks, AIT for troubleshooting.

    Nik

    #31016
    Nik
    Participant

    Hi AIT,

    I have been getting a number of the following warnings lately in my PHP error log .  How do I resolve the issue?

    [25-Sep-2016 05:47:28 UTC] PHP Warning:  mysql_query(): MySQL server has gone away in /home/xxxxx/public_html/en/wp-includes/wp-db.php on line 1870
    [25-Sep-2016 05:47:28 UTC] PHP Warning:  mysql_query(): Error reading result set's header in /home/xxxxx/public_html/en/wp-includes/wp-db.php on line 1870
    [25-Sep-2016 20:41:46 UTC] PHP Warning:  mysql_query(): MySQL server has gone away in /home/xxxxx/public_html/en/wp-includes/wp-db.php on line 1870
    [25-Sep-2016 20:41:46 UTC] PHP Warning:  mysql_query(): Error reading result set's header in /home/xxxxx/public_html/en/wp-includes/wp-db.php on line 1870
    [26-Sep-2016 23:22:33 UTC] PHP Warning:  Error while sending QUERY packet. PID=763026 in /home/xxxxx/public_html/en/wp-includes/wp-db.php on line 1870
    [27-Sep-2016 01:27:58 UTC] PHP Warning:  mysql_query(): MySQL server has gone away in /home/xxxxx/public_html/en/wp-includes/wp-db.php on line 1870
    [27-Sep-2016 01:27:58 UTC] PHP Warning:  mysql_query(): Error reading result set's header in /home/xxxxx/public_html/en/wp-includes/wp-db.php on line 1870
    [27-Sep-2016 01:34:02 UTC] PHP Warning:  mysql_query(): MySQL server has gone away in /home/xxxxx/public_html/en/wp-includes/wp-db.php on line 1870
    [27-Sep-2016 01:34:02 UTC] PHP Warning:  mysql_query(): Error reading result set's header in /home/xxxxx/public_html/v/wp-includes/wp-db.php on line 1870
    [27-Sep-2016 01:44:03 UTC] PHP Warning:  mysql_query(): MySQL server has gone away in /home/xxxxx/public_html/en/wp-includes/wp-db.php on line 1870
    [27-Sep-2016 01:44:03 UTC] PHP Warning:  mysql_query(): Error reading result set's header in /home/xxxxx/public_html/en/wp-includes/wp-db.php on line 1870
    [27-Sep-2016 01:44:03 UTC] PHP Warning:  mysql_query(): MySQL server has gone away in /home/xxxxx/public_html/en/wp-includes/wp-db.php on line 1870
    [27-Sep-2016 01:44:03 UTC] PHP Warning:  mysql_query(): Error reading result set's header in /home/gxxxxx/public_html/en/wp-includes/wp-db.php on line 1870
    #31018
    AITpro Admin
    Keymaster

    @ Nik – Contact your web host and ask if your Database server is currently having connectivity issues/problems.  If your site and DB are actually OK then the “mysql_query(): MySQL server has gone away” errors could just be nuisance errors like the “Error while sending QUERY packet” nuisance error that does not actually cause any problems.  I don’t think anyone has figured out what causes the QUERY packet error.

Viewing 13 posts - 31 through 43 (of 43 total)
  • You must be logged in to reply to this topic.