Here’s the error I get when updating
Doctrine\DBAL\Exception\TableExistsException
An exception occurred while executing ‘CREATE TABLE mapping_feature (id INT UNSIGNED AUTO_INCREMENT NOT NULL, item_id INT NOT NULL, media_id INT DEFAULT NULL, label
VARCHAR(255) DEFAULT NULL, geography GEOMETRY NOT NULL COMMENT ‘(DC2Type:geography)’, INDEX IDX_34879C46126F525E (item_id), INDEX IDX_34879C46EA9FDD75 (media_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
ENGINE = InnoDB;’: SQLSTATE[42S01]: Base table or view already exists: 1050 Table ‘mapping_feature’ already exists
Thanks for your help
We’ve seen this happen in rare cases when the user inadvertently clicks the upgrade button twice before the page reloads. The first upgrade initiates but is interrupted before updating the module version. Here, the second upgrade fails because it’s attempting to create a table that the first upgrade already created.
Can you look at your Omeka S database and tell me if a mapping_marker
table exists?
Yes, there is a mapping_marker table in my database
How many rows does the mapping_marker
table have? How many rows does the mapping_feature
table have?
Did you happen to see an error during the upgrade? If you have logging enabled, you could check your logs.
mapping_feature 6216 rows
mapping_marker 6238 rows
Here’s the error code in the Log file
2024-08-03T08:08:13+00:00 ERR (3): PDOException: SQLSTATE[42S01]: Base table or view already exists: 1050 Table ‘mapping_feature’ already exists in …bsd/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:55
Stack trace:
#0 …bsd/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(55): PDO->exec()
#1 …bsd/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1579): Doctrine\DBAL\Driver\PDOConnection->exec()
#2 …bsd/modules/Mapping/Module.php(163): Doctrine\DBAL\Connection->exec()
#3 …bsd/modules/Mapping/Module.php(140): Mapping\Module->upgradeToV2()
#4 …bsd/application/src/Module/Manager.php(307): Mapping\Module->upgrade()
#5 …bsd/application/src/Controller/Admin/ModuleController.php(250): Omeka\Module\Manager->upgrade()
#6 …bsd/vendor/laminas/laminas-mvc/src/Controller/AbstractActionController.php(71): Omeka\Controller\Admin\ModuleController->upgradeAction()
#7 …bsd/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\Mvc\Controller\AbstractActionController->onDispatch()
#8 …bsd/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners()
#9 …bsd/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php(97): Laminas\EventManager\EventManager->triggerEventUntil()
#10 …bsd/vendor/laminas/laminas-mvc/src/DispatchListener.php(132): Laminas\Mvc\Controller\AbstractController->dispatch()
#11 …bsd/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\Mvc\DispatchListener->onDispatch()
#12 …bsd/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners()
#13 …bsd/vendor/laminas/laminas-mvc/src/Application.php(325): Laminas\EventManager\EventManager->triggerEventUntil()
#14 …bsd/index.php(21): Laminas\Mvc\Application->run()
#15 {main}
Next Doctrine\DBAL\Driver\PDO\Exception: SQLSTATE[42S01]: Base table or view already exists: 1050 Table ‘mapping_feature’ already exists in …bsd/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:18
Stack trace:
#0 …bsd/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(60): Doctrine\DBAL\Driver\PDO\Exception::new()
#1 …bsd/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1579): Doctrine\DBAL\Driver\PDOConnection->exec()
#2 …bsd/modules/Mapping/Module.php(163): Doctrine\DBAL\Connection->exec()
#3 …bsd/modules/Mapping/Module.php(140): Mapping\Module->upgradeToV2()
#4 …bsd/application/src/Module/Manager.php(307): Mapping\Module->upgrade()
#5 …bsd/application/src/Controller/Admin/ModuleController.php(250): Omeka\Module\Manager->upgrade()
#6 …bsd/vendor/laminas/laminas-mvc/src/Controller/AbstractActionController.php(71): Omeka\Controller\Admin\ModuleController->upgradeAction()
#7 …bsd/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\Mvc\Controller\AbstractActionController->onDispatch()
#8 …bsd/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners()
#9 …bsd/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php(97): Laminas\EventManager\EventManager->triggerEventUntil()
#10 …bsd/vendor/laminas/laminas-mvc/src/DispatchListener.php(132): Laminas\Mvc\Controller\AbstractController->dispatch()
#11 …bsd/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\Mvc\DispatchListener->onDispatch()
#12 …bsd/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners()
#13 …bsd/vendor/laminas/laminas-mvc/src/Application.php(325): Laminas\EventManager\EventManager->triggerEventUntil()
#14 …bsd/index.php(21): Laminas\Mvc\Application->run()
#15 {main}
Next Doctrine\DBAL\Exception\TableExistsException: An exception occurred while executing ‘CREATE TABLE mapping_feature (id INT UNSIGNED AUTO_INCREMENT NOT NULL, item_id INT NOT NULL, media_id INT DEFAULT NULL, label
VARCHAR(255) DEFAULT NULL, geography GEOMETRY NOT NULL COMMENT ‘(DC2Type:geography)’, INDEX IDX_34879C46126F525E (item_id), INDEX IDX_34879C46EA9FDD75 (media_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
ENGINE = InnoDB;’:
SQLSTATE[42S01]: Base table or view already exists: 1050 Table ‘mapping_feature’ already exists in …bsd/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:57
Stack trace:
#0 …bsd/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(182): Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException()
#1 …bsd/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(159): Doctrine\DBAL\DBALException::wrapException()
#2 …bsd/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(2226): Doctrine\DBAL\DBALException::driverExceptionDuringQuery()
#3 …bsd/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1581): Doctrine\DBAL\Connection->handleExceptionDuringQuery()
#4 …bsd/modules/Mapping/Module.php(163): Doctrine\DBAL\Connection->exec()
#5 …bsd/modules/Mapping/Module.php(140): Mapping\Module->upgradeToV2()
#6 …bsd/application/src/Module/Manager.php(307): Mapping\Module->upgrade()
#7 …bsd/application/src/Controller/Admin/ModuleController.php(250): Omeka\Module\Manager->upgrade()
#8 …bsd/vendor/laminas/laminas-mvc/src/Controller/AbstractActionController.php(71): Omeka\Controller\Admin\ModuleController->upgradeAction()
#9 …bsd/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\Mvc\Controller\AbstractActionController->onDispatch()
#10 …bsd/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners()
#11 …bsd/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php(97): Laminas\EventManager\EventManager->triggerEventUntil()
#12 …bsd/vendor/laminas/laminas-mvc/src/DispatchListener.php(132): Laminas\Mvc\Controller\AbstractController->dispatch()
#13 …bsd/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\Mvc\DispatchListener->onDispatch()
#14 …bsd/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners()
#15 …bsd/vendor/laminas/laminas-mvc/src/Application.php(325): Laminas\EventManager\EventManager->triggerEventUntil()
#16 …bsd/index.php(21): Laminas\Mvc\Application->run()
#17 {main} {“userId”:1}
It appears that your initial upgrade failed while copying over rows from mapping_marker
to mapping_feature
, with 22 more rows to copy. It could have timed out, the database could have gone away, or one of the rows was corrupted. It’s impossible to know without seeing the related error message.
Here’s what I would do: go back to your old version of the module by replacing the Mapping directory with the exact version you upgraded from. Once that’s done, check to see if everything works as it once did. If so, you can delete the mapping_feature
table and try the upgrade again. Make sure error logging is enabled.
Out of an abundance of caution, you could make a backup of your database. Everything should be fine but it’s a good idea anyway.
Thank you, the correction worked
I believe this is related:
With Omeka S 4.1.1 and a site with Map by Query block …
With Mapping 2.0: I get an empty screen, no error message, no contents in html .
This worked fine with > 13000 items and geo positions before upgrading.
I tried ‘refreshing’ with re-appying Mapping via CVS Import, but same result.
I deleted all items and started over, still no difference.
I created a new Item Set with one item, the Item in it looks fine when listed and has mapping info, but still I get an empty page on the site with Map by Query.
Not sure if I can manage/have privilege to look into the DB and delete tables an so, but I’m happy for any help. Thanks!
Some times I have returned to Mapping 1.10, and I get this Error:
Doctrine\DBAL\Exception\TableNotFoundException
An exception occurred while executing ‘SELECT r0_.id AS id_0, r0_.id AS id_1 FROM item i1_ INNER JOIN resource r0_ ON i1_.id = r0_.id INNER JOIN item_site i3_ ON i1_.id = i3_.item_id INNER JOIN site s2_ ON s2_.id = i3_.site_id AND (s2_.id = ?) INNER JOIN mapping_marker m4_ ON (m4_.item_id = r0_.id) GROUP BY r0_.id ORDER BY r0_.id ASC LIMIT 15000’ with params [1]: SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘nyckeln.mapping_marker’ doesn’t exist
Detaljer:
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘nyckeln.mapping_marker’ doesn’t exist in /var/www/nyckeln.uppakra.lu.se/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:117
Stack trace:
…
An empty screen usually means there was a fatal error. It’s difficult to troubleshoot without the error message. You’ll need to follow directions to display error details. If you can’t find the error there, it may in PHP’s error log.
Thanks for quick response!
The `SetEnv APPLICATION_ENV “development”’ already set in .htaccess, also ‘log’ => true in local.config.php
I cannot find any PHP log though, still searching…
I thought I solved it but when an Item Set is too big (> 5000?) it fails again.
The new 5000 per page worked until I started upgrade Omeka S (From 4.1.0 to 4.1.1) and some modules released during the summer (and some again the last days). So I don’t claim Mapping is the problem, just that it suddenly fails with large Item numbers, BUT now I see that selection large Item Sets in Admin Dashboard (for browsing) also ends up with an empty page (nothing in ).
In the debug process a symptom of ‘something fatal’ appeared when I selected a large Item Sets (> 13000 items) and I ‘crashed out’ (was logged out) and left at the login page, but only when selecting that exact Item Set (this worked fine before all upgrades).
After deleting the Set (not the items), I made a new Map-Browse in Navigation (default settings) but it still gives me an empty page and no errors displayed, neither anything new was written in the logs/application.log file.
Also, I made a new Page with Map by Query (default settings), same result, but after entering the Advanced Query string ‘item_set_id%5B%5D=88670’, the ID of a small Item Set, that I checked existed, it worked! A map showed with all items.
I could then reconstruct my larger Item Set and enter that Set’s ID and ‘Map by Query’ shows all items, but when it grew larger the Map failed again. I changed it to show a smaller Item Set, and it worked again.
When I select the new large Item Set, I get the same empty page in Admin Dashboard (it doesnt crash me out to login page though).
I should maybe report this in a new thread but not sure how, and I wanted to follow up on what I started with these findings.
The site is: Nyckeln till Uppåkra · Nyckeln till Uppåkra [under utveckling] · Nyckeln with a Map Browse page (failing) and MapByQ Navigation item with Query set to a smaller Item Set (working fine).
The error message is really what we need here, and it should be in your server’s PHP logs (not the Omeka application log). Depending on your server setup this could mean they’re in Apache’s error log, a PHP-specific log file, or a log file like error_log in your site’s folder.
From your description I would guess that the error is something like a timeout or memory limit error, but knowing the specific error would be very helpful to us being able to figure out the issue.
I will address this ASAP to my server admin in 10 hours time (morning here).
Only new discovery for now is that when ADMIN Setting (Dashboard) is changed here: Display | Results per Page = 2000, selecting Items gives me the same empty page + crashing out to login page.
OK, I think I’ll just proceed on the assumption that this is a memory limit problem for now, as that’s most likely.
A couple things you can do now:
- The setting you changed in Display → Results per Page, that’s in the global settings right? (The page would be titled “Global settings.”) You probably don’t want to set that so high… I’d probably put it at something like 100 at most. But, it’s not used for the mapping pagination; that’s a different setting in the current Mapping module;
- The map’s page limit is set in the settings for each Site within the Omeka S install. Edit your site and go to the Settings tab, and under “Mapping” there’s a setting for “Map browse items per page”, which defaults to 5000. Try setting that lower and then loading the “Fyndspridning” or “Map Browse” page in your site.
To your suggestion (thanks!):
- I only tested a high value in Display pages to see if I could initiate the same error as with Map Browser. The value is back to 200 and that is fine
- I just tried to lower the Max Map items per page to 2000, and everything work, except that this option - to show items on the map in chunks or pages - makes no sense to my project. Good to know though.
Before updating (Omeka and Mapping and others modules) I could just change max from 5000 to 150000 in the php file and everything worked well (and not slowly as assumed). Now I cannot have 5000.
This is sad, because some important bugs are fixed in the upgrade.
I would hate to downgrade but maybe I have to.
As promised, here is a link to a big PHP error log from yesterday (when map browse generated empty pages), with some of it pasted in here (apologies for missing line breaks):
[Thu Sep 05 00:48:40.688411 2024] [proxy_fcgi:error] [pid 267886:tid 267918] [remote 47.128.33.63:45166] AH01071: Got error 'PHP message: PHP Deprecated: html_entity_decode(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/omeka/themes/Report3D/view/omeka/site/item/show-models-trench.phtml on line 441PHP message: PHP Deprecated: html_entity_decode(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/omeka/themes/Report3D/view/omeka/site/item/show-models-trench.phtml on line 464PHP message: PHP Deprecated: html_entity_decode(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/omeka/themes/Report3D/view/omeka/site/item/show-models-trench.phtml on line 464PHP message: PHP Deprecated: html_entity_decode(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/omeka/themes/Report3D/view/omeka/site/item/show-models-trench.phtml on line 464PHP message: PHP Deprecated: html_entity_decode(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/omeka/themes/Report3D/view/omeka/site/item/show-models-trench.phtml on line 464PHP message: PHP Deprecated: html_entity_decode(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/omeka/themes/Report3D/view/omeka/site/item/show-models-trench.phtml on line 464PHP message: PHP Deprecated: html_entity_decode(): Passing null to parameter #1 (…
Your error log does include a couple memory limit exceeded errors. The message swamping the rest of your logfile originates from your custom theme; you might consider fixing those instances just for the sake of cleaner logs.
We’ll do some poking around on our end but there’s a certain extent to which the new Mapping is going to be somewhat more memory-hungry because it allows for arbitrary geometry and not just points, so the representation of each simple point is not as small as it used to be.
For the time being, you have the alternative option, subject to your ability to set server settings, of increasing PHP’s memory_limit
setting to allow for larger mapping “pages.”
1 Like
Thanks! Doubled memory_limit to 256 MB, can now see 10 K items, but still cannot handle all map items (waiting for the server team to increase one more step).
Btw, I’m grateful for all Mapping improvements and was only a bit frustrated, not angry, by the idea of downgrading.
A wish for a future Map Browse (Navigation item) would be the ability to apply an initial query (to reduce the number of map objects to a fairly sized subset), like you can when creating a Page with a Map by Query block. A page based on a Map by Query Block would show the map only, though, and not the Advanced Search template beneath it.
The best ‘mixed solution’ I could come up with was to create a Custom URL menu (Navigation) with a URL to an applied query, like this: https://nyckeln.uppakra.lu.se/s/nyckeln/map-browse?item_set_id[]=88667&has_media=1.
Follow up: memory_limit now set to 768 MB but still Map Browse fails at 15 000 per page with very few exceptions. Fails even now-and-then at 10 000 per page, so I lowered to 8 000.