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

This topic contains 42 replies, has 4 voices, and was last updated by  AITpro Admin 1 year, 8 months ago.

Viewing 15 posts - 1 through 15 (of 43 total)
  • Author
    Posts
  • #29133

    Krzysztof
    Participant

    SInce a few days I get errors and it might be WordPress 4.5 and BPS Pro (or I migt be wrong) The funny thing is that I get it always approximately at the same time – 22.25-30 like something at that specific moment wouldn’t work.

    [12-Apr-2016 22:27:14 UTC] PHP Warning:  Error while sending QUERY packet. PID=24491 in xxx/wp-includes/wp-db.php on line 1803
    [13-Apr-2016 22:27:58 UTC] PHP Warning:  Error while sending QUERY packet. PID=16626 in xxxx/wp-includes/wp-db.php on line 1803
    [14-Apr-2016 22:24:37 UTC] PHP Warning:  Error while sending QUERY packet. PID=8890 in xxx/wp-includes/wp-db.php on line 1803
    [15-Apr-2016 22:28:59 UTC] PHP Warning:  Error while sending QUERY packet. PID=702 in xxx/wp-includes/wp-db.php on line 1803
    [16-Apr-2016 22:27:02 UTC] PHP Warning:  Error while sending QUERY packet. PID=25025 in xxx/wp-includes/wp-db.php on line 1803
    [17-Apr-2016 22:30:31 UTC] PHP Warning:  Error while sending QUERY packet. PID=17226 in /xxx/wp-includes/wp-db.php on line 1803
    
    #29137

    AITpro Admin
    Keymaster

    We test BPS and BPS Pro with WordPress Beta and RC versions.  WordPress RC versions are pretty much the final WordPress version that is going to be officially released.  Since you are the only person reporting this php error then it is not a BPS Pro and WordPress conflict/issue/problem.  You can always do the standard BPS Pro troubleshooting steps:  http://forum.ait-pro.com/forums/topic/read-me-first-pro/#bps-pro-general-troubleshooting to confirm or eliminate that BPS Pro is causing an issue/problem.

    When I do a Google search for this search term:  Error while sending QUERY packet. wp-db.php on line 1803 I see Google search results for this general php error and the results date back to November 15, 2015, but there appears to be a significant number of recent new occurrences of this error. The php error has to do with a DB Query using mysqli, but the php error does not tell you which plugin or theme or server issue could be causing the problem.  Since the php error is occurring at a certain time then that would mean that most likely a Cron Job scheduled around that time that does a DB Query is the root source of the problem/issue/coding mistake in one of your plugins or your theme.  You can check which Cron Job Hook that might be by going to the BPS Pro > Pro-Tools > Scheduled Crons tool.  Post all of your Scheduled Cron Jobs so I can take a look at them to see if I can tell which plugin or theme is causing this php error.

    /wp-includes/wp-db.php code line 1803

    $this->result = mysqli_query( $this->dbh, $query );
    	/**
    	 * Internal function to perform the mysql_query() call.
    	 *
    	 * @since 3.9.0
    	 *
    	 * @access private
    	 * @see wpdb::query()
    	 *
    	 * @param string $query The query to run.
    	 */
    	private function _do_query( $query ) {
    		if ( defined( 'SAVEQUERIES' ) && SAVEQUERIES ) {
    			$this->timer_start();
    		}
    
    		if ( ! empty( $this->dbh ) && $this->use_mysqli ) {
    			$this->result = mysqli_query( $this->dbh, $query );
    		} elseif ( ! empty( $this->dbh ) ) {
    			$this->result = mysql_query( $query, $this->dbh );
    		}
    		$this->num_queries++;
    
    		if ( defined( 'SAVEQUERIES' ) && SAVEQUERIES ) {
    			$this->queries[] = array( $query, $this->timer_stop(), $this->get_caller() );
    		}
    	}
    #29143

    Krzysztof
    Participant

    I think that I have nailed the plugin – it is this one: DreamObjects Backups
    https://wordpress.org/support/topic/php-warning-82?replies=9#post-8312550

    The time stamp of the error and the backup is just the same – I mean the minutes and seconds but not the hours and this confused me for a while unitil I have checked it more thoroughly.

    The cron job responsible is:
    21/04/2016 @ 00:10 Raz dziennie dh-do-backup

    The rest is for BPS Pro and stock WordPress jobs. Once again thank you for you extensive hep! BPS Pro and it’s suport just rocks!

    #29144

    Jose
    Participant

    My site also got similar errors since I updated WP 4.5 (randomly one or twice a day). These are the last PHP error logs from today.

    [21-Apr-2016 18:51:18 UTC] PHP Warning:  mysqli_real_connect(): (HY000/1203): User dboxxxxxxxxx already has more than 'max_user_connections' active connections in /homepages/38/dxxxxxxxxx/htdocs/wordpress/wp-includes/wp-db.php on line 1489
    [21-Apr-2016 18:51:18 UTC] PHP Warning:  mysqli_real_connect(): (HY000/1203): User dboxxxxxxxxx already has more than 'max_user_connections' active connections in /homepages/38/dxxxxxxxxx/htdocs/wordpress/wp-includes/wp-db.php on line 1489
    [21-Apr-2016 18:51:18 UTC] PHP Warning:  mysqli_real_connect(): (HY000/1203): User dboxxxxxxxxx already has more than 'max_user_connections' active connections in /homepages/38/dxxxxxxxxx/htdocs/wordpress/wp-includes/wp-db.php on line 1489
    [21-Apr-2016 18:51:18 UTC] PHP Warning:  mysqli_real_connect(): (HY000/1203): User dboxxxxxxxxx already has more than 'max_user_connections' active connections in /homepages/38/dxxxxxxxxx/htdocs/wordpress/wp-includes/wp-db.php on line 1489
    [21-Apr-2016 18:51:18 UTC] PHP Warning:  mysqli_real_connect(): (HY000/1203): User dboxxxxxxxxx already has more than 'max_user_connections' active connections in /homepages/38/dxxxxxxxxx/htdocs/wordpress/wp-includes/wp-db.php on line 1489
    [21-Apr-2016 18:51:18 UTC] PHP Warning:  mysqli_real_connect(): (HY000/1203): User dboxxxxxxxxx already has more than 'max_user_connections' active connections in /homepages/38/dxxxxxxxxx/htdocs/wordpress/wp-includes/wp-db.php on line 1489
    #29145

    Jose
    Participant

    After updating WP 4.5 BPS Pro was updated from 11.7 to 11.7.1 and I had to activate manually Master htaccess BulletProof Mode, because it was off.

    #29147

    AITpro Admin
    Keymaster

    @ Jose – the php errors you posted are completely different and not similar in any way.  What is related overall and something new that I just found out about WordPress 4.5 is this:  https://wordpress.org/support/topic/read-this-first-wordpress-45-master-list?replies=7#post-8274461

    Previous to WordPress 4.5, error messages and other warnings that originated in the PHP and MySQL database systems were being suppressed, or hidden from the users. On the whole, this is not a great solution for long term, because while the systems usually “work” even with these types of errors, it is better to find and fix errors when they exist.

    So, WordPress 4.5 removed the error suppression code from the database system. This may cause assorted warnings that you did not previously see. It is important to understand that WordPress 4.5 did not *cause* these warnings, it simply stopped hiding them from you like previous versions did. The errors were already there.

    It is also important to note that these particular issues are rare. Uncommon. They only happen with very specific conditions, usually in older hosting environments. The easiest way to fix them may be to simply have your host update your hosting service to a newer server, or to migrate to a better hosting system in some manner.

    When I do this Google search: mysqli_real_connect(): (HY000/1203): User already has more than ‘max_user_connections’ active connections in the Google search results are saying pretty much what the php error is saying – you have maxed out on database user connections temporarily. On my web host I get 200 active DB connections at a time. If 201 DB connections are made then I see this same error. On my web host I cannot change or increase the max_user_connections setting because I do not have access to the MySQL server files to make a change. In any case 200 active DB connections at a time is actually much higher than most other web hosts allow. So anyway if you are seeing the php error occaisonally then that just means you are temporarily maxed out on DB connections. If you are seeing that php error constantly then you need to contact your web host about this issue/problem.

    Not sure why you had to manually activate BulletProof Mode. No one else has ever mentioned this type of issue/problem with any BPS Pro versions including BPS Pro 11.7.1.

    #29149

    Jose
    Participant

    Ok. So I’ll contact the web host trying to resolve it. Thanks a lot.

    #29150

    AITpro Admin
    Keymaster

    @ Jose – If you want to see what your host’s MySQL server setting is for max_user_connections then go to the BPS Pro Logs & Info main menu > DB Status & Info menu > under General DB Info you will see these 2 MySQL server settings.  The connection numbers below are for my host’s MySQL server.  Your connection numbers will most likely be different.

    max_user_connections (Your Account): 200
    max_connections (Server): 1000

    #29153

    Jose
    Participant

    Yep; I see
    max_user_connections (Your Account): 18
    max_connections (Server): 240
    That’s very very different.

    #29155

    AITpro Admin
    Keymaster

    Wow 18 max_user_connections is extremely low.  Like I said my web host offers more active DB connections than most other web hosts, but the average setting for max_user_connections on other web hosts is usually between 30 to 80.

    #29157

    Jose
    Participant

    I’m gonna explain this issue to them by mail. I hope they are going to resolve this. If not, I think it’s time for changing to another provider.

    #29182

    Jose
    Participant

    I sent a mail to the web host company asking if they could increase it, and they tried answering my question asking me permission for they to call me by phone. I suppose they are trying me to contract a dedicated server, but mine is a personal author website and has no incomes at this moment. Otherwise, they include in their mail “answer” some links about mysql that have no relation to what I am asking.

    Reading Samuel Wood (Otto) considerations, I guess this issue has been present for a long time, but I didn’t realized until now. So, I think I’m going to find out myself if it is therefore desirable continuing this relationship with this provider or if I should be moving my website to another company. Thanks for the support.

    #29183

    AITpro Admin
    Keymaster

    @ Jose – If your host has been doing a good job overall (websites running well consistently, minimal website/server downtime, minimal/acceptable number of problems) and you are happy with your current hosting and the only issue is just this new php error then you should probably stick with your current host.  If on the other hand you are not happy with your host for other/various reasons and this new php error is just one more factor in your decision to get another host then switching to another host is probably a good idea.

    What you would be asking them to change in the MySQL server configuration is something that would affect all website owners using a particular MySQL server.  It is not possible to change max_user_connections for just 1 website since this MySQL server configuration setting affects all websites using that MySQL server.

    #29184

    Jose
    Participant

    I agree. The main factor was seeing these new assorted warnings for the first times after updating to WP 4.5. The only problem maybe if somebody charges any page at the same short time it’s occurring (this momentary disconnection displays the well-known “Error establishing a database connection” browser warning). So I coincide that if there aren’t any other serious problems (this happens once o twice a day – Monday to Friday! ¿?) I should be sticking with this current host. Thanks a lot again. 🙂

    #29188

    AITpro Admin
    Keymaster

    @ Jose – You can check the total number of DB connections by looking that the DB Monitor > DB Status & Info page information > SHOW SESSION DB Status.

    Currently on this forum site this is what I see for this site’s MySQL connections below. Threads are equal to DB connections and show current DB connections. There are other MySQL variable values that show a “history” or cumulative information, but thread variable status values show you current connection status information.

    SHOW SESSION DB Status
    Threads_connected: 13 – shows all connected threads including idle connections.
    Threads_running: 3 – shows active threads and the amount of queries currently processing. It does not count sleeping threads.
    Threads_created: 71 – total threads created during this session.
    Threads_cached: 58 – total cached threads during this session. cached threads can be reused.

Viewing 15 posts - 1 through 15 (of 43 total)

You must be logged in to reply to this topic.