OJS 3.3.0-13 PHP 8.0 - OAI ListIdentifiers causes PHP Fatal

Describe the issue or problem
When we go to the OAI repository for our journal and click on ‘ListIdentifiers’, we get HTTP ERROR 500 page as shown in the link below . The OAI repository seems fine for “Identify”, “ListSets”, “ListMetadataFormats” and “ListRecords”.

Email received with failure :

#Failure summary

#Checking ListIdentifiers response

REQUEST:
https://journal.uokufa.edu.iq/index.php/kje/oai?verb=ListIdentifiers&metadataPrefix=oai_dc&set=kje
GET
FAIL: Server failed to respond to the ListIdentifiers request (HTTP header
values: status=500 Internal Server Error, age=1, lifetime=3600, is fresh:=1)

After that, I went to the log file to check out and I got error below

[09-Nov-2022 22:14:39 ] PHP Fatal error:  Uncaught Error: Call to a member function getData() on null in /home2/public_html/plugins/generic/driver/DRIVERPlugin.inc.php:139
Stack trace:
#0 /home2/public_html/plugins/generic/driver/DRIVERPlugin.inc.php(106): DRIVERPlugin->isDRIVERRecord(Array)
#1 /public_html/lib/pkp/classes/plugins/HookRegistry.inc.php(107): DRIVERPlugin->addSet('OAIDAO::_return...', Array)
#2 /public_html/lib/pkp/classes/oai/PKPOAIDAO.inc.php(219): HookRegistry::call('OAIDAO::_return...', Array)
#3 /public_html/lib/pkp/classes/oai/PKPOAIDAO.inc.php(165): PKPOAIDAO->_returnIdentifierFromRow(Array)
#4 /public_html/classes/oai/ojs/JournalOAI.inc.php(195): PKPOAIDAO->getIdentifiers(Array, NULL, NULL, NULL, 0, 500, 171)
#5 /home2/journaluokufaedu/public_html/lib/pkp/classes/oai/OAI.inc.php(365): JournalOAI->identifiers('oai_dc', NULL, NULL, NULL, 0, 500, 171)
#6 /public_html/lib/pkp/classes/oai/OAI.inc.php(79): OAI->ListIdentifiers()
#7 /public_html/pages/oai/OAIHandler.inc.php(39): OAI->execute()
#8 /public_html/lib/pkp/classes/core/PKPRouter.inc.php(395): OAIHandler->index(Array, Object(Request))
#9 /public_html/lib/pkp/classes/core/PKPPageRouter.inc.php(246): PKPRouter->_authorizeInitializeAndCallRequest(Array, Object(Request), Array, false)
#10 /public_html/lib/pkp/classes/core/Dispatcher.inc.php(144): PKPPageRouter->route(Object(Request))
#11 /public_html/lib/pkp/classes/core/PKPApplication.inc.php(362): Dispatcher->dispatch(Object(Request))
#12 /public_html/index.php(68): PKPApplication->execute()
#13 {main}
  thrown in /public_html/plugins/generic/driver/DRIVERPlugin.inc.php on line 139

We were not able to register our journal due to this error. Could you please help us to resolve this problem.
-Regards
Salam

Hi @Salam_Al-Khammasi,

What’s the version of your OJS? After skimming the code this error doesn’t make much sense for me, I just can see few ways to generate it.

Best,
Jonas

1 Like

Hi @jonasraoni
Thanks for your response. I’ve mentioned the version of OJS in the title of this topic. I’m using the latest version of OJS which is 3.3.0-13. In addition, I’m using more than 15 journals in the same installation and all of them are working fine except this one. It shows the error above.
Many thanks Jonas,
Salam

Oh, I didn’t read the title :see_no_evil:

I believe one of the submissions might have corrupted data. Can you open the file /home2/public_html/plugins/generic/driver/DRIVERPlugin.inc.php and replace temporarily the line #138:

$publication = $submission->getCurrentPublication();

by

$publication = $submission->getCurrentPublication();
if (!$publication) {
	echo $row['submission_id'];
	exit;
}

Then open the link that you shared above again, and you should view the ID of the submission which is causing issues… Save that ID somewhere and revert the changes that you did on the file.

Then you might show me what’s the output for the queries below:

SELECT * FROM submissions WHERE submission_id = ID_THAT_YOU_SAVED

and also

SELECT * FROM publications WHERE submission_id = ID_THAT_YOU_SAVED

Best,
Jonas

That’s fine lool
I followed your instruction and the ID of the submission was 1107.
The output of the first query :
query1

The output of the second query:
query 2

I searched the submission ID in the archive dashboard and that was the result :
website

Note that I used to use Import/export plugin to migrate articles to our new system and I believe this is happened because of that

I really appreciate your time and effort Jonas.
Thanks a lot
Salam

Looks like something strange happened there :slight_smile:

The submission 1107 is pointing to the publication with ID 44, but there’s no publication connected to this submission… Does this query return something?
SELECT * FROM publications WHERE submission_id = 44

But even if it returns, it doesn’t make sense to have a submission with such high ID being connected with a much smaller publication ID (these two tables grow almost together).

Well, you can try to inspect what happened with the submission #1107, maybe its files are still available on the folder ${files_dir}/journals/1/articles/1107

For now this submission is broken, so I’d advise you to create a database backup and remove this submission and its related records (all these tables have a submission_id):
image

Then things should work if you don’t have any other case (query below) :grin:

SELECT *
FROM submissions s
LEFT JOIN publications p ON p.publication_id = s.current_publication_id
WHERE p.publication_id IS NULL

Best,
Jonas

1 Like

This query SELECT * FROM publications WHERE submission_id = 44 return a value related to the submission ID 1107. and The file is still availabe in the directory so I kept it so I can upload it again ${files_dir}/journals/1/articles/1107…
As you recommended I took a back up and deleted that submission and everything went perfect.
Then I run the last query and I got the result below :
query 3
I deleted all of them since they have the same problem of ID 1107

Your answer helped to overcome this issue. You are amazing @jonasraoni thanks alot

1 Like