After adding a second block type to an existing matrix field, we started receiving a "General error: 2006 MySQL server has gone away" error when additional content was saved to the new block type (screenshot attached). This error was shown in the CP and on the front-end. I was also unable to export the database via Sequel Pro.
This error only occurred on production- for some reason development and staging were fine.
I have since fixed production by restoring an earlier version of the database. We're now able to add content to the new matrix block type.
In trying to figure out what caused this error, I came upon the max_allowed packet
setting.
The MySQL docs say:
Both the client and the server have their own max_allowed_packet variable, so if you want to handle big packets, you must increase this variable both in the client and in the server.
According to this SO post, SHOW VARIABLES LIKE 'max_allowed_packet'
tells me that the server value is 64mb.
So I have two questions.
- How do I see the current client value of
max_allowed_packet
(I understand that the docs say it's 16mb by default). - Is it necessary to adjust the client value in the context of running a Craft site? Or does that only apply if I'm manually using the CLI?