pkp / plagiarism

Plagiarism checker plugin for OJS 3/OMP
GNU General Public License v3.0
7 stars 32 forks source link

Submission sometimes get stuck at confirmation step (4) #13

Closed mpbraendle closed 2 years ago

mpbraendle commented 3 years ago

OJS 3.3.0-7 Ithenticate plugin version 1.0.4.0

Submission sometimes get stuck at confirmation step (4) and takes a long while until confirmed. In the Apache error log, this is found:

[Mon Jul 05 16:24:16.657818 2021] [proxy_fcgi:error] [pid 8436] [client 130.60.114.122:62097] AH01071: Got error 'PHP message: PHP Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/virtual/ojs.chimia.ch/htdocs/ojs/plugins/generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Request.php on line 281PHP message: XML-RPC: PhpXmlRpc\Helper\XMLParser::xmlrpc_ee: invalid value received in DATETIME: 2021-07-05T14:23:49ZPHP message: PHP Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/virtual/ojs.chimia.ch/htdocs/ojs/plugins/generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Request.php on line 281PHP message: XML-RPC: PhpXmlRpc\Helper\XMLParser::xmlrpc_ee: invalid value received in DATETIME: 2021-07-05T14:23:49ZPHP message: PHP Notice: Undefined index: string in /var/www/virtual/ojs.chimia.ch/htdocs/ojs/plugins/generic/plagiarism/vendor/bsobbe/ithenticate/Ithenticate.php on line 239PHP message: PHP Notice: Undefined index: string in /var/www/virtual/ojs.chimia.ch/htdocs/ojs/plugins/generic/plagiarism/vendor/bsobbe/ithenticate/Ithenticate.php on line 239PHP message: PHP Notice: Undefined index: string in /var/www/virtual/ojs.chimia.ch/htdocs/ojs/plugins/generic/plagiarism/vendor/bsobbe/ithenticate/Ithenticate.php on line 239PHP message: PHP Notice: Undefined index: string in /var/www/virtual/ojs.chimia.ch/htdocs/ojs/plugins/generic/plagiarism/vendor/bsobbe/ithenticate/Ithenticate.php on line 239PHP message: PHP Notice: Undefined index: string in /var/www/virtual/ojs.chimia.ch/htdocs/ojs/plugins/generic/plagiarism/vendor/bsobbe/ithenticate/Ithenticate.php on line 239PHP message: PHP Notice: Undefined index: string in /var/www/virtual/ojs.chimia.ch/htdocs/ojs/plugins/generic/plagiarism/vendor/bsobbe/ithenticate/Ithenticate.php on line 239PHP message: PHP Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/virtual/ojs.chimia.ch/htdocs/ojs/plugins/generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Request.php on line 281PHP message: XML-RPC: PhpXmlRpc\Helper\XMLParser::xmlrpc_ee: invalid value received in DATETIME: 2021-07-05T14:23:50ZPHP message: Name: manuscript Broekmann.docxPHP message: PHP Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/virtual/ojs.chimia.ch/htdocs/ojs/plugins/generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Request.php on line 281PHP message: XML-RPC: PhpXmlRpc\Helper\XMLParser::xmlrpc_ee: invalid value received in DATETIME: 2021-07-05T14:24:16Z', referer: https://ojs.chimia.ch/index.php/chimia/submission/wizard/4?submissionId=624

asmecher commented 3 years ago

@mpbraendle, that is the point at which content is sent to iThenticate; if the connection between the journal's ISP and iThenticate is slow, or if the content is large, or iThenticate takes a long time to receive the content for another reason, it'll appear to stall at that stage.

mpbraendle commented 3 years ago

