Advanced Resource Template Upgrade Error

I posted this topic a month ago.

After a recent group of upgrades, I’m still having trouble getting my Advanced Resources Template module to upgrade. The error that I’m getting is this:

PDOException: SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'UNIQ_31D1FFC816131EA'; check that column/key exists in /home/haitians/public_html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:55
Stack trace:
#0 /home/haitians/public_html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(55): PDO->exec('ALTER TABLE `re...')
#1 /home/haitians/public_html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1534): Doctrine\DBAL\Driver\PDOConnection->exec('ALTER TABLE `re...')
#2 /home/haitians/public_html/modules/AdvancedResourceTemplate/data/scripts/upgrade.php(409): Doctrine\DBAL\Connection->executeStatement('ALTER TABLE `re...')
#3 /home/haitians/public_html/modules/Common/TraitModule.php(372): require_once('/home/haitians/...')
#4 /home/haitians/public_html/modules/Common/TraitModule.php(360): AdvancedResourceTemplate\Module->postUpgradeAuto('3.4.4.17', '3.4.38')
#5 /home/haitians/public_html/modules/Common/TraitModule.php(167): AdvancedResourceTemplate\Module->postUpgrade('3.4.4.17', '3.4.38')
#6 /home/haitians/public_html/application/src/Module/Manager.php(307): AdvancedResourceTemplate\Module->upgrade('3.4.4.17', '3.4.38', Object(Laminas\ServiceManager\ServiceManager))
#7 /home/haitians/public_html/application/src/Controller/Admin/ModuleController.php(250): Omeka\Module\Manager->upgrade(Object(Omeka\Module\Module))
#8 /home/haitians/public_html/vendor/laminas/laminas-mvc/src/Controller/AbstractActionController.php(71): Omeka\Controller\Admin\ModuleController->upgradeAction()
#9 /home/haitians/public_html/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\Mvc\Controller\AbstractActionController->onDispatch(Object(Laminas\Mvc\MvcEvent))
#10 /home/haitians/public_html/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))
#11 /home/haitians/public_html/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php(97): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))
#12 /home/haitians/public_html/vendor/laminas/laminas-mvc/src/DispatchListener.php(132): Laminas\Mvc\Controller\AbstractController->dispatch(Object(Laminas\Http\PhpEnvironment\Request), Object(Laminas\Http\PhpEnvironment\Response))
#13 /home/haitians/public_html/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\Mvc\DispatchListener->onDispatch(Object(Laminas\Mvc\MvcEvent))
#14 /home/haitians/public_html/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))
#15 /home/haitians/public_html/vendor/laminas/laminas-mvc/src/Application.php(325): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))
#16 /home/haitians/public_html/index.php(21): Laminas\Mvc\Application->run()
#17 {main}

Next Doctrine\DBAL\Driver\PDO\Exception: SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'UNIQ_31D1FFC816131EA'; check that column/key exists in /home/haitians/public_html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:18
Stack trace:
#0 /home/haitians/public_html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(60): Doctrine\DBAL\Driver\PDO\Exception::new(Object(PDOException))
#1 /home/haitians/public_html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1534): Doctrine\DBAL\Driver\PDOConnection->exec('ALTER TABLE `re...')
#2 /home/haitians/public_html/modules/AdvancedResourceTemplate/data/scripts/upgrade.php(409): Doctrine\DBAL\Connection->executeStatement('ALTER TABLE `re...')
#3 /home/haitians/public_html/modules/Common/TraitModule.php(372): require_once('/home/haitians/...')
#4 /home/haitians/public_html/modules/Common/TraitModule.php(360): AdvancedResourceTemplate\Module->postUpgradeAuto('3.4.4.17', '3.4.38')
#5 /home/haitians/public_html/modules/Common/TraitModule.php(167): AdvancedResourceTemplate\Module->postUpgrade('3.4.4.17', '3.4.38')
#6 /home/haitians/public_html/application/src/Module/Manager.php(307): AdvancedResourceTemplate\Module->upgrade('3.4.4.17', '3.4.38', Object(Laminas\ServiceManager\ServiceManager))
#7 /home/haitians/public_html/application/src/Controller/Admin/ModuleController.php(250): Omeka\Module\Manager->upgrade(Object(Omeka\Module\Module))
#8 /home/haitians/public_html/vendor/laminas/laminas-mvc/src/Controller/AbstractActionController.php(71): Omeka\Controller\Admin\ModuleController->upgradeAction()
#9 /home/haitians/public_html/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\Mvc\Controller\AbstractActionController->onDispatch(Object(Laminas\Mvc\MvcEvent))
#10 /home/haitians/public_html/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))
#11 /home/haitians/public_html/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php(97): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))
#12 /home/haitians/public_html/vendor/laminas/laminas-mvc/src/DispatchListener.php(132): Laminas\Mvc\Controller\AbstractController->dispatch(Object(Laminas\Http\PhpEnvironment\Request), Object(Laminas\Http\PhpEnvironment\Response))
#13 /home/haitians/public_html/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\Mvc\DispatchListener->onDispatch(Object(Laminas\Mvc\MvcEvent))
#14 /home/haitians/public_html/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))
#15 /home/haitians/public_html/vendor/laminas/laminas-mvc/src/Application.php(325): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))
#16 /home/haitians/public_html/index.php(21): Laminas\Mvc\Application->run()
#17 {main}

