Errors validating Repository in Openarchive

Good afternoon.

We are trying to validate our OJS repository in Openarchive, however it is giving us 3 bugs that we have not been able to solve. They are the following:

Checking ListRecords response

REQUEST http://iberoamericasocial.com/ojs/index.php/index/oai?verb=ListRecords&from=2017-04-17T18:26:44Z&until=2017-04-17T18:26:44Z&metadataPrefix=oai_dc GET
FAIL Server failed to respond to the ListRecords request (HTTP header values: status=500 Internal Server Error, age=0, lifetime=0, is fresh:=)

Checking for version 2.0 specific exceptions

REQUEST http://iberoamericasocial.com/ojs/index.php/index/oai?verb=ListRecords&metadataPrefix=oai_dc&from=2002-02-05&until=2002-02-06T05:35:00Z GET
WARN Bad HTTP status code from server: 500
FAIL Error in parsing XML response to exception request: verb=ListRecords&metadataPrefix=oai_dc&from=2002-02-05&until=2002-02-06T05:35:00Z
REQUEST http://iberoamericasocial.com/ojs/index.php/index/oai?verb=ListRecords&metadataPrefix=oai_dc&until=2016-04-17T09:05:37Z GET
WARN Bad HTTP status code from server: 500
FAIL Error in parsing XML response to exception request: verb=ListRecords&metadataPrefix=oai_dc&until=2016-04-17T09:05:37Z

Could someone help us?

Thank you very much.

Hi @jmbarroso,

Check your PHP error log for details.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher

this is my PHP error log:

Warning: Declaration of OAIDAO::getEarliestDatestamp($setIds = Array) should be compatible with PKPOAIDAO::getEarliestDatestamp($selectStatement, $setIds = Array) in /srv/www/iberoamericasocial.com/www/ojs/classes/oai/ojs/OAIDAO.inc.php on line 20

Warning: Declaration of JournalOAI::sets($offset, $limit, &$total) should be compatible with OAI::sets($offset, &$total) in /srv/www/iberoamericasocial.com/www/ojs/classes/oai/ojs/JournalOAI.inc.php on line 22

Warning: Declaration of OAIHandler::validate() should be compatible with PKPHandler::validate($requiredContexts = NULL, $request = NULL) in /srv/www/iberoamericasocial.com/www/ojs/pages/oai/OAIHandler.inc.php on line 21

Warning: Declaration of OAIMetadataFormat_MARC21::toXml(&$record, $format = NULL) should be compatible with OAIMetadataFormat::toXml($record, $format = NULL) in /srv/www/iberoamericasocial.com/www/ojs/plugins/oaiMetadataFormats/marcxml/OAIMetadataFormat_MARC21.inc.php on line 46

Warning: Declaration of OAIMetadataFormat_NLM::toXml(&$record, $format = NULL) should be compatible with OAIMetadataFormat::toXml($record, $format = NULL) in /srv/www/iberoamericasocial.com/www/ojs/plugins/oaiMetadataFormats/nlm/OAIMetadataFormat_NLM.inc.php on line 277

Warning: Declaration of OAIMetadataFormat_MARC::toXml(&$record, $format = NULL) should be compatible with OAIMetadataFormat::toXml($record, $format = NULL) in /srv/www/iberoamericasocial.com/www/ojs/plugins/oaiMetadataFormats/marc/OAIMetadataFormat_MARC.inc.php on line 46

Warning: Declaration of OAIMetadataFormat_RFC1807::toXml(&$record, $format = NULL) should be compatible with OAIMetadataFormat::toXml($record, $format = NULL) in /srv/www/iberoamericasocial.com/www/ojs/plugins/oaiMetadataFormats/rfc1807/OAIMetadataFormat_RFC1807.inc.php on line 107

