Image Server hangs while building tiles

Hi,

I have imported ~800 jpeg images, the biggest of which is less than 9MB size.

When I run the tiling task from the Image Server configuration screen, the job starts and processes a few images (usually less than 10) and then hangs.

Once the MariaDB timeout is reached (whatever the value), the job then ends with the classical error PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away in...

I do not have access to the MariaDB logs, but we can see in the job log below that the process hangs after starting a tiling process Start tiling (deepzoom) and the timeout error is thrown a few minutes later depending on the timeout value.

Note that when I start a new tiling job, the media on which the previous job hung is successfully processed. Then the job processes a variable quantity of media before hanging again.

Any help will be appreciated!

My config:
Omeka-S v4.1.1
Common v3.4.69
IIIF Server v3.6.26
Image Server v3.6.20

Extract of the job log:

2025-06-24T18:03:54+00:00 INFO (6): Media #476: Start tiling (deepzoom)
2025-06-24T18:04:42+00:00 INFO (6): Media #476: End tiling
2025-06-24T18:04:42+00:00 INFO (6): Media #477: Start tiling (deepzoom)
2025-06-24T18:05:40+00:00 INFO (6): Media #477: End tiling
2025-06-24T18:05:40+00:00 INFO (6): Media #478: Start tiling (deepzoom)
2025-06-24T18:06:34+00:00 INFO (6): Media #478: End tiling
2025-06-24T18:06:34+00:00 INFO (6): Media #479: Start tiling (deepzoom)
2025-06-24T18:07:29+00:00 INFO (6): Media #479: End tiling
2025-06-24T18:07:29+00:00 INFO (6): Media #480: Start tiling (deepzoom)
2025-06-24T18:14:29+00:00 ERR (3): PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away in /[my website path...]/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:1740
Stack trace:
#0 /[my website path...]/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1740): PDO->beginTransaction()
#1 /[my website path...]/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(404): Doctrine\DBAL\Connection->beginTransaction()
#2 /[my website path...]/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(392): Doctrine\ORM\UnitOfWork->commit(NULL)
#3 /[my website path...]/omeka-s/modules/ImageServer/src/Mvc/Controller/Plugin/Tiler.php(162): Doctrine\ORM\EntityManager->flush()
#4 /[my website path...]/omeka-s/modules/ImageServer/src/Mvc/Controller/Plugin/Tiler.php(120): ImageServer\Mvc\Controller\Plugin\Tiler->addMediaTleData(Object(Omeka\Api\Representation\MediaRepresentation), Array)
#5 /[my website path...]/omeka-s/modules/ImageServer/src/Job/TilerTrait.php(95): ImageServer\Mvc\Controller\Plugin\Tiler->__invoke(Object(Omeka\Api\Representation\MediaRepresentation), 'skip')
#6 /[my website path...]/omeka-s/modules/ImageServer/src/Job/BulkTiler.php(97): ImageServer\Job\BulkTiler->prepareTile(Object(Omeka\Api\Representation\MediaRepresentation))
#7 /[my website path...]/omeka-s/application/src/Job/DispatchStrategy/Synchronous.php(34): ImageServer\Job\BulkTiler->perform()
#8 /[my website path...]/omeka-s/modules/Common/src/Job/Dispatcher.php(27): Omeka\Job\DispatchStrategy\Synchronous->send(Object(Omeka\Entity\Job))
#9 /[my website path...]/omeka-s/application/data/scripts/perform-job.php(66): Common\Job\Dispatcher->send(Object(Omeka\Entity\Job), Object(Omeka\Job\DispatchStrategy\Synchronous))
#10 {main}
Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away in /[my website path...]/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:117
Stack trace:
#0 /[my website path...]/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(117): PDOStatement->execute(NULL)
#1 /[my website path...]/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1304): Doctrine\DBAL\Driver\PDOStatement->execute()
#2 /[my website path...]/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(747): Doctrine\DBAL\Connection->executeQuery('SELECT t0.id AS...', Array, Array)
#3 /[my website path...]/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(765): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->load(Array, NULL)
#4 /[my website path...]/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(502): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->loadById(Array)
#5 /[my website path...]/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(2000): Doctrine\ORM\EntityManager->find('Omeka\\Entity\\Jo...', Array)
#6 /[my website path...]/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(1933): Doctrine\ORM\UnitOfWork->doMerge(Object(Omeka\Entity\Job), Array)
#7 /[my website path...]/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(746): Doctrine\ORM\UnitOfWork->merge(Object(Omeka\Entity\Job))
#8 /[my website path...]/omeka-s/modules/Common/src/Job/Dispatcher.php(41): Doctrine\ORM\EntityManager->merge(Object(Omeka\Entity\Job))
#9 /[my website path...]/omeka-s/application/data/scripts/perform-job.php(66): Common\Job\Dispatcher->send(Object(Omeka\Entity\Job), Object(Omeka\Job\DispatchStrategy\Synchronous))
#10 {main}