Next Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'ALTER TABLE `resource_template_data`
DROP INDEX UNIQ_31D1FFC816131EA,
ADD UNIQUE INDEX uniq_resource_template_id (`resource_template_id`);
ALTER TABLE `resource_template_property_data`
DROP INDEX IDX_B133BBAA16131EA,
DROP INDEX IDX_B133BBAA2A6B767B,
ADD INDEX idx_resource_template_id (`resource_template_id`),
ADD INDEX idx_resource_template_property_id (`resource_template_property_id`);':

SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'UNIQ_31D1FFC816131EA'; check that column/key exists in /home/haitians/public_html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:128
Stack trace:
#0 /home/haitians/public_html/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(182): Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\DBAL\Driver\PDO\Exception))
#1 /home/haitians/public_html/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 /home/haitians/public_html/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), 'ALTER TABLE `re...', Array)
#3 /home/haitians/public_html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1538): Doctrine\DBAL\Connection->handleExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDO\Exception), 'ALTER TABLE `re...', Array, Array)
#4 /home/haitians/public_html/modules/AdvancedResourceTemplate/data/scripts/upgrade.php(409): Doctrine\DBAL\Connection->executeStatement('ALTER TABLE `re...')
#5 /home/haitians/public_html/modules/Common/TraitModule.php(372): require_once('/home/haitians/...')
#6 /home/haitians/public_html/modules/Common/TraitModule.php(360): AdvancedResourceTemplate\Module->postUpgradeAuto('3.4.4.17', '3.4.38')
#7 /home/haitians/public_html/modules/Common/TraitModule.php(167): AdvancedResourceTemplate\Module->postUpgrade('3.4.4.17', '3.4.38')
#8 /home/haitians/public_html/application/src/Module/Manager.php(307): AdvancedResourceTemplate\Module->upgrade('3.4.4.17', '3.4.38', Object(Laminas\ServiceManager\ServiceManager))
#9 /home/haitians/public_html/application/src/Controller/Admin/ModuleController.php(250): Omeka\Module\Manager->upgrade(Object(Omeka\Module\Module))
#10 /home/haitians/public_html/vendor/laminas/laminas-mvc/src/Controller/AbstractActionController.php(71): Omeka\Controller\Admin\ModuleController->upgradeAction()
#11 /home/haitians/public_html/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\Mvc\Controller\AbstractActionController->onDispatch(Object(Laminas\Mvc\MvcEvent))
#12 /home/haitians/public_html/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))
#13 /home/haitians/public_html/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php(97): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))
#14 /home/haitians/public_html/vendor/laminas/laminas-mvc/src/DispatchListener.php(132): Laminas\Mvc\Controller\AbstractController->dispatch(Object(Laminas\Http\PhpEnvironment\Request), Object(Laminas\Http\PhpEnvironment\Response))
#15 /home/haitians/public_html/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\Mvc\DispatchListener->onDispatch(Object(Laminas\Mvc\MvcEvent))
#16 /home/haitians/public_html/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))
#17 /home/haitians/public_html/vendor/laminas/laminas-mvc/src/Application.php(325): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))
#18 /home/haitians/public_html/index.php(21): Laminas\Mvc\Application->run()
#19 {main}

