PHP Fatal Error when OAI ListRecords query in OJS 3.3.0-6

Hello,

I am trying OAI protocol queries using: http://perspectivas.espoch.edu.ec:8081/index.php/RCP_ESPOCH/oai?verb=Identify

When I try ListRecords link, the browser shows an HTTP 500 page. Checking the PHP log file, PHP Fatal Warning and Error are shown as:

[18-Jun-2021 22:50:17 America/Guayaquil] PHP Warning: require_once(/var/www/ojs3.3.0.6/plugins/metadata/mods34/filter/Mods34SchemaArticleAdapter.inc.php): failed to open stream: No existe el fichero o el directorio in /var/www/ojs3.3.0.6/lib/pkp/includes/functions.inc.php on line 25
[18-Jun-2021 22:50:17 America/Guayaquil] PHP Fatal error: require_once(): Failed opening required ‘/var/www/ojs3.3.0.6/plugins/metadata/mods34/filter/Mods34SchemaArticleAdapter.inc.php’ (include_path=’.:/usr/share/pear:/usr/share/php’) in /var/www/ojs3.3.0.6/lib/pkp/includes/functions.inc.php on line 25

The log says that Mods34SchemaArticleAdapter.inc.php file does not exist, and checking the file system of server, effectivelly the no file nor “…/mods34/…” directory exist. Instead of this, there is a file named DcllSchemaArticleAdapter.inc.php in the directory “…/dcll/…”

Anyidea to solve this problem is wellcome. Thanks!

Hi @jlrapter,

Thanks for providing the error log info. Was this a recent upgrade? And did this only start happening when it was upgraded to 3.3? This may be happening because the plugins are not up-to-date.

Could you check which versions of the OAI related plugin’s you’re using and if they should be upgraded? There are likely compatibility breaks for the plugins between different OJS versions.

Best,

Erik
PKP Team

Hello @ewhanson , thanks for your attention:

I checked the versions of three plugins related to OAI protocol. These are:

OAI JATS Plugin Version 1.0.4.2
OpenAire Plugin 2.0 Version 2.0.3.0
DRIVER Version 1.0.0.0

Plugins are updated but currently, and based on your query, I checked that the first version of OJS I installed was 3.2. The backup of this version contains the directory and files for “mods34” and the version 3.3 does not contain it. So, I copy such a folder from backup to new version installed, and it works resolving the initial problem.

However, another error HTTP 500 is got when a ListRecords JATS is quieried.

Hi @jlrapter,

If this is related to JATS specifically, do you have the JATS Template Plugin installed? This is required to prepare the JATS for use with the OAI JATS plugin.

If that doesn’t fix it, could you see what the server logs are showing when you are getting the 500 error when ListRecords JATS is queried?

Best,

Erik
PKP Team

Hi @ewhanson ,

Yes, I have installed both JATS Template Plugin and OAI JATS plugin.

Logs for this issue are a bit complex for my understanding:

[29-Jun-2021 16:10:50 America/Guayaquil] PHP Warning: file_get_contents(journals/1/articles/19/6033701910833.html): failed to open stream: No existe el fichero o el directorio in /var/www/ojs3.3.0.6/plugins/generic/jatsTemplate/JatsTemplatePlugin.inc.php on line 248
[29-Jun-2021 16:10:50 America/Guayaquil] PHP Warning: DOMDocument::createTextNode() expects parameter 1 to be string, array given in /var/www/ojs3.3.0.6/plugins/oaiMetadataFormats/oaiJats/OAIMetadataFormat_JATS.inc.php on line 249
[29-Jun-2021 16:10:50 America/Guayaquil] PHP Fatal error: Uncaught TypeError: Argument 1 passed to DOMNode::appendChild() must be an instance of DOMNode, null given in /var/www/ojs3.3.0.6/plugins/oaiMetadataFormats/oaiJats/OAIMetadataFormat_JATS.inc.php:250
Stack trace:
#0 /var/www/ojs3.3.0.6/plugins/oaiMetadataFormats/oaiJats/OAIMetadataFormat_JATS.inc.php(250): DOMNode->appendChild(NULL)
#1 /var/www/ojs3.3.0.6/plugins/oaiMetadataFormats/oaiJats/OAIMetadataFormat_JATS.inc.php(98): OAIMetadataFormat_JATS->_mungeMetadata(Object(DOMDocument), Object(Journal), Object(Submission), Object(Section), Object(Issue))
#2 /var/www/ojs3.3.0.6/lib/pkp/classes/oai/OAI.inc.php(788): OAIMetadataFormat_JATS->toXml(Object(OAIRecord))
#3 /var/www/ojs3.3.0.6/lib/pkp/classes/oai/OAI.inc.php(531): OAI->formatMetadata(‘jats’, Object(OAIRecord))
#4 /var/www/ojs3.3.0.6/lib/pkp/classes/oai/OAI.inc.php(85): OAI->ListRecords()
#5 /var/www/ojs3.3.0.6/pages/oai/OAIHandler.inc.php(39): OAI->execute()
#6 /var/www/ojs3.3.0.6/lib/pkp/classes/core/PKPRouter.inc.php(395): OAIHandler->index(Array, Obje in /var/www/ojs3.3.0.6/plugins/oaiMetadataFormats/oaiJats/OAIMetadataFormat_JATS.inc.php on line 250

Any idea about it?

Thanks!

Hi @jlrapter,

From what I can see, $article->getTitle($article->getLocale()) on line 249 is getting an array for some reason when it should be fetching the title as a string. It looks like this causes the creation of $articleTitleText to fail, which in turn, causes appendChild to fail as the $articleTitleText text node was null.

I don’t know what might be causing this, but checking what’s happening on your OJS instance when a localized title is fetched for an article may help pin down the issue. If this is only happening for specific articles, it may also be worthwhile seeing if there’s anything strange going on with the titles for those particular articles.

Best,

Erik
PKP Team