Omeka S has encountered an error/mysql server has gone away - on shared hosting

Hello,

I am encountering problems with the “mysql server has gone away” error in a shared hosting environment. I get the error when trying to upload files larger than 50 MB. However, I can see through FTP that the files are uploading fine and appear in my “files” directory, but not in the application interface.

The error seems to result when the application tries to get the audio icon thumbnail - it’s an mp3 file so there shouldn’t need to be any image processing for the thumbnails. Since I am on shared hosting, I can’t restart the mysql server and I also don’t have access to the server’s log of the events.

I appreciate your help or guidance on this issue. Here is my application.log stack trace from Omeka:

2019-12-26T15:49:23+00:00 ERR (3): Command “/bin/convert ‘/tmp/omekan7B0o8[0]’ -auto-orient -background white +repage -alpha remove -thumbnail ‘600x600>’ ‘/tmp/omekaTUoaFM.jpg’” failed with status code 1.
2019-12-26T15:49:23+00:00 ERR (3): PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away in /home/jhsgho5/public_html/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:105
Stack trace:
#0 /home/jhsgho5/public_html/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(105): PDOStatement->execute(NULL)
#1 /home/jhsgho5/public_html/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(847): Doctrine\DBAL\Driver\PDOStatement->execute()
#2 /home/jhsgho5/public_html/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(1808): Doctrine\DBAL\Connection->executeQuery(‘SELECT t1.id AS…’, Array, Array)
#3 /home/jhsgho5/public_html/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(1747): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->getOneToManyStatement(Array, Object(Omeka\Entity\Item))
#4 /home/jhsgho5/public_html/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(2835): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->loadOneToManyCollection(Array, Object(Omeka\Entity\Item), Object(Doctrine\ORM\PersistentCollection))
#5 /home/jhsgho5/public_html/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/PersistentCollection.php(694): Doctrine\ORM\UnitOfWork->loadCollection(Object(Doctrine\ORM\PersistentCollection))
#6 /home/jhsgho5/public_html/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/PersistentCollection.php(213): Doctrine\ORM\PersistentCollection->doInitialize()
#7 /home/jhsgho5/public_html/omeka-s/vendor/doctrine/collections/lib/Doctrine/Common/Collections/AbstractLazyCollection.php(274): Doctrine\ORM\PersistentCollection->initialize()
#8 /home/jhsgho5/public_html/omeka-s/application/src/Api/Adapter/ItemAdapter.php(199): Doctrine\Common\Collections\AbstractLazyCollection->getIterator()
#9 /home/jhsgho5/public_html/omeka-s/application/src/Api/Adapter/AbstractEntityAdapter.php(544): Omeka\Api\Adapter\ItemAdapter->hydrate(Object(Omeka\Api\Request), Object(Omeka\Entity\Item), Object(Omeka\Stdlib\ErrorStore))
#10 /home/jhsgho5/public_html/omeka-s/application/src/Api/Adapter/AbstractEntityAdapter.php(364): Omeka\Api\Adapter\AbstractEntityAdapter->hydrateEntity(Object(Omeka\Api\Request), Object(Omeka\Entity\Item), Object(Omeka\Stdlib\ErrorStore))
#11 /home/jhsgho5/public_html/omeka-s/application/src/Api/Manager.php(233): Omeka\Api\Adapter\AbstractEntityAdapter->update(Object(Omeka\Api\Request))
#12 /home/jhsgho5/public_html/omeka-s/application/src/Api/Manager.php(136): Omeka\Api\Manager->execute(Object(Omeka\Api\Request))
#13 /home/jhsgho5/public_html/omeka-s/application/src/Mvc/Controller/Plugin/Api.php(152): Omeka\Api\Manager->update(‘items’, ‘57’, Array, Array, Array)
#14 /home/jhsgho5/public_html/omeka-s/application/src/Controller/Admin/ItemController.php(241): Omeka\Mvc\Controller\Plugin\Api->update(‘items’, ‘57’, Array, Array)
#15 /home/jhsgho5/public_html/omeka-s/vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(78): Omeka\Controller\Admin\ItemController->editAction()
#16 /home/jhsgho5/public_html/omeka-s/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#17 /home/jhsgho5/public_html/omeka-s/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#18 /home/jhsgho5/public_html/omeka-s/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(106): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#19 /home/jhsgho5/public_html/omeka-s/vendor/zendframework/zend-mvc/src/DispatchListener.php(138): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#20 /home/jhsgho5/public_html/omeka-s/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#21 /home/jhsgho5/public_html/omeka-s/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#22 /home/jhsgho5/public_html/omeka-s/vendor/zendframework/zend-mvc/src/Application.php(332): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#23 /home/jhsgho5/public_html/omeka-s/index.php(21): Zend\Mvc\Application->run()
#24 {main}

