Warning error while sending query packet pid

follow blog steps and you will be able to solve the error “MySQL: Error while sending QUERY packet. PID=XXX” in Magento Migration

Error MySQL Error while sending QUERY

Hello Magento Folks ?,

How are you doing? Welcome to Magento Blog series. Today I will guide you How to Solve Error “MySQL: Error while sending QUERY packet. PID=XXX” in Magento Migration. By any chance, you missed our last published article, take a look at How to Disable Payment Method Programmatically in Magento 2.

Contents

  • 1 Introduction
  • 2 Steps to solve the error “MySQL: Error while sending QUERY Packet. PID=XXX in Magento Migration:
  • 3 The second way is to expand the value of memory size and execution time.
  • 4 Final Words:

Introduction

As you all know Magento 1 has come to an end in June 2020.  So, most of the E-commerce businesses have been migrated to Magento 2. If you are not a developer person you can seamlessly migrate your Magento store at Magento Migration Service. In the migration process, one needs to transfer the data to the database. While transferring, the session time out limit might not be exceeded which can be the cause of receiving MySQL: Error while sending QUERY Packet. Perhaps, the other reason for the error could be the data being bulky for large businesses.

Hence, the solution for it is right here. I have mentioned two ways: one is by changing the code and another is by increasing the value of memory size and execution time to resolve the error. Let’s execute it ?

Steps to solve the error “MySQL: Error while sending QUERY Packet. PID=XXX in Magento Migration:

The first way is to change the code.

Step 1: First of all, go to the following path:

vendormagentodata-migration-tooletcopensource-to-opensource1.9.X.Xconfig.xml

Step 2: Find below tag

<bulk_size>0</bulk_size>

<direct_document_copy>0</direct_document_copy>

Step 3: Replace to this

<bulk_size>100</bulk_size>

<direct_document_copy>1</direct_document_copy>

The second way is to expand the value of memory size and execution time.

Step 1: Change below value in php.ini

memory_limit = 2048M

max_execution_time = 180000

Step 2: Change below value in MySQL file

max_allowed_packet = 504288000

innodb_log_file_size = 3000000

wait_timeout = 4500000

After changing the above value, restart the server.

That’s it.

Final Words:

Therefore, by executing the above steps you will be able to solve the error “MySQL: Error while sending QUERY packet. PID=XXX” in Magento Migration. If you face any trouble write in the comment section below and I will solve it. Share the article with your Magento friends too.

Happy Coding ?

July 2nd, 2017 | by Ravi Chahar || Leave a comment |

Warning error while sending query packet

Just a few days ago, I noticed an unusual error. It was a warning regarding the packet which wasn’t sent properly. The notice was “Warning Error while sending QUERY packet”.

There were also mentioned some parameters to let me know about the file and the line number.

If you’re using WordPress, you should know about the common WordPress errors and their solutions. You can’t expect to run it perfectly all the time.

Sometimes, you need to take some actions to maintain it properly.

In this post, you will learn the reasons and the solutions of “Warning error while sending QUERY packet”.

How does the Error Message Look Like

As mentioned earlier, the notice will have the warning message with a proper packet number.

Let me tell you that error is related to the database of your WordPress website. You will see a related file and the line number too.

Let me show you an example.

Error while sending query packet WordPress

As you can see, it also mismatches the design of the website. It has shifted the excerpt of the article downward. It’s not the only case, you can get a different error.

It’s because the packet and the line numbers would be different.

What’re the Reasons to Get Such Warning

This error is appearing because of the maximum number of database connection requests have made. No further requests are allowed.

It happens on the shared server. The worst part is that your web hosting can’t allow you to increase the number of requests to the database.

It will directly impact other users.

The reason of these requests may be anything. It maybe the size of your website or any plugin you use which is making so many database requests while updating it.

Let me mention that error isn’t bad for anything. It’s just a warning to let you know that your website’s database connection is dealing with some high time.

Removing “Warning Error While Sending QUERY Packet” Message

As mentioned above, if you’re having a shared hosting then it can be the problem. To fix this, you can shift to a managed web hosting.

#1. Managed Web Hosting

To fix this, you can shift to a managed web hosting. It’s only recommended if you have a bigger website otherwise, no need to spend that much of money.

You can get a new managed hosting from WPEngine. It’s because the maximum number of requests allowed are more on a managed server and it can be increased accordingly.

But if you don’t want to change your server then go to the next step.

#2. Optimize the Database

As per the line number and the path, you can easily guess that everything is happening somewhere in the database.

You should always clean up your WordPress database using a plugin. You can use the plugin like WP-Sweep and WP-Optimize.

Such plugins clean the unwanted database tables which are created when you update any post, publish a post, add new media files and delete those.

You should always know the way to uninstall a WordPress plugin completely so that no extra tables remain in the database.

The point is keeping the size of the database as minimum as possible.

#3. Have a CDN

As you know, having a bigger WordPress website can be brainstorming for the browser. It can take so much time to get loaded.

And there are many static pages and images are present on your WordPress website which should be cached by a CDN to improve its speed.

A CDN also acts like a security firewall.

Overall, it improves the user experience and helps you to make fewer database requests. You can set up CloudFlare for WordPress for free.

If you have enough budget then a paid CDN is always a better option.

I Hope You Got a Solution to Your Problem

As I have said earlier, such type of error is unique and different for all.

I have gotten a different packet, you can get something else. But the reasons are the same. The database gets exhausted due to more number of requests than its capacity.

That’s the reasons it’s always recommended to keep your database optimized. I am sure, you can fix this “Warning Error While Sending QUERY Packet”. If you still have any doubt, feel free to drop a comment.

You can also connect with us on Twitter, LinkedIn, and Facebook.

  • This topic has 42 replies, 4 voices, and was last updated 6 years, 4 months ago by AITpro Admin.

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

  • Author

    Posts

  • 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
    

    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() );
    		}
    	}

    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!

    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

    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.

    @ 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.

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

    @ 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

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

    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.

    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.

    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.

    @ 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.

    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. 🙂

    @ 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.

  • Author

    Posts

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

  • You must be logged in to reply to this topic.

Понравилась статья? Поделить с друзьями:
  • Warning error encountered during contract execution out of gas что делать
  • Warning error encountered during contract execution out of gas ledger
  • Warning error creating lldb target at path
  • Warning error compiling scripts try to disable казаки 3
  • Warning division by zero in как исправить