When I enable OJS access distribution, the OAI returns an HTTP ERROR 500 error.
Checking erro_log, I get this.
[Sat Jun 18 17:07:53.750733 2022] [php7:error] [pid 25697] [client 181.66.195.133:42979] PHP Fatal error: Uncaught Error: Call to a member function getId() on null in /var/www/ojs_university/classes/oai/ojs/OAIDAO.inc.php:185\nStack trace:\n#0 /var/www/ojs_university/lib/pkp/classes/oai/PKPOAIDAO.inc.php(239): OAIDAO->setOAIData()\n#1 /var/www/ojs_university/lib/pkp/classes/oai/PKPOAIDAO.inc.php(203): PKPOAIDAO->_doCommonOAIFromRowOperations()\n#2 /var/www/ojs_university/lib/pkp/classes/oai/PKPOAIDAO.inc.php(132): PKPOAIDAO->_returnRecordFromRow()\n#3 /var/www/ojs_university/classes/oai/ojs/JournalOAI.inc.php(178): PKPOAIDAO->getRecords()\n#4 /var/www/ojs_university/lib/pkp/classes/oai/OAI.inc.php(507): JournalOAI->records()\n#5 /var/www/ojs_university/lib/pkp/classes/oai/OAI.inc.php(85): OAI->ListRecords()\n#6 /var/www/ojs_university/pages/oai/OAIHandler.inc.php(39): OAI->execute()\n#7 /var/www/ojs_university/lib/pkp/classes/core/PKPRouter.inc.php(395): OAIHandler->index()\n#8 /var/www/ojs_university/lib/pkp/classes/core/PKPPageRouter.inc.php(246): PKPRouter->_authorizeInitializeAndCallRequest()\n#9 /var/www/ojs_university in /var/www/ojs_university/classes/oai/ojs/OAIDAO.inc.php on line 185
It looks like you have a data error. Try the following database query:
SELECT s.* FROM submissions s LEFT JOIN publications p ON (s.current_publication_id = p.publication_id) WHERE p.publication_id IS NULL;
If you have any results, then it indicates that you have a submission without a publication. You should probably delete the submissions entry. (Make sure to take a backup before working with the database directly!)
Regards,
Alec Smecher
Public Knowledge Project Team
I have run the query and this is the result. No records found.
MariaDB [xxxx]> SELECT s.* FROM submissions s LEFT JOIN publications p ON (s.current_publication_id = p.publication_id) WHERE p.publication_id IS NULL;
Empty set (0.072 sec)
Hmm, I don’t see another cause at a glance. Is it possible that the error message was received with your database in a different state that has since been resolved? Or do you see this error message frequently (e.g. every time you access the OAI interface)?
Regards,
Alec Smecher
Public Knowledge Project Team