Warning: Declaration of PKPOAIMetadataFormat_DC::toXml(&$dataObject, $format = NULL) should be compatible with OAIMetadataFormat::toXml($record, $format = NULL) in /srv/www/iberoamericasocial.com/www/ojs/lib/pkp/plugins/oaiMetadataFormats/dc/PKPOAIMetadataFormat_DC.inc.php on line 80
���ao�0���+Nj� 0J���ih�E�l’ǹ��Nmg����Rڤn�7�����o.7� g�a|��%�r�g��d�9��e��6�dd��ǣ�(Z���x���kޱ�.� ePݾ2��[�e��$��p��N�`S��b�W �a-\ �$A%��’�F?� d5��G�^�����ά�I�h�G����h�! ���/��4+b�J ��D�**��*�O�1 h�6۠��|�:�X#XX��.�)P��:�E�(,��<ׅq��eOn4��h�pB� ?� jW��;p�q�jG����Z{���A�E��s��� �c��; [�~��m���>�B��O굣���wa��~��ҽ��ȡe3�3��Fư��vf�1����~��� ��ȵI�G�g�dl�����D�����y�h��oDH��e6��j’��e�-A)(T�U���zs����� ��b�y? ;�H=��Y�Rm�O�ㅣ�t��I���d��e&-�ۗ!���}��=�v����y)�Mq�x�qI=��>�N���v��J)

Hi @jmbarroso,

Those “Warning” messages are cosmetic and can be ignored – but what is that garble at the end? I’ve never seen something like that before in a PHP error log.

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks for the support @asmecher

I do not know what that garble means. It appeared when I activated the debug in config.inc.php. This is the correct way to view PHP errors, right?

Thank you for your patience, I’m new to this and there are many things that I still do not understand well.

Hi @jmbarroso,

The error log is usually somewhere in your hosting directory, but the details will depend on your service provider. See e.g. How do I find my PHP error log?.

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks @asmecher,

I have the error.log in the logs folder of my server, but the error.log file is empty. :frowning:

I imagine there should be some mistake in him, right?

Sorry, and thanks for your patience.

Hi @jmbarroso,

I’m afraid you’ll have to check with your service provider to find out where error messages are logged, and if that’s the file, why they aren’t being recorded there.

Regards,
Alec Smecher
Public Knowledge Project Team

Hello,

I’m a brother of @jmbarroso. We study the problem. The binary code show by php was gzipped message. After disabling gzip / cloudfire we could see:

Fatal error</b>:  Uncaught Error: Using $this when not in object context in /srv/www/iberoamericasocial.com/www/ojs/lib/pkp/classes/oai/OAIUtils.inc.php:59
Stack trace:
#0 /srv/www/iberoamericasocial.com/www/ojs/lib/pkp/classes/oai/OAI.inc.php(799): OAIUtils::UTCtoTimestamp('2017-04-17 19:2...')
#1 /srv/www/iberoamericasocial.com/www/ojs/lib/pkp/classes/oai/OAI.inc.php(497): OAI-&gt;extractDateParams(Array, NULL, NULL)
#2 /srv/www/iberoamericasocial.com/www/ojs/lib/pkp/classes/oai/OAI.inc.php(85): OAI-&gt;ListRecords()
#3 /srv/www/iberoamericasocial.com/www/ojs/pages/oai/OAIHandler.inc.php(43): OAI-&gt;execute()
#4 /srv/www/iberoamericasocial.com/www/ojs/lib/pkp/classes/core/PKPRouter.inc.php(372): OAIHandler-&gt;index(Array, Object(Request))
#5 /srv/www/iberoamericasocial.com/www/ojs/lib/pkp/classes/core/PKPPageRouter.inc.php(239): PKPRouter-&gt;_authorizeInitializeAndCallRequest(Array, Object(Request), Array, false)
#6 /srv/www/iberoamericasocial.com/www/ojs/lib/pkp/classes/core/Dispatcher.inc.php(134): PKPPageRouter-&gt;route(Object(Request) in <b>/srv/www/iberoamericasocial.com/www/ojs/lib/pkp/classes/oai/OAIUtils.inc.php

Reviewing the file, we changed the line 48 of OIAUtils.inc-2.php from:
function UTCtoTimestamp($date, $checkGranularity = true) {
to
function UTCtoTimestamp($date, $checkGranularity = false) {

Maybe there is any configuration error or a code bug, not sure. After this patch the OAI Validator passes successfully all the tests

Where should we report this issue ?

Thank yoy very much

Hi @jmbarroso/@i5513,

What version of OJS are you running?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

is the 3.0.2.0 version.

Regards!

Hi all,

Thanks for the details. I’ve added a fix – see issue 2782, particularly the first patch (“Fix kludgey use of $this in static calls”), which will need to be applied in the lib/pkp subdirectory. The older code works for me, but isn’t well written, and probably your version of PHP is stricter about such things.

Regards,
Alec Smecher
Public Knowledge Project Team