We upgraded yesterday our server to PHP 8.3 and all our Omeka sites to 3.2. Today we discovered that the OAI-PMH endpoints for the sites no longer work. There is only this error message for any request:
XML Parsing Error: XML or text declaration not at start of entity
See, for example:
https://kccarchives.cvlcollections.org/oai-pmh-repository/request?verb=ListRecords&metadataPrefix=omeka-xml
https://kccarchives.cvlcollections.org/oai-pmh-repository/request?verb=ListSets
The plugin is also the latest version available: 2.2.
Iâve set the site above to display error messages on the frontend via the âSetEnvâ flag in .htaccess, but no errors have been displayed.
Any ideas as to whatâs gone wrong here?
You have something thatâs incorrectly outputting a blank line at the top of all your siteâs pages, including the OAI-PMH endpoint. XML is quite strict and that extra blank line makes the document invalid and youâll get parsing errors like youâre seeing.
A first thing to check would be: deactivate all your plugins but the OAI-PMH Repository plugin, and see if you still have the problem.
I have deactivated all the plugins except OAI-PMH Repository and still get the same parsing error at the OAI endpoint.
Our systems administrator reports:
I turned on debugging and site fails everywhere with:
Fatal error: Uncaught ValueError: The arguments array must contain 6 items, 0 given in /var/www/cvlcollections.org/kccarchives/application/libraries/Zend/Controller/Router/Route/Regex.php:249 Stack trace: #0 /var/www/cvlcollections.org/kccarchives/application/libraries/Zend/Controller/Router/Route/Regex.php(249): vsprintf() #1 /var/www/cvlcollections.org/kccarchives/application/libraries/Omeka/Controller/Plugin/Debug.php(158): Zend_Controller_Router_Route_Regex->assemble() #2 /var/www/cvlcollections.org/kccarchives/application/libraries/Omeka/Controller/Plugin/Debug.php(38): Omeka_Controller_Plugin_Debug->_getRequestMarkup() #3 /var/www/cvlcollections.org/kccarchives/application/libraries/Zend/Controller/Plugin/Broker.php(309): Omeka_Controller_Plugin_Debug->preDispatch() #4 /var/www/cvlcollections.org/kccarchives/application/libraries/Zend/Controller/Front.php(941): Zend_Controller_Plugin_Broker->preDispatch() #5 /var/www/cvlcollections.org/kccarchives/application/libraries/Zend/Application/Bootstrap/Bootstrap.php(106): Zend_Controller_Front->dispatch() #6 /var/www/cvlcollections.org/kccarchives/application/libraries/Zend/Application.php(384): Zend_Application_Bootstrap_Bootstrap->run() #7 /var/www/cvlcollections.org/kccarchives/application/libraries/Omeka/Application.php(73): Zend_Application->run() #8 /var/www/cvlcollections.org/kccarchives/index.php(23): Omeka_Application->run() #9 {main} thrown in /var/www/cvlcollections.org/kccarchives/application/libraries/Zend/Controller/Router/Route/Regex.php on line 249
Maybe itâs related, maybe itâs a warning that Omeka normally silently discards, donât know. Clearly the rest of the site works fine with debugging disabled.
If you view the page source of the endpoint with a valid request, you can see that the XML is thereâitâs just that there is a blank line at the top of it which seems to cause the browserâs parser to fail.
After some additional troubleshooting we tracked down the problem. It was the plugin Admin Tools, which we started using recently to be able to monitor and truncate the size of the Sessions tables. It needed to be deactivated AND uninstalled, then the issue with the extra line at the top of all the pages went away.
I donât know what the issue is within Admin Tools, and itâs a shame to lose the ability to manually truncate the Sessions table. But we can also do that via a cron job so the plugin is not really necessary.
The 3.2 release includes a fix for the session table problem, so it should not be an issue going forward.
1 Like
âAdmin toolsâ plugin problem fixed, new version available.