[OJS] Generation of PKP Usage statistics report fails with 500 Http error

Hi everyone I have noticed that the PKP Usage statistics report fails when I try to generate it. I got the following page:


Looking in the Apache log files, in the error_log I did not find anything; but in the access_log I have found this: - - [28/Sep/2020:18:22:08 -0500] "GET /andamios_ojs3211/index.php/andamios/management/tools/generateReport?metricType[]=ojs%3A%3Acounter&columns[]=assoc_id&columns[]=assoc_type&columns[]=file_type&columns[]=submission_id&columns[]=context_id&columns[]=pkp_section_id&columns[]=city&columns[]=region&columns[]=country_id&columns[]=month&columns[]=metric_type&columns[]=metric&columns[]=assoc_object_id&filters=%7B%22context_id%22%3A1%7D&orderBy=%7B%22month%22%3A%22ASC%22%7D HTTP/1.1" 500 -

Do I need some configuration more to make work the generation of this kind of report? All the other reports work fine, it’s only the PKP Usage statistics report which fails.

Thanks a lot for your attention.
Best regards.

Hi @juancure,

The title of the post says you encountered a 505 error but the screenshot says 500; is that a typo or are there two different errors?

Alec Smecher
Public Knowledge Project Team

Hi @asmecher I made a mistake in the post’s title, the message of error is HTTP Error 500 in the screenshot and in the log both.

Do you know what is the reason of this error message?

Thanks a lot for your time.

Hi @juancure,

Were you able to find something in your PHP error log? Something should appear corresponding to the 500 error.

Alec Smecher
Public Knowledge Project Team

Hi @asmecher and @juancure, this problem looks similar to this opened by @marchitelli.
I checked 2 of our journals, finding one with the same problem, and the other starting the download of the csv without problems.
In the one with the problem the URL after the click on the “PKP Usage statistics report” button becomes as below.
I hope this helps.
Best regards


Hi @bolelligallevi,

Were you able to identify any kind of log message to go with the 500 errors?

Alec Smecher
Public Knowledge Project Team

I am also having the same issue. I am using OJS I am able to get Article Report but not able to get Review Report, Editorial Activity etc.

Hi @asmecher, these are our log for the problem. My IT staff says it it the same error and log message of this thread, but I’m not so sure that an update (as you say on that thread) can solve the problem because @marchitelli has the same 500 issue on 3.2…
Can you see if there are two (or more: actually I’m counting 3 thread: this, the above one, and this, plus one in italian) different 500 issues spread on different versions, or if the problem is only one?
@latha_ojs, can you provide your logs about PKP Usage statistics report?
Thank you very much, best regards

PHP message: PHP Fatal error: Uncaught Error: [] operator not supported for strings in /xxxxx/xxxxx/xxxxx/classes/statistics/MetricsDAO.inc.php:34 Stack trace: #0 /xxxxx/xxxxx/xxxxx/plugins/generic/usageStats/PKPUsageStatsReportPlugin.inc.php(84): MetricsDAO->getMetrics('ojs::counter', Array, 'a:1:{s:10:"cont...', 'a:1:{s:5:"month...', NULL)\n #1 /xxxxx/xxxxx/xxxxx/plugins/generic/usageStats/OJSUsageStatsReportPlugin.inc.php(32): PKPUsageStatsReportPlugin->getMetrics('ojs::counter', Array, 'a:1:{s:10:"cont...', 'a:1:{s:5:"month...', NULL)\n #2 /xxxxx/xxxxx/xxxxx/lib/pkp/pages/management/PKPToolsHandler.inc.php(208): OJSUsageStatsReportPlugin->getMetrics('ojs::counter', Array, 'a:1:{s:10:"cont...', 'a:1:{s:5:"month...')\n #3 /xxxxx/xxxxx/xxxxx/lib/pkp/pages/management/PKPToolsHandler.inc.php(64): PKPToolsHandler->generateReport(Array, Object(Request)) referer: https://riviste.unimi.it/index.php/noema/management/tools

I’m also getting an error 500 with PKP Usage statistics report with the following line:


I enabled every possible error reporting flag (on OJS and on php.ini) and I got nothing on httpd-error.log, on https-access.log I have only: - - [22/Oct/2020:11:17:47 -0300] "GET /alfa/management/tools/generateReport?metricType[]=ojs%3A%3Acounter&columns[]=assoc_id&columns[]=assoc_type&columns[]=file_type&columns[]=submission_id&columns[]=context_id&columns[]=pkp_section_id&columns[]=city&columns[]=region&columns[]=country_id&columns[]=month&columns[]=metric_type&columns[]=metric&columns[]=assoc_object_id&filters=%7B%22context_id%22%3A56%7D&orderBy=%7B%22month%22%3A%22ASC%22%7D HTTP/1.1" 500 -

I’m on, just migrated from

I think that I discovered what was happening.

I never actually used this report, but since it is now listed first we obviously try it.

Previously when it did ran in, it never actually finished running, in my reports I only had 2 months of data. I just assumed it finished cleanly but didn’t actually bother to check the data.

Today I enabled a 2 Gb per php process, 3000 seconds of execution time and left it running, after the execution time ended (almost one hour) it still haven’t finished, but it did generate something and the download “finished”. I only had data from 201404 to 201702 (less than 3 years), the CSV has more than 350 thousand lines, and 80 MB.

Is it actually possible to use the generated report from “PKP Usage statistics”??

Hello @luizborges and @asmecher
also in our case the plugin is requesting at least 2GB of RAM, and after a lot of time, I’ve download a 393KB report, that’s very little compared to the time it took.