@asmecher - this appeared several times and is pretty annoying for all involved parties (author, editor, and journal manager). Happened again: AH01071: Got error 'PHP message: PHP Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/virtual/ojs.chimia.ch/htdocs/ojs/plugins/generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Request.php on line 281PHP message: XML-RPC: PhpXmlRpc\Helper\XMLParser::xmlrpc_ee: invalid value received in DATETIME: 2021-07-09T16:38:47ZPHP message: PHP Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/virtual/ojs.chimia.ch/htdocs/ojs/plugins/generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Request.php on line 281PHP message: XML-RPC: PhpXmlRpc\Helper\XMLParser::xmlrpc_ee: invalid value received in DATETIME: 2021-07-09T16:38:48ZPHP message: PHP Notice: Undefined index: string in /var/www/virtual/ojs.chimia.ch/htdocs/ojs/plugins/generic/plagiarism/vendor/bsobbe/ithenticate/Ithenticate.php on line 239PHP message: PHP Notice: Undefined index: string in /var/www/virtual/ojs.chimia.ch/htdocs/ojs/plugins/generic/plagiarism/vendor/bsobbe/ithenticate/Ithenticate.php on line 239PHP message: PHP Notice: Undefined index: string in /var/www/virtual/ojs.chimia.ch/htdocs/ojs/plugins/generic/plagiarism/vendor/bsobbe/ithenticate/Ithenticate.php on line 239PHP message: PHP Notice: Undefined index: string in /var/www/virtual/ojs.chimia.ch/htdocs/ojs/plugins/generic/plagiarism/vendor/bsobbe/ithenticate/Ithenticate.php on line 239PHP message: PHP Notice: Undefined index: string in /var/www/virtual/ojs.chimia.ch/htdocs/ojs/plugins/generic/plagiarism/vendor/bsobbe/ithenticate/Ithenticate.php on line 239PHP message: PHP Notice: Undefined index: string in /var/www/virtual/ojs.chimia.ch/htdocs/ojs/plugins/generic/plagiarism/vendor/bsobbe/ithenticate/Ithenticate.php on line 239PHP message: PHP Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/virtual/ojs.chimia.ch/htdocs/ojs/plugins/generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Request.php on line 281PHP message: XML-RPC: PhpXmlRpc\Helper\XMLParser::xmlrpc_ee: invalid value received in DATETIME: 2021-07-09T16:38:48ZPHP message: Name: Figure 1b.jpgPHP message: PHP Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/virtual/ojs.chimia.ch/htdocs/ojs/plugins/generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Request.php on line 281PHP message: XML-RPC: PhpXmlRpc\Helper\XMLParser::xmlrpc_ee: invalid value received in DATETIME: 2021-07-09T16:38:57ZPHP message: PHP Fatal error: Uncaught Error: Call to undefined method SubmissionFile::getFilePath() in /var/www/virtual/ojs.chimia.ch/htdocs/ojs/plugins/generic/plagiarism/PlagiarismPlugin.inc.php:118\nStack trace:\n#0 /var/www/virtual/ojs.chimia.ch/htdocs/ojs/lib/pkp/classes/plugins/HookRegistry.inc.php(107): PlagiarismPlugin->callback('submissionsubmi...', Array)\n#1 /var/www/virtual/ojs.chimia.ch/htdocs/ojs/lib/pkp/classes/form/Form.inc.php(171): HookRegistry::call('submissionsubmi...', Array)\n#2 /var/www/virtual/ojs.chimia.ch/htdocs/ojs/lib/pkp/classes/submission/form/SubmissionSubmitForm.inc.php(64): Form->fetch(Object(Request), NULL, false)\n#3 /var/www/virtual/ojs.chimia.ch/htdocs/ojs/lib/pkp/pages/submission/PKPSubmissionHandler.inc.php(132): SubmissionSubmitForm->fetch(Object(Request))\n#4 /var/www/virtual/ojs.chimia.ch/htdocs/ojs/lib/pkp/classes/core/PKPRouter.inc.php(395): PKPSubmissionHandler->step(Array, Object(Request))\n#5 /var/www/virtual/ojs.chimia.ch/htdocs/ojs/lib/pkp/classes/core/P...', referer: https://ojs.chimia.ch/index.php/chimia/submission/wizard/4?submissionId=628

