Error: An unexpected error has occurred. Please reload the page and try again. when click Record Decision (Accept Submssion, Request Revisions, and decline).
OJS version: 3.4.0.8
Error log:
[php:notice] [pid 30124:tid 1952] [client 127.0.0.1:64450] PHP Deprecated: preg_replace_callback(): Passing null to parameter #3 ($subject) of type array|string is deprecated in …\lib\pkp\lib\vendor\slim\slim\Slim\Http\Uri.php on line 716, referer: …/index.php/JL/decision/record/25566?decision=2&reviewRoundId=4048785758619712901
[Wed Dec 11 09:41:58.478049 2024] [php:notice] [pid 30124:tid 1976] [client 127.0.0.1:63932] PHP Deprecated: preg_replace_callback(): Passing null to parameter #3 ($subject) of type array|string is deprecated in domain\lib\pkp\lib\vendor\slim\slim\Slim\Http\Uri.php on line 716, referer: domain/index.php/JL/decision/record/25560?decision=7
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
VirtualProtect() failed [87] The parameter is incorrect
[Wed Dec 11 09:42:02.898116 2024] [php:notice] [pid 30124:tid 1976] [client 127.0.0.1:63932] Process could not be started: The system cannot find the path specified.\r\n, referer: domain/index.php/JL/decision/record/25560?decision=7
I have tried installing using the same database on a different hosting but the error still appears
Hmm, that’s not the stack trace I was hoping for. You might need to temporarily modify the file in question to get it to dump out more information into the error log. If you have some basic PHP skills, change lib/pkp/lib/vendor/slim/slim/Slim/Http/Uri.php. Find the filterQuery function:
/**
* Filters the query string or fragment of a URI.
*
* @param string $query The raw uri query string.
*
* @return string The percent-encoded query string.
*/
protected function filterQuery($query)
{
return preg_replace_callback(
'/(?:[^a-zA-Z0-9_\-\.~!\$&\'\(\)\*\+,;=%:@\/\?]+|%(?![A-Fa-f0-9]{2}))/',
function ($match) {
return rawurlencode($match[0]);
},
$query
);
}
Change it to:
/**
* Filters the query string or fragment of a URI.
*
* @param string $query The raw uri query string.
*
* @return string The percent-encoded query string.
*/
protected function filterQuery($query)
{
if ($query === null) {
error_log('ERROR CONDITION: ' . print_r(debug_backtrace(), true));
}
return preg_replace_callback(
'/(?:[^a-zA-Z0-9_\-\.~!\$&\'\(\)\*\+,;=%:@\/\?]+|%(?![A-Fa-f0-9]{2}))/',
function ($match) {
return rawurlencode($match[0]);
},
$query
);
}
Then watch the error log for the ERROR CONDITION: text to appear.
Of course, please take a complete backup before working with files on the server!
Regards,
Alec Smecher
Public Knowledge Project Team
Unfortunately it looks like the error log entry got cut off in the log file. If you’re handy with PHP, could you try a call to file_put_contents that’ll write the message to a file somewhere handy on the system (e.g. a temp folder) rather than using error_log?
Regards,
Alec Smecher
Public Knowledge Project Team
Modifying my instructions above – change lib/pkp/lib/vendor/slim/slim/Slim/Http/Uri.php. Find the filterQuery function:
/**
* Filters the query string or fragment of a URI.
*
* @param string $query The raw uri query string.
*
* @return string The percent-encoded query string.
*/
protected function filterQuery($query)
{
return preg_replace_callback(
'/(?:[^a-zA-Z0-9_\-\.~!\$&\'\(\)\*\+,;=%:@\/\?]+|%(?![A-Fa-f0-9]{2}))/',
function ($match) {
return rawurlencode($match[0]);
},
$query
);
}
Change it to:
/**
* Filters the query string or fragment of a URI.
*
* @param string $query The raw uri query string.
*
* @return string The percent-encoded query string.
*/
protected function filterQuery($query)
{
if ($query === null) {
file_put_contents('/tmp/tmp.txt', 'ERROR CONDITION: ' . print_r(debug_backtrace(), true));
}
return preg_replace_callback(
'/(?:[^a-zA-Z0-9_\-\.~!\$&\'\(\)\*\+,;=%:@\/\?]+|%(?![A-Fa-f0-9]{2}))/',
function ($match) {
return rawurlencode($match[0]);
},
$query
);
}
Change the /tmp/tmp.txt part to a location where OJS has permission to store a file. Once this code is run, a file should be created there with the stack trace.
Of course, please take a complete backup before working with files on the server!
Regards,
Alec Smecher
Public Knowledge Project Team
I’m afraid the only cause I can think of is an incorrectly specified path or a permission problem. You might see something relevant in the PHP error log.
Regards,
Alec Smecher
Public Knowledge Project Team
I have successfully generated the tmp.txt file, the file is very large (700MB), I attach the complete converted PDF file from tmp.txt and I also attach a snippet of the generated results in tmp.txt as follows: PDF link generate tmp
Could you upload a compressed archive of the text file somewhere that I can access it, rather than converting it to a PDF? The PDF is hard to search for the relevant text.
Regards,
Alec Smecher
Public Knowledge Project Team
I’m afraid you might have to get into the guts of our API routing to resolve this. Essentially you are getting an issue with our API routing framework, where the Slim microframework router used in OJS 3.4.0 is not getting the query information from the request URL.
Unfortunately there is something on your system that I can’t recreate here – and others with similar environments (Windows, Xampp, OJS 3.4.0-x) haven’t hit the same problem, so I think you might have to do some investigation there.
Regards,
Alec Smecher
Public Knowledge Project Team
I have tried with a different hosting environment (Centos/CWP, PHP 8), the same OJS source code (3.4.0) and the same database, but the error still appears. Is this really an error due to the upgrade? because every time I upgrade to version 3.4.x the error appears, but when I upgrade only to 3.3.0.19 the error doesn’t appear
I might suggest sticking with the latest 3.3.0-x and then jumping right from there to 3.5.0-x, which uses a different library for API routing. We’re planning to release 3.5.0 in Q1 2025 anyway, and it will be our next LTS (long-term support) release, so it’ll last you well. It replaces the Slim dependency with Laravel for API routing, so won’t experience the problem.
Regards,
Alec Smecher
Public Knowledge Project Team