It looks like it may be a different error than last time? (Either that or I didn’t copy/paste the whole thing.

How can I fix it?

When updating another site, I got a different error message:

Error: Call to undefined method AdvancedResourceTemplate\Module::updateItemSetsQueries() in /home/haitians/andrewwyattmaginn.org/Digital_Humanities/modules/AdvancedResourceTemplate/data/scripts/upgrade.php:549
Stack trace:
#0 /home/haitians/andrewwyattmaginn.org/Digital_Humanities/modules/Common/TraitModule.php(372): require_once()
#1 /home/haitians/andrewwyattmaginn.org/Digital_Humanities/modules/Common/TraitModule.php(360): AdvancedResourceTemplate\Module->postUpgradeAuto('3.4.26', '3.4.38')
#2 /home/haitians/andrewwyattmaginn.org/Digital_Humanities/modules/Common/TraitModule.php(167): AdvancedResourceTemplate\Module->postUpgrade('3.4.26', '3.4.38')
#3 /home/haitians/andrewwyattmaginn.org/Digital_Humanities/application/src/Module/Manager.php(307): AdvancedResourceTemplate\Module->upgrade('3.4.26', '3.4.38', Object(Laminas\ServiceManager\ServiceManager))
#4 /home/haitians/andrewwyattmaginn.org/Digital_Humanities/application/src/Controller/Admin/ModuleController.php(250): Omeka\Module\Manager->upgrade(Object(Omeka\Module\Module))
#5 /home/haitians/andrewwyattmaginn.org/Digital_Humanities/vendor/laminas/laminas-mvc/src/Controller/AbstractActionController.php(71): Omeka\Controller\Admin\ModuleController->upgradeAction()
#6 /home/haitians/andrewwyattmaginn.org/Digital_Humanities/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\Mvc\Controller\AbstractActionController->onDispatch(Object(Laminas\Mvc\MvcEvent))
#7 /home/haitians/andrewwyattmaginn.org/Digital_Humanities/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))
#8 /home/haitians/andrewwyattmaginn.org/Digital_Humanities/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php(97): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))
#9 /home/haitians/andrewwyattmaginn.org/Digital_Humanities/vendor/laminas/laminas-mvc/src/DispatchListener.php(132): Laminas\Mvc\Controller\AbstractController->dispatch(Object(Laminas\Http\PhpEnvironment\Request), Object(Laminas\Http\PhpEnvironment\Response))
#10 /home/haitians/andrewwyattmaginn.org/Digital_Humanities/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\Mvc\DispatchListener->onDispatch(Object(Laminas\Mvc\MvcEvent))
#11 /home/haitians/andrewwyattmaginn.org/Digital_Humanities/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))
#12 /home/haitians/andrewwyattmaginn.org/Digital_Humanities/vendor/laminas/laminas-mvc/src/Application.php(325): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))
#13 /home/haitians/andrewwyattmaginn.org/Digital_Humanities/index.php(21): Laminas\Mvc\Application->run()
#14 {main}

After going to Github to look and see if I could find what it was talking about, I saw the link to GitLab. I figured, Why not? So I tried downloading the zip from GitLab. It wasn’t called the same thing, so Extracting it in my cPanel File Manager didn’t work right, so I had to move all of the “guts” to the right Module folder. (“ContactUs” and “Table” also had to be done that way.) When I clicked on the Upgrade button again, IT WORKED!

What I (thought I) downloaded from Github, but it turns out that it was what I downloaded from Omeka.org:

What I downloaded from GitLab:

Another successful upgrade message:

Both sites were then able to upgrade and neither are throwing errors anymore.

So @Daniel_KM, unless you changed something since February, there may be an error in Omeka.org’s Zip file that isn’t in GitHub’s or GitLab’s.

Just a point to clarify: we don’t store/serve separate copies of modules on omeka.org, we just link to the ones on Github. If you look on that module page (or any module page), you’ll see all the links to downloads are links to github.

This looks just to be a situation where Daniel has fixed the problem (a couple weeks ago), but just hasn’t released the fix yet.

1 Like

Ah, good to know. It wasn’t obvious because the Zips had different names.

I am continuing to have problems with upgrading my BlockPlus module. The previous zip file that would install without a problem would then cause some sort of issue where nothing would show in the content of my site (besides the header and footer). It didn’t throw any errors except for sometimes “Not appreciating” when I would Deactivate it for a while and then Activate again to see if it threw an error for the log. When I say it “didn’t appreciate it”, it would suddenly decide to “Forbid” me to Activate.
image

If I uninstall and try re-installing it (using either a fresh download or EasyAdmin), I get an error saying “The javascript library should be installed. See module’s installation documentation.”

How do I fix this?

I fixed it! At least so far… I 'll let you know if it turns out otherwise.

Since the error was saying something about a javascript library, I started comparing the asset folders. The javascript folders were identical, but the vendor folders were not.

image

So just to try something, I copied the vendor folder from the “works” version to the other. I refreshed my module page and clicked Install and it was successful.

image

image

I refreshed my web window and everything was there!

Success!