OAI-PMH 2.0 check problem

In 3.4.0.8, I am trying to make our journal ready for harvesting and have the following problem while checking OAI-PMH:

When I go to https://atlantisjournal.ca/index.php/atlantis/oai?verb=ListRecords&metadataPrefix=jats&from=2012-05-14T00:00:23Z&until=2012-05-14T00:00:24Z, I see a list of records. However, when I go to the same address but looking for Identifiers: https://atlantisjournal.ca/index.php/atlantis/oai?verb=ListIdentifiers&metadataPrefix=jats&from=2012-05-14T00:00:23Z&until=2012-05-14T00:00:24Z. (by the way, this URL requires a ā€œ.ā€ dot at the end), I see OAI Error(s). I looked into my php_error_log and neither the URL generates any errors. My php.ini has: error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT, so one would expect to see something.

When I click on each of the 5 verbs on the top of the page, Identify, ListRecords, and ListMetadataFormats work, while ListSets and ListIdentifiers don’t.

Interestingly, when I try the URL above, first I see: ā€œbadArgument: Illegal until parameterā€. When I remove ā€œ&until=2012-05-14T00:00:24Zā€, I get the ā€œbadArgument: Illegal from parameterā€. When I remove ā€œ&from=2012-05-14T00:00:23Zā€, I am left with the URL of https://atlantisjournal.ca/index.php/atlantis/oai?verb=ListIdentifiers&metadataPrefix=jats. and it gives: ā€œcannotDisseminateFormat: The requested metadataPrefix is not supported by this repositoryā€.

I ran the URL through OVAL :: BASE OAI-PMH Validator which gave this information.

Server communication
SUCCESS: Server supports both GET and POST requests.
SUCCESS: OAI-PMH version is 2.0
XML Validation