Next Doctrine\DBAL\Driver\PDO\Exception: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away in /[my website path...]/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:18
Stack trace:
#0 /[my website path...]/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(119): Doctrine\DBAL\Driver\PDO\Exception::new(Object(PDOException))
#1 /[my website path...]/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1304): Doctrine\DBAL\Driver\PDOStatement->execute()
#2 /[my website path...]/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(747): Doctrine\DBAL\Connection->executeQuery('SELECT t0.id AS...', Array, Array)
#3 /[my website path...]/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(765): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->load(Array, NULL)
#4 /[my website path...]/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(502): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->loadById(Array)
#5 /[my website path...]/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(2000): Doctrine\ORM\EntityManager->find('Omeka\\Entity\\Jo...', Array)
#6 /[my website path...]/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(1933): Doctrine\ORM\UnitOfWork->doMerge(Object(Omeka\Entity\Job), Array)
#7 /[my website path...]/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(746): Doctrine\ORM\UnitOfWork->merge(Object(Omeka\Entity\Job))
#8 /[my website path...]/omeka-s/modules/Common/src/Job/Dispatcher.php(41): Doctrine\ORM\EntityManager->merge(Object(Omeka\Entity\Job))
#9 /[my website path...]/omeka-s/application/data/scripts/perform-job.php(66): Common\Job\Dispatcher->send(Object(Omeka\Entity\Job), Object(Omeka\Job\DispatchStrategy\Synchronous))
#10 {main}

Next Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing 'SELECT t0.id AS id_1, t0.pid AS pid_2, t0.status AS status_3, t0.class AS class_4, t0.args AS args_5, t0.log AS log_6, t0.started AS started_7, t0.ended AS ended_8, t0.owner_id AS owner_id_9 FROM job t0 WHERE t0.id = ?' with params [39]:

SQLSTATE[HY000]: General error: 2006 MySQL server has gone away in /[my website path...]/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:115
Stack trace:
#0 /[my website path...]/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(182): Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\DBAL\Driver\PDO\Exception))
#1 /[my website path...]/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(159): Doctrine\DBAL\DBALException::wrapException(Object(Doctrine\DBAL\Driver\PDO\MySQL\Driver), Object(Doctrine\DBAL\Driver\PDO\Exception), 'An exception oc...')
#2 /[my website path...]/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(2226): Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDO\MySQL\Driver), Object(Doctrine\DBAL\Driver\PDO\Exception), 'SELECT t0.id AS...', Array)
#3 /[my website path...]/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1313): Doctrine\DBAL\Connection->handleExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDO\Exception), 'SELECT t0.id AS...', Array, Array)
#4 /[my website path...]/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(747): Doctrine\DBAL\Connection->executeQuery('SELECT t0.id AS...', Array, Array)
#5 /[my website path...]/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(765): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->load(Array, NULL)
#6 /[my website path...]/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(502): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->loadById(Array)
#7 /[my website path...]/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(2000): Doctrine\ORM\EntityManager->find('Omeka\\Entity\\Jo...', Array)
#8 /[my website path...]/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(1933): Doctrine\ORM\UnitOfWork->doMerge(Object(Omeka\Entity\Job), Array)
#9 /[my website path...]/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(746): Doctrine\ORM\UnitOfWork->merge(Object(Omeka\Entity\Job))
#10 /[my website path...]/omeka-s/modules/Common/src/Job/Dispatcher.php(41): Doctrine\ORM\EntityManager->merge(Object(Omeka\Entity\Job))
#11 /[my website path...]/omeka-s/application/data/scripts/perform-job.php(66): Common\Job\Dispatcher->send(Object(Omeka\Entity\Job), Object(Omeka\Job\DispatchStrategy\Synchronous))
#12 {main}
  thrown
in /[my website path...]/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php on line 115

… this led me to watch thefiles/tile folder while a job was running: I noticed that, for the biggest images, tiles were still being created beyond the timeout, leading to a state where the tiling process had completed successfully whereas the job had thrown an error due to the timeout exceeded.

After increasing both innodb_lock_wait_timeout and wait_timeout (I didn’t know which to choose :thinking:), the job ran without hanging anymore.

Maybe the logging could be a little clearer :wink:

@Daniel_KM is the author of this module and your best source of info on it.

But just from general principles, what’s happening here it seems to me is that some of your images are taking a huge amount of time to generate tiles for; the one we see at the end of that log is taking 7 minutes if I read correctly, and maybe longer. Increasing wait_timeout is an option that could work for sure. On the other side of things, I seem to recall that this module offers a few ways the tiles can be generated, and some are faster than others.

Yes, the processing of the biggest image took around 15 minutes to complete. The main problem here had more to do with a lack of information. For example, a description of the tiling process would have helped a lot because it is hard to guess that a SQL query is pending while the image is processed.