2006 MySQL server has gone away when Collabora server crashes


I do have a stability problem of the Nextcloud Instance of our association: whenever the server that hosts the Collabora crashes (I assume some user opens a file too big, or too many users opens too many files…), the whole Nextcloud instance is completely freezed (even trying to access the logging page takes a few minutes and gives me an internal error). If I look into the logs, I see lots of “2006 MySQL server has gone away” error.

It is installed on a Dedicated Hosting Service and I don’t have access to most of the configuration of the server.
We are on Nextcloud 23.0.2 (php8.0), but that was already true on Nextcloud 21.0.2 (php7.3)
Collabora is installed on another machine via docker, and just the fact that the Collabora cannot be reached is enough to crash the Nextcloud.

Here is one of the entries with the MySql error:

	"message":"Doctrine\\DBAL\\Exception\\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away at /home/clients/9c7ec67fd9c8bb7858856786c3d87ba4/sites/drive.theshifters.org/3rdparty/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php#101",
	"userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:98.0) Gecko/20100101 Firefox/98.0",

This one lists the notification app, but others lists other apps (files, polls).

Here is our configuration:

$CONFIG = array (
  'instanceid' => XXXXXXXXX,
  'passwordsalt' => XXXXXXXXXX,
  'secret' => XXXXXXXXXX,
  'trusted_domains' => 
  array (
    0 => XXXXXXXXXX,
    1 => XXXXXXXXXX,
  'datadirectory' => '/home/clients/9c7ec67fd9c8bb7858856786c3d87ba4/sites/drive.theshifters.org/.htoqtg4i881jvd.data',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => XXXXXXXX,
  'dbname' => 'pj1aq_app_nextcloud',
  'dbhost' => 'pj1aq.myd.infomaniak.com',
  'dbport' => '',
  'dbtableprefix' => 'gkvg_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'pj1aq_app_nextcl',
  'dbpassword' => XXXXXXXXX,
  'installed' => true,
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'drive',
  'mail_domain' => 'theshifters.org',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => XXXXXXXX,
  'mail_smtpname' => XXXXXXXX,
  'mail_smtppassword' => XXXXXXX,
  'mail_smtpport' => '465',
  'theme' => '',
  'loglevel' => 2,
  'default_phone_region' => 'FR',
  'maintenance' => false,
  'updater.release.channel' => 'stable',

Background tasks are configured with a Webcron called every 15 minutes.

Strange thing, I do not have the problem on my personal Nextcloud Instance. If the Collabora is down, only the online edition is down, but otherwise everything works. Main difference, it is installed on my own machine and has a regular cron for the background tasks.

Thanks in advance for anyone having an idea on how to avoid whole crash if only the Collabora server crashes.