ERROR: Identify response well-formed but invalid: Element ā€˜{http://www.openarchives.org/OAI/2.0/}OAI-PMH’: No matching global declaration available for the validation root., line 6

ERROR: ListRecords response well-formed but invalid: Element ā€˜{http://www.openarchives.org/OAI/2.0/}OAI-PMH’: No matching global declaration available for the validation root., line 6

Harvesting
SUCCESS: Deleting strategy is ā€œpersistentā€
SUCCESS: ListRecords batch size is 100.

ERROR: Error during resumption request: HTTP Error 500: Internal Server Error

SUCCESS: Resumption token lasts 23 hours.
SUCCESS: completeListSize: 2083 records.
SUCCESS: Incremental harvesting (day granularity) of ListRecords works.

ERROR: No incremental (full granularity) harvesting of ListRecords. Harvest for reference date 2012-05-14T18:26:33Z returned record with date 2012-05-14T18:27:26Z.

SUCCESS: dc:language elements conform to ISO 639-3.
SUCCESS: dc:date elements conform to ISO 8601.
SUCCESS: Minimal DC elements (title, identifier, creator, type, date) are present.

My config.inc.php has:

;;;;;;;;;;;;;;;;

; OAI Settings ;

;;;;;;;;;;;;;;;;

[oai]

oai = On

repository_id = ā€œojs-oai.localhostā€

oai_max_records = 100

Not sure what to do with this information, though. Checked the two JATS related plugins (JATS Metadata Format and JATS Template Plugin) and they seem to be installed and up-to-date.

The Plugin Gallery shows a DRIVER plugin (The DRIVER plugin extends the OAI-PMH interface according to the DRIVER Guidelines 2.0, helping OJS journals to become DRIVER compliant.) which didn’t have a checkmark next to it. I enabled it and also replaced line 53 according to this: Issue with DRIVER Plugin on OJS 3.4.0.X: No Records via OAI Interface - Software Support - PKP Community Forum

I went through more OAI and JATS related posts but can’t figure it out.

I don’t see any reason why a plugin with outdated specifications from 17 years ago should still be used. I would recommend removing the DRIVER plugin.

Second, which harvester or repository requires you to use JATS in the OAI-PMH? If the answer is no one, you don’t need the JATS metadata plugin.
And third, are you publishing XML-JATS in your galleys? If not, you don’t need the JATS plugin.

My recommendation is to disable these plugins and try again.

Hi @Lolekbolek,

You’re probably encountering occasional server errors when handling these requests, possibly due to a memory or execution time limit. Check your PHP error log around the time of these requests to find details.

Regards,
Alec Smecher
Public Knowledge Project Team

Thank you, @dagosalas. I have disabled Driver again, so the OAI 2.0 Request Results doesn’t show the setSpec:driver row anymore.

Our harvester Erudit requires us to use JATS, so I have these two enabled, although I understand that JATS Template Plugin is dormant, because we don’t publish XML-JATS in our galleys.

We narrowed down the problem with the ListSets and ListIdentifiers not being displayed to one past issue of our journal that had a few articles listed under an ā€œUnnamedā€ section. We temporarily unpubished that issue and now ListIdentifiers work fine, so we will assign the articles to some section and re-publish.

On the other hand, going to ListSets still gives HTTP ERROR 500.

@asmecher, I have in php.ini:

max_execution_time=12000
max_input_time=6000
memory_limit=2048M

so, it is probably not the lack of resources that causes it?

When I go try to look at ListSets, I get:

PHP Fatal error: Uncaught TypeError: APP\section\Section::getLocalizedAbbrev(): Return value must be of type string, null returned in C:\xampp\htdocs\journal\classes\section\Section.php:31
Stack trace:
#0 C:\xampp\htdocs\journal\classes\oai\ojs\OAIDAO.php(200): APP\section\Section->getLocalizedAbbrev()
#1 C:\xampp\htdocs\journal\classes\oai\ojs\OAIDAO.php(144): APP\oai\ojs\OAIDAO::setSpec(Object(APP\journal\Journal), Object(APP\section\Section))
#2 C:\xampp\htdocs\journal\classes\oai\ojs\JournalOAI.php(225): APP\oai\ojs\OAIDAO->getJournalSets(8, 0, 100, 0)
#3 C:\xampp\htdocs\journal\lib\pkp\classes\oai\OAI.php(625): APP\oai\ojs\JournalOAI->sets(0, 100, 0)
#4 C:\xampp\htdocs\journal\lib\pkp\classes\oai\OAI.php(98): PKP\oai\OAI->ListSets()
#5 C:\xampp\htdocs\journal\pages\oai\OAIHandler.php(47): PKP\oai\OAI->execute()
#6 [internal function]: APP\pages\oai\OAIHandler->index(Array, Object(APP\core\Request))
#7 C:\xampp\htdocs\journal\lib\pkp\classes\core\PKPRouter.php(334): call_user_func(Array, Array, Object(APP\core\Request))
#8 C:\xampp\htdocs\journal\lib\pkp\classes\core\PKPPageRouter.php(278): PKP\core\PKPRouter->_authorizeInitializeAndCallRequest(Array, Object(APP\core\Request), Array, false)
#9 C:\xampp\htdocs\journal\lib\pkp\classes\core\Dispatcher.php(165): PKP\core\PKPPageRouter->route(Object(APP\core\Request))
#10 C:\xampp\htdocs\journal\lib\pkp\classes\core\PKPApplication.php(395): PKP\core\Dispatcher->dispatch(Object(APP\core\Request))
#11 C:\xampp\htdocs\journal\index.php(21): PKP\core\PKPApplication->execute()
#12 {main}
thrown in C:\xampp\htdocs\journal\classes\section\Section.php on line 31

And I regularly see these related warnings and errors:

PHP Warning: DOMDocument::loadXML(): xmlParseEntityRef: no name in Entity, line: 21 in C:\xampp\htdocs\journal\plugins\generic\jatsTemplate\JatsTemplatePlugin.php on line 73
PHP Warning: Attempt to read property ā€œnodeNameā€ on null in C:\xampp\htdocs\journal\plugins\oaiMetadataFormats\oaiJats\OAIMetadataFormat_JATS.php on line 130
PHP Fatal error: Uncaught AssertionError: assert(isset($permittedElementOrders[$parentNode->nodeName])) in C:\xampp\htdocs\journal\plugins\oaiMetadataFormats\oaiJats\OAIMetadataFormat_JATS.php:130
Stack trace:
#0 C:\xampp\htdocs\journal\plugins\oaiMetadataFormats\oaiJats\OAIMetadataFormat_JATS.php(130): assert(false, ā€˜assert(isset($p…’)
#1 C:\xampp\htdocs\journal\plugins\oaiMetadataFormats\oaiJats\OAIMetadataFormat_JATS.php(161): APP\plugins\oaiMetadataFormats\oaiJats\OAIMetadataFormat_JATS->_addChildInOrder(NULL, Object(DOMElement))
#2 C:\xampp\htdocs\journal\plugins\oaiMetadataFormats\oaiJats\OAIMetadataFormat_JATS.php(111): APP\plugins\oaiMetadataFormats\oaiJats\OAIMetadataFormat_JATS->_mungeMetadata(Object(DOMDocument), Object(APP\journal\Journal), Object(APP\submission\Submission), Object(APP\section\Section), Object(APP\issue\Issue))
#3 C:\xampp\htdocs\journal\lib\pkp\classes\oai\OAI.php(825): APP\plugins\oaiMetadataFormats\oaiJats\OAIMetadataFormat_JATS->toXml(Object(PKP\oai\OAIRecord))
#4 C:\xampp\htdocs\journal\lib\pkp\classes\oai\OAI.php(279): PKP\oai\OAI->formatMetadata(ā€˜jats’, Object(PKP\oai\OAIRecord))
#5 C:\xampp\htdocs\journal\lib\pkp\classes\oai\OAI.php(83): PKP\oai\OAI->GetRecord()
#6 C:\xampp\htdocs\journal\pages\oai\OAIHandler.php(47): PKP\oai\OAI->execute()
#7 [internal function]: APP\pages\oai\OAIHandler->index(Array, Object(APP\core\Request))
#8 C:\xampp\htdocs\journal\lib\pkp\classes\core\PKPRouter.php(334): call_user_func(Array, Array, Object(APP\core\Request))
#9 C:\xampp\htdocs\journal\lib\pkp\classes\core\PKPPageRouter.php(278): PKP\core\PKPRouter->_authorizeInitializeAndCallRequest(Array, Object(APP\core\Request), Array, false)
#10 C:\xampp\htdocs\journal\lib\pkp\classes\core\Dispatcher.php(165): PKP\core\PKPPageRouter->route(Object(APP\core\Request))
#11 C:\xampp\htdocs\journal\lib\pkp\classes\core\PKPApplication.php(395): PKP\core\Dispatcher->dispatch(Object(APP\core\Request))
#12 C:\xampp\htdocs\journal\index.php(21): PKP\core\PKPApplication->execute()
#13 {main}
thrown in C:\xampp\htdocs\journal\plugins\oaiMetadataFormats\oaiJats\OAIMetadataFormat_JATS.php on line 130

Hi @Lolekbolek,

Our harvester Erudit requires us to use JATS, so I have these two enabled, although I understand that JATS Template Plugin is dormant, because we don’t publish XML-JATS in our galleys.

The JATS Template document is used by the OAI JATS plugin to generate a JATS document when you don’t have one through another means, so it’s still active and useful in your case.

I see a couple of problems here…

PHP Fatal error: Uncaught TypeError: APP\section\Section::getLocalizedAbbrev(): Return value must be of type string, null returned in C:\xampp\htdocs\journal\classes\section\Section.php:31

This looks like a data error to me due to a missing abbreviation; try going through your list of sections in Settings > Journal, and editing and saving each. Even if the abbreviation is left blank, it should correct the issue.

PHP Warning: DOMDocument::loadXML(): xmlParseEntityRef: no name in Entity, line: 21 in C:\xampp\htdocs\journal\plugins\generic\jatsTemplate\JatsTemplatePlugin.php on line 73
PHP Warning: Attempt to read property ā€œnodeNameā€ on null in C:\xampp\htdocs\journal\plugins\oaiMetadataFormats\oaiJats\OAIMetadataFormat_JATS.php on line 130
PHP Fatal error: Uncaught AssertionError: assert(isset($permittedElementOrders[$parentNode->nodeName])) in C:\xampp\htdocs\journal\plugins\oaiMetadataFormats\oaiJats\OAIMetadataFormat_JATS.php:130

This appears to be caused by invalid UTF-8 characters in the XML that the JATS Template plugin is generating. If you’ve had problems with character sets in the past, it’s likely still something related to that. Unfortunately this will be a needle in a haystack to find; if you’re handy with PHP, I would probably start by going into plugins\generic\jatsTemplate\JatsTemplatePlugin.php where the generated XML is being parsed, around line 74:

if (!$doc && empty($candidateFiles)) {
    $doc = new \DOMDocument();
    $doc->loadXml($this->toXml($record));
}

You’ll want to save the results of the call to $this->toXml($record) to a file somewhere handy on your system, then trigger the error and look for invalid content in the resulting files. (This call might happen multiple times per request, so you’ll want to save it to a unique filename each time it’s called.)

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

This topic was automatically closed after 12 days. New replies are no longer allowed.