Next Doctrine\DBAL\Driver\PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away in /home/jhsgho5/public_html/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:107
Stack trace:
#0 /home/jhsgho5/public_html/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(847): Doctrine\DBAL\Driver\PDOStatement->execute()
#1 /home/jhsgho5/public_html/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(1808): Doctrine\DBAL\Connection->executeQuery(‘SELECT t1.id AS…’, Array, Array)
#2 /home/jhsgho5/public_html/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(1747): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->getOneToManyStatement(Array, Object(Omeka\Entity\Item))
#3 /home/jhsgho5/public_html/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(2835): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->loadOneToManyCollection(Array, Object(Omeka\Entity\Item), Object(Doctrine\ORM\PersistentCollection))
#4 /home/jhsgho5/public_html/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/PersistentCollection.php(694): Doctrine\ORM\UnitOfWork->loadCollection(Object(Doctrine\ORM\PersistentCollection))
#5 /home/jhsgho5/public_html/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/PersistentCollection.php(213): Doctrine\ORM\PersistentCollection->doInitialize()
#6 /home/jhsgho5/public_html/omeka-s/vendor/doctrine/collections/lib/Doctrine/Common/Collections/AbstractLazyCollection.php(274): Doctrine\ORM\PersistentCollection->initialize()
#7 /home/jhsgho5/public_html/omeka-s/application/src/Api/Adapter/ItemAdapter.php(199): Doctrine\Common\Collections\AbstractLazyCollection->getIterator()
#8 /home/jhsgho5/public_html/omeka-s/application/src/Api/Adapter/AbstractEntityAdapter.php(544): Omeka\Api\Adapter\ItemAdapter->hydrate(Object(Omeka\Api\Request), Object(Omeka\Entity\Item), Object(Omeka\Stdlib\ErrorStore))
#9 /home/jhsgho5/public_html/omeka-s/application/src/Api/Adapter/AbstractEntityAdapter.php(364): Omeka\Api\Adapter\AbstractEntityAdapter->hydrateEntity(Object(Omeka\Api\Request), Object(Omeka\Entity\Item), Object(Omeka\Stdlib\ErrorStore))
#10 /home/jhsgho5/public_html/omeka-s/application/src/Api/Manager.php(233): Omeka\Api\Adapter\AbstractEntityAdapter->update(Object(Omeka\Api\Request))
#11 /home/jhsgho5/public_html/omeka-s/application/src/Api/Manager.php(136): Omeka\Api\Manager->execute(Object(Omeka\Api\Request))
#12 /home/jhsgho5/public_html/omeka-s/application/src/Mvc/Controller/Plugin/Api.php(152): Omeka\Api\Manager->update(‘items’, ‘57’, Array, Array, Array)
#13 /home/jhsgho5/public_html/omeka-s/application/src/Controller/Admin/ItemController.php(241): Omeka\Mvc\Controller\Plugin\Api->update(‘items’, ‘57’, Array, Array)
#14 /home/jhsgho5/public_html/omeka-s/vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(78): Omeka\Controller\Admin\ItemController->editAction()
#15 /home/jhsgho5/public_html/omeka-s/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#16 /home/jhsgho5/public_html/omeka-s/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#17 /home/jhsgho5/public_html/omeka-s/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(106): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#18 /home/jhsgho5/public_html/omeka-s/vendor/zendframework/zend-mvc/src/DispatchListener.php(138): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#19 /home/jhsgho5/public_html/omeka-s/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#20 /home/jhsgho5/public_html/omeka-s/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#21 /home/jhsgho5/public_html/omeka-s/vendor/zendframework/zend-mvc/src/Application.php(332): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#22 /home/jhsgho5/public_html/omeka-s/index.php(21): Zend\Mvc\Application->run()
#23 {main}

Next Doctrine\DBAL\Exception\DriverException: An exception occurred while executing ‘SELECT t1.id AS id_2, t1.is_public AS is_public_3, t1.created AS created_4, t1.modified AS modified_5, t0.ingester AS ingester_6, t0.renderer AS renderer_7, t0.data AS data_8, t0.source AS source_9, t0.media_type AS media_type_10, t0.storage_id AS storage_id_11, t0.extension AS extension_12, t0.sha256 AS sha256_13, t0.size AS size_14, t0.has_original AS has_original_15, t0.has_thumbnails AS has_thumbnails_16, t0.position AS position_17, t0.lang AS lang_18, t1.owner_id AS owner_id_19, t1.resource_class_id AS resource_class_id_20, t1.resource_template_id AS resource_template_id_21, t1.thumbnail_id AS thumbnail_id_22, t0.item_id AS item_id_23, t1.resource_type FROM media t0 INNER JOIN resource t1 ON t0.id = t1.id WHERE t0.item_id = ? ORDER BY t0.position ASC’ with params [57]:

