Hi,

After installing some modules, I discovered that my site started sending out the following error messages;

Warning: Table 'watchdog' was not locked with LOCK TABLES query: INSERT INTO watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (1, 'php', 'Got a packet bigger than 'max_allowed_packet' bytes\nquery: UPDATE cache_views SET data = 'a:4:{s:6:\\"tables\\";a:203:{s:17:\\"nodefamily_parent\\";a:3:{s:4:\\"name\\";s:10:\\"nodefamily\\";s:4:\\"join\\";a:3:{s:4:\\"left\\";a:2:{s:5:\\"table\\";s:4:\\"node\\";s:5:\\"field\\";s:3:\\"nid\\";}s:5:\\"right\\";a:1:{s:5:\\"field\\";s:10:\\"parent_nid\\";}s:4:\\"type\\";s:5:\\"inner\\";}s: in /home/masked/public_html/includes/database.mysql.inc on line 172

How can this be resolved? I've changed the max_allowed_packet setting to 32MB and the matter it still unresolved. Does the max_allowed_packet setting depend on the number of modules running on a site? Cos I have quite a load full of modules running on the site, even though some of them are not yet installed or activated.

Do I need to increase the max_allowed_packet further? And if I do how will that affect my servers performance? Just for the record, I'm running this site on a VPS (Virtual Private Server) server.

Cheers.

Comments

jazzitup’s picture

Try using the same method as I suggested here: http://drupal.org/node/220266

--
www.jazzit.hr

obisun’s picture

Hi,

I eventually got to resolve this issue, but not before trying so many other avenues that failed.

First I thought it was the module in question, so I tried to disable the modules, but that didnt work. Then I tried to delete the watchdog table in the database and then re-install it, but that made matters worse. So I made a search and discovered that the issue had to do with the max_allowed_packet setting for the mysql on my server. So I sent a mail to the Tech Support of my web host as follows;

    Can I Increase memory in the php.ini file? And where is it located? How will that affect my server performance. I'm running a drupal based site on my server and I've been receiving the following error message after updating one of the modules and was adviced to increase the max_allowed_packet setting for the mysql. Kindly advice.

And then they replied as follows;

    There is no max_allowed_packet setting in php.ini file, nor in my.cnf file. The max_allowed_packet file should be located in my.cnf (mySQL configuration file) rather then php.ini. I've set the value to 32M, let us know if this suits your needs.

And that just did it. I hope this helps some one else.

Cheers.

I delight in giving Light!

dafreak’s picture

I'm having a similar max_allowed_packet error but my host refuses to change the setting in my.cnf. They say "Its not allowed on shared hosting." They have it set to 1M. After reading the MySQL reference manual I discovered that max_allowed_packet is a DYNAMIC system variable and I should be able to set it per session. I tried adding the following in database.mysql.inc on line 85 after the "//Force UTF-8" entry but before "return $connection;":

// Force max_allowed_packet size
mysql_query('SET @@max_allowed_packet = 16000000;', $connection);

There's no error message from this, but I'm still getting the original error about exceeding the packet size. Am I putting it in the wrong place? Am I using the wrong function? I can't find the mysql_query() function anywhere. Where does it live? Am I using it wrong? Anyone know? Will anyone read this post? Maybe if I freak out a little?:

FREAK FREAK! #$%^&*(*&^%$#$%% $$&^&%^$%W FREEEEAAAK!@!

Best smile when I say that: :-)

Please help me someone.

jazzitup’s picture

ramones79’s picture

madjoe - Your search yielded no results

jazzitup’s picture

The search engine on drupal.org has changed since my previous post and that's why those URLs lead you nowhere.
The point was to use a search. For those that I should draw pictures, here's an update of URLs mentioned from above:

http://drupal.org/search/apachesolr_search/max_allowed_packet?filters=ty...
http://drupal.org/search/apachesolr_search/increase%20memory%20limit?fil...

Francewhoa’s picture

About the 'max_allowed_packet' the following worked for me on Ubuntu 8.04.x LTS desktop edition http://drupal.org/node/541396

Loving back your Drupal community result in multiple benefits for you  
calbasi’s picture

Hello,

I've got this error. But:

- It was only in one of my several webs (hosted at the same VPS / server, same my.cnf, etc.)
- I have it only with my Iceweasel (firefox) 3.5.10 (debian testing)

Here you can read than "Both the client and the server have their own max_allowed_packet variable"

http://dev.mysql.com/doc/refman/5.1/en/packet-too-large.html

Ok, I've tried to increase the my.cnf memory to 32 or 64Mb without success but then I've think that my "client side" is my browser, isn't it... I've tried with other browser Epiphany 2.30.2 and I can now add / edit content without errors.

Regards!

agrelos’s picture

Hi

MySQL is a database server. The client is the PHP extension (for example) that connects to the server, not your browser!

If you take a better look in the MySQL docs page http://dev.mysql.com/doc/refman/5.1/en/packet-too-large.html, you'll see that the two shell command are different:

mysql --max_allowed_packet=32M -> this is one client, the mysql command line utility

mysqld --max_allowed_packet=16M -> notice the 'd' after mysql? that's the daemon or the server

To set the server's max_allowed_packet you could use a my.cnf file. If you have a VPS you should have root access to do it. Don't forget to restart the mysqld after altering server's settings.

I wonder is how you set the max_allowed_packet on PHP client?

Best regards
Pedro Agrelos