PKP Usage statistics report not working on OJS 3.2.1.1

Hello everybody,
I’m working on upgrading OJS 2.8.4 to 3.x.
I’ve upgraded successfully to 3.1.2.4 and then to 3.2.1.1 and also directly from 2.4.8 to 3.2.1.1. All works well, except for the Usage statistics report.

The report doesn’t work in both 3.1.2.4 and 3.2.1.1
When I go to the Report generator and then I click on Usage statistic report at /management/tools/report?pluginName=usageStatsReportPlugin
I get only a blank page.

Strangely, I don’t have errors in the error_log nor on the video.

I think that is related to the data in the metrics table since I don’t have errors. In that case, I obtain an empty report, but that is normal. When I have the metrics table containing the data, I have a blank page and no CSV exported.

I found similar issues in other posts, and I guess that the error could be related to some rows in “metrics” table, where items are not associated with an actual submission or section or so on, but I don’t know how to find them

Any help and suggestions are very appreciated!

Thanks,
andrea

Hi @marchitelli,

What response code is the server providing along with that blank page – a 500 or a 200 (or something else)?

Regards,
Alec Smecher
Public Knowledge Project Team

Hello @asmecher,
in OJS 3.2.1.1 I am getting a completely blank page with no errors in the PHP error log (PHP version is 7.2.25 and MYSQL version is 8.0.18

I also tested it in OJS 3.1.2.4 where I am getting an error 500 (PHP version 7.1.33, MYSQL 8.0.18). In that version, I am getting logged errors as follows

[29-Sep-2020 05:51:55 UTC] PHP Deprecated:  Non-static method Core::removeBaseUrl() should not be called statically in C:\wamp64\www\ojs\plugins\generic\usageStats\UsageStatsLoader.inc.php on line 711

[29-Sep-2020 05:51:55 UTC] PHP Stack trace:

[29-Sep-2020 05:51:55 UTC] PHP   1. {main}() C:\wamp64\www\ojs\index.php:0

[29-Sep-2020 05:51:55 UTC] PHP   2. Application->execute() C:\wamp64\www\ojs\index.php:68

[29-Sep-2020 05:51:55 UTC] PHP   3. Dispatcher->dispatch() C:\wamp64\www\ojs\lib\pkp\classes\core\PKPApplication.inc.php:252

[29-Sep-2020 05:51:55 UTC] PHP   4. PageRouter->route() C:\wamp64\www\ojs\lib\pkp\classes\core\Dispatcher.inc.php:134

[29-Sep-2020 05:51:55 UTC] PHP   5. PageRouter->_authorizeInitializeAndCallRequest() C:\wamp64\www\ojs\lib\pkp\classes\core\PKPPageRouter.inc.php:231

[29-Sep-2020 05:51:55 UTC] PHP   6. IndexHandler->index() C:\wamp64\www\ojs\lib\pkp\classes\core\PKPRouter.inc.php:390

[29-Sep-2020 05:51:55 UTC] PHP   7. Request->redirect() C:\wamp64\www\ojs\pages\index\IndexHandler.inc.php:34

[29-Sep-2020 05:51:55 UTC] PHP   8. Request->redirectUrl() C:\wamp64\www\ojs\lib\pkp\classes\core\PKPRequest.inc.php:720

[29-Sep-2020 05:51:55 UTC] PHP   9. AcronPlugin->shutdownFunction() C:\wamp64\www\ojs\lib\pkp\plugins\generic\acron\PKPAcronPlugin.inc.php:0

[29-Sep-2020 05:51:55 UTC] PHP  10. UsageStatsLoader->execute() C:\wamp64\www\ojs\lib\pkp\plugins\generic\acron\PKPAcronPlugin.inc.php:257

[29-Sep-2020 05:51:55 UTC] PHP  11. UsageStatsLoader->executeActions() C:\wamp64\www\ojs\lib\pkp\classes\scheduledTask\ScheduledTask.inc.php:148

[29-Sep-2020 05:51:55 UTC] PHP  12. UsageStatsLoader->executeActions() C:\wamp64\www\ojs\plugins\generic\usageStats\UsageStatsLoader.inc.php:127

[29-Sep-2020 05:51:55 UTC] PHP  13. UsageStatsLoader->processFile() C:\wamp64\www\ojs\lib\pkp\classes\task\FileLoader.inc.php:167

[29-Sep-2020 05:51:55 UTC] PHP  14. UsageStatsLoader->_getUrlMatches() C:\wamp64\www\ojs\plugins\generic\usageStats\UsageStatsLoader.inc.php:172

[29-Sep-2020 05:51:55 UTC] PHP Deprecated:  Non-static method Core::_getBaseUrlAndPath() should not be called statically in C:\wamp64\www\ojs\lib\pkp\classes\core\Core.inc.php on line 232

[29-Sep-2020 05:51:55 UTC] PHP Stack trace:

[29-Sep-2020 05:51:55 UTC] PHP   1. {main}() C:\wamp64\www\ojs\index.php:0

[29-Sep-2020 05:51:55 UTC] PHP   2. Application->execute() C:\wamp64\www\ojs\index.php:68

[29-Sep-2020 05:51:55 UTC] PHP   3. Dispatcher->dispatch() C:\wamp64\www\ojs\lib\pkp\classes\core\PKPApplication.inc.php:252

[29-Sep-2020 05:51:55 UTC] PHP   4. PageRouter->route() C:\wamp64\www\ojs\lib\pkp\classes\core\Dispatcher.inc.php:134

[29-Sep-2020 05:51:55 UTC] PHP   5. PageRouter->_authorizeInitializeAndCallRequest() C:\wamp64\www\ojs\lib\pkp\classes\core\PKPPageRouter.inc.php:231

[29-Sep-2020 05:51:55 UTC] PHP   6. IndexHandler->index() C:\wamp64\www\ojs\lib\pkp\classes\core\PKPRouter.inc.php:390

[29-Sep-2020 05:51:55 UTC] PHP   7. Request->redirect() C:\wamp64\www\ojs\pages\index\IndexHandler.inc.php:34

[29-Sep-2020 05:51:55 UTC] PHP   8. Request->redirectUrl() C:\wamp64\www\ojs\lib\pkp\classes\core\PKPRequest.inc.php:720

[29-Sep-2020 05:51:55 UTC] PHP   9. AcronPlugin->shutdownFunction() C:\wamp64\www\ojs\lib\pkp\plugins\generic\acron\PKPAcronPlugin.inc.php:0

[29-Sep-2020 05:51:55 UTC] PHP  10. UsageStatsLoader->execute() C:\wamp64\www\ojs\lib\pkp\plugins\generic\acron\PKPAcronPlugin.inc.php:257

[29-Sep-2020 05:51:55 UTC] PHP  11. UsageStatsLoader->executeActions() C:\wamp64\www\ojs\lib\pkp\classes\scheduledTask\ScheduledTask.inc.php:148

[29-Sep-2020 05:51:55 UTC] PHP  12. UsageStatsLoader->executeActions() C:\wamp64\www\ojs\plugins\generic\usageStats\UsageStatsLoader.inc.php:127

[29-Sep-2020 05:51:55 UTC] PHP  13. UsageStatsLoader->processFile() C:\wamp64\www\ojs\lib\pkp\classes\task\FileLoader.inc.php:167

[29-Sep-2020 05:51:55 UTC] PHP  14. UsageStatsLoader->_getUrlMatches() C:\wamp64\www\ojs\plugins\generic\usageStats\UsageStatsLoader.inc.php:172

[29-Sep-2020 05:51:55 UTC] PHP  15. Core::removeBaseUrl() C:\wamp64\www\ojs\plugins\generic\usageStats\UsageStatsLoader.inc.php:711

[29-Sep-2020 05:52:31 UTC] PHP Deprecated:  Non-static method PKPRequest::_checkThis() should not be called statically in C:\wamp64\www\ojs\lib\pkp\classes\core\PKPRequest.inc.php on line 718

[29-Sep-2020 05:52:31 UTC] PHP Stack trace:

[29-Sep-2020 05:52:31 UTC] PHP   1. {main}() C:\wamp64\www\ojs\index.php:0

[29-Sep-2020 05:52:31 UTC] PHP   2. Application->execute() C:\wamp64\www\ojs\index.php:68

[29-Sep-2020 05:52:31 UTC] PHP   3. Dispatcher->dispatch() C:\wamp64\www\ojs\lib\pkp\classes\core\PKPApplication.inc.php:252

[29-Sep-2020 05:52:31 UTC] PHP   4. PageRouter->route() C:\wamp64\www\ojs\lib\pkp\classes\core\Dispatcher.inc.php:134

[29-Sep-2020 05:52:31 UTC] PHP   5. PageRouter->_authorizeInitializeAndCallRequest() C:\wamp64\www\ojs\lib\pkp\classes\core\PKPPageRouter.inc.php:231

[29-Sep-2020 05:52:31 UTC] PHP   6. ToolsHandler->tools() C:\wamp64\www\ojs\lib\pkp\classes\core\PKPRouter.inc.php:390

[29-Sep-2020 05:52:31 UTC] PHP   7. ToolsHandler->report() C:\wamp64\www\ojs\lib\pkp\pages\management\PKPToolsHandler.inc.php:58

[29-Sep-2020 05:52:31 UTC] PHP   8. OJSUsageStatsReportPlugin->display() C:\wamp64\www\ojs\lib\pkp\pages\management\PKPToolsHandler.inc.php:149

[29-Sep-2020 05:52:31 UTC] PHP   9. PKPRequest::redirect() C:\wamp64\www\ojs\plugins\generic\usageStats\PKPUsageStatsReportPlugin.inc.php:74

Hi @marchitelli,

Can you check the response code in your 3.2.1-x installation? You should be able to do that with your browser’s web developer tools (e.g. the Network tab).

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,
it’s a 500, but I cannot find anything in php_error.log, again.

below the details of the request

  1. Request URL:

http://localhost/ojs-321-1/index.php/jlis/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={"context_id"%3A1}&orderBy={"month"%3A"ASC"}

  1. Request Method:

GET

  1. Status Code:

500 Internal Server Error

  1. Remote Address:
  1. Referrer Policy:

strict-origin-when-cross-origin

  1. Response Headersview source

  2. Connection:

close

  1. Content-Length:

0

  1. Content-Type:

text/html; charset=UTF-8

  1. Date:

Wed, 30 Sep 2020 06:55:31 GMT

  1. Server:

Apache/2.4.41 (Win64) OpenSSL/1.1.1c PHP/7.2.25

  1. Set-Cookie:

OJSSID=nssmbphdajv64064uaq670r14a; expires=Fri, 30-Oct-2020 06:55:31 GMT; Max-Age=2592000; path=/ojs-321-1/

  1. X-Powered-By:

PHP/7.2.25

  1. Request Headersview source

  2. Accept:

text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9

  1. Accept-Encoding:

gzip, deflate, br

  1. Accept-Language:

it-IT,it;q=0.9,en-US;q=0.8,en-GB;q=0.7,en;q=0.6

  1. Cache-Control:

max-age=0

  1. Connection:

keep-alive

  1. Cookie:

OJSSID=nssmbphdajv64064uaq670r14a; _ga=GA1.1.2075360251.1601011084; _gid=GA1.1.1212061709.1601448454

  1. Host:

localhost

  1. Referer:

http://localhost/ojs-321-1/index.php/jlis/management/tools

  1. Sec-Fetch-Dest:

document

  1. Sec-Fetch-Mode:

navigate

  1. Sec-Fetch-Site:

cross-site

  1. Sec-Fetch-User:

?1

  1. Upgrade-Insecure-Requests:

1

  1. User-Agent:

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36

  1. Query String Parametersview sourceview URL encoded

  2. metricType[]:

ojs::counter

  1. columns[]:

assoc_id

  1. columns[]:

assoc_type

  1. columns[]:

file_type

  1. columns[]:

submission_id

  1. columns[]:

context_id

  1. columns[]:

pkp_section_id

  1. columns[]:

city

  1. columns[]:

region

  1. columns[]:

country_id

  1. columns[]:

month

  1. columns[]:

metric_type

  1. columns[]:

metric

  1. columns[]:

assoc_object_id

  1. filters:

{“context_id”:1}

  1. orderBy:

{“month”:“ASC”}

Hi @marchitelli,

Does your web server perhaps keep separate Apache and PHP error logs? Make sure you check both, if so. A 500 error should always result in a log entry.

Regards,
Alec Smecher
Public Knowledge Project Team

Hello @asmecher
I’m using WAMP on windows 10.

I checked several logs.
In the apache log I found the error 500 as follow (see last row)

::1 - - [30/Sep/2020:16:56:54 +0200] "GET /ojs-321-1/index.php/jlis/ HTTP/1.1" 500 7768

::1 - - [30/Sep/2020:16:56:59 +0200] "GET /ojs-321-1/public/journals/1/styleSheet.css?v=3.2.1.1 HTTP/1.1" 404 296

::1 - - [30/Sep/2020:16:56:59 +0200] "GET /ojs-321-1/public/journals/1/pageHeaderLogoImage_en_US.png HTTP/1.1" 404 296

::1 - - [30/Sep/2020:16:57:00 +0200] "GET /ojs-321-1/public/journals/1/favicon_en_US.gif HTTP/1.1" 404 296

::1 - - [30/Sep/2020:16:57:02 +0200] "GET /ojs-321-1/index.php/jlis/admin/index HTTP/1.1" 200 12535

::1 - - [30/Sep/2020:16:57:03 +0200] "GET /ojs-321-1/public/journals/1/pageHeaderLogoImage_en_US.png HTTP/1.1" 404 296

::1 - - [30/Sep/2020:16:57:03 +0200] "GET /ojs-321-1/index.php/jlis/$$$call$$$/page/page/css?v=3.2.1.1 HTTP/1.1" 200 103280

::1 - - [30/Sep/2020:16:57:03 +0200] "GET /favicon.ico HTTP/1.1" 200 202575

::1 - - [30/Sep/2020:16:57:03 +0200] "GET /ojs-321-1/index.php/jlis/$$$call$$$/page/page/user-nav-backend?_=1601477823529 HTTP/1.1" 200 3026

::1 - - [30/Sep/2020:16:57:04 +0200] "GET /ojs-321-1/index.php/jlis/$$$call$$$/page/page/tasks?_=1601477823530 HTTP/1.1" 200 1298

::1 - - [30/Sep/2020:16:57:04 +0200] "GET /ojs-321-1/index.php/jlis/$$$call$$$/grid/notifications/task-notifications-grid/fetch-grid?_=1601477823531 HTTP/1.1" 200 9703

::1 - - [30/Sep/2020:16:57:06 +0200] "GET /ojs-321-1/index.php/jlis/management/tools HTTP/1.1" 200 11789

::1 - - [30/Sep/2020:16:57:07 +0200] "GET /ojs-321-1/public/journals/1/pageHeaderLogoImage_en_US.png HTTP/1.1" 404 296

::1 - - [30/Sep/2020:16:57:07 +0200] "GET /ojs-321-1/index.php/jlis/$$$call$$$/page/page/user-nav-backend?_=1601477827434 HTTP/1.1" 200 3026

::1 - - [30/Sep/2020:16:57:07 +0200] "GET /ojs-321-1/index.php/jlis/$$$call$$$/page/page/tasks?_=1601477827436 HTTP/1.1" 200 1298

::1 - - [30/Sep/2020:16:57:07 +0200] "GET /ojs-321-1/index.php/jlis/management/statistics?_=1601477827435 HTTP/1.1" 200 1728

::1 - - [30/Sep/2020:16:57:08 +0200] "GET /ojs-321-1/index.php/jlis/$$$call$$$/grid/notifications/task-notifications-grid/fetch-grid?_=1601477827437 HTTP/1.1" 200 9703

::1 - - [30/Sep/2020:16:57:10 +0200] "GET /ojs-321-1/index.php/jlis/management/tools/report?pluginName=usageStatsReportPlugin HTTP/1.1" 302 -

::1 - - [30/Sep/2020:16:57:11 +0200] "GET /ojs-321-1/index.php/jlis/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 -

No lines in the PHP error log at this time

In the apache_error.log I see things that seem unrelated

[Wed Sep 30 16:56:41.732001 2020] [ssl:warn] [pid 16372:tid 620] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]

