How to track Drupal max_allowed_packet error?

One of my intermediate sites recently started to throw huge bugs on every admin page in lines:

User warning: Got a packet bigger than max_allowed_packet bytes query: UPDATE cache_update SET data = ... , created = 1298434692, expire = 1298438292, serialized = 1 WHERE cid = update_project_data in _db_query() (line 141 of /var/www/vhosts/mysite/mypath/includes/database.mysqli.inc). (where "..." is approximately 1.5 million characters of serialized data)

How can I track where the error came from? Will adding debugging code to _db_query do anything useful, as it is called so-called?

+4
source share
2 answers

There is no need to track this because you cannot fix it, I think.

This is the cache from update.module containing information about which modules have updated versions, etc. Thus, this comes from one of the calls to _update_cache_set () in this module.

Based on guesses, I would say that this is one of these functions: http://api.drupal.org/api/drupal/modules--update--update.fetch.inc/function/_update_refresh/6

Basically, a huge array is created with information about all the projects of your site and tries to save it as a single serialized value.

How many modules have you installed on this site?

I can come up with three ways to "fix" this error:

  • Increase the size of max_allowed_packet. (max_allowed_packet parameter in my.conf)
  • Disable update.module (this is not so useful on an intermediate / production site anyway when you need to update the dev site first)
  • Disable some modules;)
+5
source

I had a similar error, and I spun for about an hour.

The memory limit has been increased to 512m and there is still a problem. And I thought that was enough. So went looking elsewhere.

I cleared the caches with drush, still an error, and then looked at the database tables.

I noticed that all cache tables have been cleared, with the exception of cache_update. I truncated this table and bam, everything worked fine.

Before getting a memory limit error, I got max_input_vars error since I am in PHP5.4 . But this question and answer led me to this fix. Not quite sure how and why it worked, but it did.

+1
source

Source: https://habr.com/ru/post/1340914/


All Articles