This is my try to submit the paper - the author tried as well one day ago and left the browser tab open for hours just to await confirmation, with no success. What bothers me is the "invalid value received in DATETIME: 2021-07-09T16:38:47" message.

mpbraendle commented 3 years ago

When I disabled the plugin, I got the following message - AH01071: Got error 'PHP message: PHP Fatal error: Uncaught GuzzleHttp\Exception\ConnectException: cURL error 6: Could not resolve host: pkp.sfu.ca (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) in /var/www/virtual/ojs.chimia.ch/htdocs/ojs/lib/pkp/lib/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:200\nStack trace:\n#0 /var/www/virtual/ojs.chimia.ch/htdocs/ojs/lib/pkp/lib/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(155): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array)\n#1 /var/www/virtual/ojs.chimia.ch/htdocs/ojs/lib/pkp/lib/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(105): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))\n#2 /var/www/virtual/ojs.chimia.ch/htdocs/ojs/lib/pkp/lib/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php(43): GuzzleHttp\Handler\CurlFactory::finish(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp...', referer: https://ojs.chimia.ch/index.php/chimia/management/settings/website

Does this point to something?

asmecher commented 3 years ago

The Could not resolve host: pkp.sfu.ca message is not related to the data exchange with iThenticate, but could indicate a network outage on your server of some kind. Does the submission process through iThenticate repeatably fail, or only occasionally?

mpbraendle commented 3 years ago

Only occasionally - I will check with the hoster. Currently also can't open the OJS administration page.

asmecher commented 3 years ago

Longer term, I agree that stalling the submission form while the exchange happens isn't ideal. We're adding some better tools for handling queued tasks starting with 3.4.0: https://github.com/pkp/pkp-lib/issues/4622

mpbraendle commented 3 years ago

Yes, having an event queue for asynchronous tasks in OJS such as some repository software has would be excellent!

mpbraendle commented 3 years ago

Probably network problem at the hoster who can't resolve the domain. I can ping pkp.sfu.ca from my private machine, but not from the hoster's server.

asmecher commented 3 years ago

The pkp.sfu.ca resolution is required for interaction with the beacon and update check (enable_beacon and show_upgrade_warning in config.inc.php) -- you might want to disable those temporarily while you are trying to figure out the iThenticate thing, which is unrelated. But of course a network problem might cause both to have trouble at the same time.

mpbraendle commented 2 years ago

We had the problem again - May it be that iThenticate has a problem with .png files that were submitted? When I removed them from the submission in question, it worked.

asmecher commented 2 years ago

@mpbraendle, did the PHP error logs include anything specific from that interaction?

fradeve commented 2 years ago

@asmecher I would like to add our own experience with this issue, as we are experiencing it exactly in the same way as @mpbraendle is describing it in the first post of this thread.

We are using OJS 3.3.0-7 with the most recent plugin version that was released a few days ago, 1.0.5-0. This is what is showing up in the logs in the last step of the submission process


#6 /var/www/html/lib/pkp/pages/submission/PKPSubmissionHandler.inc.php(177): Submiss" while reading response header from upstream, client: 10.56.4.15, server: _, request: "POST /index.php/ijot/submission/saveStep/4 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "account.up-j-ijot.ubiquityjournal.website", referrer: "https://account.up-j-ijot.ubiquityjournal.website/index.php/ijot/submission/wizard/2?submissionId=65"

#5 /var/www/html/classes/submission/form/SubmissionSubmitStep4Form.inc.php(36): PKPSubmissionSubmitStep4Form->execute()

#4 /var/www/html/lib/pkp/classes/submission/form/PKPSubmissionSubmitStep4Form.inc.php(45): Form->execute()

#3 /var/www/html/lib/pkp/classes/form/Form.inc.php(314): HookRegistry::call('submissionsubmi...', Array)