SQLSTATE[HY000]: General error: 2006 MySQL server has gone away in /home/jhsgho5/public_html/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:115
Stack trace:
#0 /home/jhsgho5/public_html/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(128): Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException(‘An exception oc…’, Object(Doctrine\DBAL\Driver\PDOException))
#1 /home/jhsgho5/public_html/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(855): Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Driver\PDOException), ‘SELECT t1.id AS…’, Array)
#2 /home/jhsgho5/public_html/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(1808): Doctrine\DBAL\Connection->executeQuery(‘SELECT t1.id AS…’, Array, Array)
#3 /home/jhsgho5/public_html/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(1747): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->getOneToManyStatement(Array, Object(Omeka\Entity\Item))
#4 /home/jhsgho5/public_html/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(2835): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->loadOneToManyCollection(Array, Object(Omeka\Entity\Item), Object(Doctrine\ORM\PersistentCollection))
#5 /home/jhsgho5/public_html/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/PersistentCollection.php(694): Doctrine\ORM\UnitOfWork->loadCollection(Object(Doctrine\ORM\PersistentCollection))
#6 /home/jhsgho5/public_html/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/PersistentCollection.php(213): Doctrine\ORM\PersistentCollection->doInitialize()
#7 /home/jhsgho5/public_html/omeka-s/vendor/doctrine/collections/lib/Doctrine/Common/Collections/AbstractLazyCollection.php(274): Doctrine\ORM\PersistentCollection->initialize()
#8 /home/jhsgho5/public_html/omeka-s/application/src/Api/Adapter/ItemAdapter.php(199): Doctrine\Common\Collections\AbstractLazyCollection->getIterator()
#9 /home/jhsgho5/public_html/omeka-s/application/src/Api/Adapter/AbstractEntityAdapter.php(544): Omeka\Api\Adapter\ItemAdapter->hydrate(Object(Omeka\Api\Request), Object(Omeka\Entity\Item), Object(Omeka\Stdlib\ErrorStore))
#10 /home/jhsgho5/public_html/omeka-s/application/src/Api/Adapter/AbstractEntityAdapter.php(364): Omeka\Api\Adapter\AbstractEntityAdapter->hydrateEntity(Object(Omeka\Api\Request), Object(Omeka\Entity\Item), Object(Omeka\Stdlib\ErrorStore))
#11 /home/jhsgho5/public_html/omeka-s/application/src/Api/Manager.php(233): Omeka\Api\Adapter\AbstractEntityAdapter->update(Object(Omeka\Api\Request))
#12 /home/jhsgho5/public_html/omeka-s/application/src/Api/Manager.php(136): Omeka\Api\Manager->execute(Object(Omeka\Api\Request))
#13 /home/jhsgho5/public_html/omeka-s/application/src/Mvc/Controller/Plugin/Api.php(152): Omeka\Api\Manager->update(‘items’, ‘57’, Array, Array, Array)
#14 /home/jhsgho5/public_html/omeka-s/application/src/Controller/Admin/ItemController.php(241): Omeka\Mvc\Controller\Plugin\Api->update(‘items’, ‘57’, Array, Array)
#15 /home/jhsgho5/public_html/omeka-s/vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(78): Omeka\Controller\Admin\ItemController->editAction()
#16 /home/jhsgho5/public_html/omeka-s/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#17 /home/jhsgho5/public_html/omeka-s/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#18 /home/jhsgho5/public_html/omeka-s/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(106): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#19 /home/jhsgho5/public_html/omeka-s/vendor/zendframework/zend-mvc/src/DispatchListener.php(138): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#20 /home/jhsgho5/public_html/omeka-s/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#21 /home/jhsgho5/public_html/omeka-s/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#22 /home/jhsgho5/public_html/omeka-s/vendor/zendframework/zend-mvc/src/Application.php(332): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#23 /home/jhsgho5/public_html/omeka-s/index.php(21): Zend\Mvc\Application->run()
#24 {main}

“MySQL server has gone away” without any other indication of an error usually just means that you exceeded the MySQL server’s configured wait timeout limit: the amount of time the server will keep a connection open waiting for a query.

I suppose what’s happening is that waiting for the file to upload and for ImageMagick to decide that it can’t process it is taking too long for your timeout. To narrow down if ImageMagick is the problem area, you can change your configuration to disable thumbnail generation and see if it resolves your issue.

You could also check if your host will increase the MySQL timeout limit for you, but on a shared host they may not be willing to make that kind of change.

Thank you, John. I’m sorry to be dense, but can you show me how the config file should look to disable thumbnails? I’ve tried a few times and can’t figure out how to make it work and the documentation doesn’t show an example of where to indicate “NoThumbnail”. Thanks.

Under “aliases” there should be a line that mentions ImageMagick: you should change the part of that line that says ImageMagick to say NoThumbnail instead.

Thank you! Unfortunately it still times out, so I guess we may be shopping around for a new host soon.