[Wed Sep 30 16:56:42.442947 2020] [mpm_winnt:notice] [pid 16372:tid 620] AH00455: Apache/2.4.41 (Win64) OpenSSL/1.1.1c PHP/7.2.25 configured -- resuming normal operations

[Wed Sep 30 16:56:42.442947 2020] [mpm_winnt:notice] [pid 16372:tid 620] AH00456: Apache Lounge VS16 Server built: Aug  9 2019 16:46:32

[Wed Sep 30 16:56:42.442947 2020] [core:notice] [pid 16372:tid 620] AH00094: Command line: 'c:\\wamp64\\bin\\apache\\apache2.4.41\\bin\\httpd.exe -d C:/wamp64/bin/apache/apache2.4.41'

[Wed Sep 30 16:56:42.447257 2020] [mpm_winnt:notice] [pid 16372:tid 620] AH00418: Parent: Created child process 18560

[Wed Sep 30 16:56:43.001445 2020] [ssl:warn] [pid 18560:tid 668] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]

[Wed Sep 30 16:56:43.067220 2020] [mpm_winnt:notice] [pid 18560:tid 668] AH00354: Child: Starting 64 worker threads.

Thanks,
andrea

(See also: [OJS 3.2.1.1] Generation of PKP Usage statistics report fails with 500 Http error - #5 by bolelligallevi)

I’m with the same problem but for all plugins that we try open using:

/management/tools/report?pluginName=
/management/tools/report?pluginName=ArticleReportPlugin
/management/tools/report?pluginName=ScieloSubmissionsReportPlugin

All they are open a blank page.

error

Hello Everyone,

I am encountering this problem. The PKP Usage statistics report is not working. The statistics is empty.

image

Besides, I can not see the the articles publish in statistics section:

image

Please help, I am using OJS 3.3.0.10