#2 /var/www/html/lib/pkp/classes/plugins/HookRegistry.inc.php(107): PlagiarismPlugin->callback('submissionsubmi...', Array)

#1 /var/www/html/plugins/generic/plagiarism/PlagiarismPlugin.inc.php(75): bsobbe\ithenticate\Ithenticate->__construct('editorial@xxxxx...', 'xxxxxxxxx...')

#0 /var/www/html/plugins/generic/plagiarism/vendor/bsobbe/ithenticate/Ithenticate.php(36): bsobbe\ithenticate\Ithenticate->login()

Stack trace:

2022/02/02 18:03:48 [error] 12#12: *560 FastCGI sent in stderr: "PHP message: XML-RPC: PhpXmlRpc\Helper\XMLParser::xmlrpc_ee: invalid value received in DATETIME: 2022-02-02T18:03:48ZPHP message: PHP Fatal error:  Uncaught Exception: Sorry, failed to log in. in /var/www/html/plugins/generic/plagiarism/vendor/bsobbe/ithenticate/Ithenticate.php:136

The last line of the logs is very misleading (failed to log in), but I am going to extract from the logs the part that I think it is most interesting:

PhpXmlRpc\Helper\XMLParser::xmlrpc_ee: invalid value received in DATETIME: 2022-02-02T18:03:48Z

The error raised in the logs is exactly the same one reported by @mpbraendle and has also been reported in this thread in the PKP forum: https://forum.pkp.sfu.ca/t/ojs-3-1-1-2-plagiarism-ithenticate-plugin/46084/3

One user on the forum has proposed a solution for this, which I am going to copy/paste here:

We recently started seeing this in a hosted site, and I think the error is due to a bug in the XML parser library that comes with the plugin. There is a regular expression that checks the format of the date returned. Specifically, there is a line of code in the XML library that looks at the date sent back from the server and checks to see if it matches a string:

if (!preg_match('/^[0-9]{8}T[0-9]{2}:[0-9]{2}:[0-9]{2}$/', $this->_xh['ac'])) {

Essentially, that checks to see if the date looks like 20190702T16:08:05 but this is not what your date looks like. Your date looks like 2019-07-02T16:08:05Z, with dashes and a Z at the end, which won’t pass this step. You can modify the regular expression to:

/^[0-9\-]{10}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$/

Which should allow it to pass.
fradeve commented 2 years ago

Update: I can confirm that the fix suggested in the forum works, as adding the Z at the end of the regex allows the plugin to work as expected.

@asmecher sounds like this needs to be addressed somewhat, as the plugin is not functional if that Z is missing from the regex.

PS: the version of the phpxmlrpc library used by this plugin is 3 years old. I have checked the latest version of the library and it seems that the regex is still there, unchanged: https://github.com/gggeek/phpxmlrpc/blob/master/src/Helper/XMLParser.php#L426

mpbraendle commented 2 years ago

Thank you @fradeve - I have now updated to 1.0.5 and implemented the patch - let's see if it helps and there are no complaints by submitters anymore (we have quite high a submission frequency - about 20 articles per monthly issue, so we will know soon).

asmecher commented 2 years ago

Hi all -- the date issue appears to be two third-party libraries upstream. The plagiarism plugin depends on https://github.com/bsobbe/iThenticate, which in turn depends on https://github.com/gggeek/phpxmlrpc. In that repository I found the following issue:

https://github.com/gggeek/phpxmlrpc/issues/46

Unfortunately the link that the library author claims backs him up on the date requirements of the XMLRPC spec is gone, but I think the next step would be to verify whether or not the date format being provided actually conforms to the XMLRPC spec or not.

asmecher commented 2 years ago

See https://github.com/pkp/plagiarism/issues/29 for a resolution to the PHPXMLRPC date issue; this should be included in the next release of the plugin as a patch applied to the dependency. If there are other issues causing the same symptoms, please comment here and I'll re-open.