Home › Forums › BulletProof Security Pro › Error while sending QUERY packet. wp-db.php on line 1803
Tagged: php errors, WordPress 4.5, wp-db.php
- This topic has 42 replies, 4 voices, and was last updated 7 years ago by
AITpro Admin.
-
AuthorPosts
-
Jose
ParticipantThis is what it shows:
Threads_connected: 4
Threads_running: 2
Threads_created: 178
Threads_cached: 36I assume that Threads_connected should not be more than 18.
AITpro Admin
KeymasterCorrect: Threads_connected shows the total number of current DB Connections. So since your MySQL server is configured to only allow 18 concurrent DB connections then if a 19th Thread connection is attempted it will not be allowed until 1 of the 18 active/connected Threads is killed/destroyed/disconnected. Threads_running shows DB Query activity.
Jose
ParticipantIn reference to the annoying warnings, a partial revert seems fixing this issue within Wp 4.5.1 (see database topic).
https://codex.wordpress.org/Version_4.5.1AITpro Admin
KeymasterI was just looking at that ticket: https://core.trac.wordpress.org/ticket/36629 a few minutes ago. 😉 If you look at what Otto said below then you cannot call it a “fix”. Basically WP is just going back to what they were doing before regarding DB issues/errors like yours. The issue still exists, but you are no longer getting php errors about the issue.
Ah. Yeah, that’s good too, but I didn’t mean tricks with error_reporting and such. These two particular warnings that were spotted occur for reasons outside of WordPress. The mysql_old_password one happens because the server is using old password hashing mechanisms. The minor version mismatch happens because PHP has the wrong version of the php mysql libraries installed given the mysql client libraries available on the server.
Any user seeing these warnings should contact their host about it, and the host should be informed as to how to fix their systems so that the warnings do not occur, even if we’re not suppressing them.
Suppressing them contingent on WP_DEBUG makes sense, regardless of the method.
Jose
ParticipantYes, the WordPress decision was totally correct. Last Saturday I sent an email to the host company including the link to Otto’s topic and they answered they’ll review the WordPress information provided for “studying if they need” to make any changes on their part. I also recommend all folks from this forum who received the warnings to do it. Contact the host company reporting this anomaly.
Krzysztof
ParticipantI thought that we have nailed my error to DB Backup plugin but we started to move in circles:
https://wordpress.org/support/topic/php-warning-82
There is a question form the plugin Autor about some BPS Pro information which I can not answer – could you have a look?AITpro Admin
KeymasterTook a look at the thread and posted the answer: https://wordpress.org/support/topic/php-warning-82?replies=23#post-8333711
AITpro Admin
Keymaster@ Krzysztof – I think the problem has to do with the DB max_allowed_packet variable setting and how DreamObjects Backups is processing the intermediate string.
https://wordpress.org/support/topic/php-warning-82?replies=23#post-8343166
I think this is the right direction to be looking in: max_allowed_packet:http://stackoverflow.com/questions/30753674/error-while-sending-query-packet
A way to test if this is what is going on would be to do a DB Backup of only 1 of your small Database tables. Then if that works you want to look at the size of all of DB Tables to find which one (or ones) is exceeding the max_allowed_packet size. Then based on the logic that an intermediate string is exceeding the max_allowed_packet limit then you could test doing a backup of an extremely large database table, but it could be a cumulative thing depending on how DreamObjects Backups is handling/processing the strings during dump creation. So testing might require finding “the limit”. ie backup X number of DB tables, then Y number of DB tables, then Z number of DB tables, etc.
Just for reference:
https://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_max_allowed_packetmax_allowed_packet
The maximum size of one packet or any generated/intermediate string.BPS Pro DB tool stuff:
You can check the max_allowed_packet and wait_timeout variable settings in BPS Pro > DB Monitor > DB Status & Info > SHOW SESSION VARIABLES button > max_allowed_packet: 33554432 and wait_timeout: 60You can check data and sizes of all of your DB tables by using: BPS Pro > DB Monitor > DB Status & Info > SHOW TABLE STATUS|SIZE button >
Table Name: xxxxx_bp_activity Table Size: 4.30 MB / 4,401 KB Engine: MyISAM Version: 10 Row Format: Dynamic Rows: 3100 Avg Row Length: 1287 Data Length: 4002528 Max Data Length: 281474976710655 Index Length: 503808 Data Free: 10912 Auto Increment: 22650 Create Time: 2015-09-30 15:20:05 Update Time: 2016-04-28 17:44:07 Check Time: 2015-09-30 15:20:05 Collation: utf8_general_ci Checksum: Create Options: Comment:
Krzysztof
ParticipantThank you for your extensive help! Unfortunately I’m not much of help with it – this is way out of my understanding of things. I have to wait for Mika.
AITpro Admin
KeymasterMika is probably going to have you do all the DB backup tests I mentioned so you can do them now so that you will have the testing results for Mika.
AITpro Admin
Keymaster@ Krzysztof – Do you have the Wordfence plugin installed? If so, I believe Wordfence is causing the error/problem. https://wordpress.org/support/topic/php-warning-82/page/2?replies=35#post-8386427
Krzysztof
ParticipantNope – I’m a hard core BPS Pro only user! 🙂
AITpro Admin
KeymasterOk then that means the same php error is occurring in the BackWPup – WordPress Backup Plugin and the DreamObjects Backups plugin. The BackWPup – WordPress Backup Plugin plugin author was assuming the php error had to do with Wordfence since he had never seen that php error before. So that means that the php error has to do with something that is common in both of these backup plugins and something that has changed in WordPress 4.5. Unfortunately, I have no idea what that would be, but will probably have some time to look into this further in a few days.
Krzysztof
ParticipantThanks!
The most important thing is that the backups are done but if this will last longer I might go for the big fish – tarsnap – the backups for the truly paranoid 😉
edit:
I have also posted your hint at BackWpUp.
Thanks again!AITpro Admin
KeymasterI posted this testing code here: https://wordpress.org/support/topic/warning-error-while-sending-query-packet-pid82827?replies=13#post-8457498 because Mika is updating that particular thread.
/* Notes: execute the function twice to see if the variable values are changed or not. I did not bother with creating additional foreach queries for before and after. If you exceed either the minimum or maximum values the Min|Max value will be used instead of your value. integer is in bytes: 1024 = 1KB | 1073741824 = 1GB max_allowed_packet Permitted Values Type integer Default 4194304 Min Value 1024 Max Value 1073741824 integer is in seconds: 28800 = 480 minutes | 31536000 = 525600 minutes = 8760 hours wait_timeout Permitted Values (Windows) Type integer Default 28800 Min Value 1 Max Value 2147483 Permitted Values (Other) Type integer Default 28800 Min Value 1 Max Value 31536000 */ function buckwheat_says_make_mo_bigger_max_allowed_packet_n_wait_timeout() { global $wpdb; $max_allowed_packet = 'max_allowed_packet'; $wait_timeout = 'wait_timeout'; $result = $wpdb->get_results( $wpdb->prepare( "SHOW SESSION VARIABLES WHERE (Variable_name = %s) OR (Variable_name = %s)", $max_allowed_packet, $wait_timeout ) ); echo '<div class="update-nag">'; echo '<strong>Execute the function twice to see if the values change or not</strong><br>'; foreach ( $result as $data ) { echo '<strong>'.$data->Variable_name.': </strong>'. $data->Value.'</strong><br>'; if ( $data->Variable_name == 'max_allowed_packet' ) { //$map_value = '4194304'; // default value $map_value = '1073741824'; // max value $map_results = $wpdb->query( $wpdb->prepare( "SET GLOBAL max_allowed_packet = %d;", $map_value ) ); } if ( $data->Variable_name == 'wait_timeout' ) { //$wt_value = '28800'; // default value //$wt_value = '2147483'; // max value Windows $wt_value = '31536000'; // max value other $wpdb->query( $wpdb->prepare( "SET GLOBAL wait_timeout = %d;", $wt_value ) ); } } echo '</div>'; } buckwheat_says_make_mo_bigger_max_allowed_packet_n_wait_timeout();
-
AuthorPosts
- You must be logged in to reply to this topic.