Statistics not showing in OJS

Hi @NateWr

I have migrated OJS to new VPS server (Unmanaged). But i see that usage statistics are not being updated.

Application Version: OJS 3.3.0.7:

Anacron plugin enabled. Usage Statistics Plugin enabled.

So i tried creating a cron job in cpanel. But I am not sure about the command to create the cron job.

Can someone guide to resolve the issue.

Thanks in advance.

Hi @Psek

If the acron plugin is enabled, and the usageStatistics plugin is enabled, then stats should be getting processed. You do not necessarily need a separate cron job. You can confirm that the crons are running by looking in the scheduled_tasks database table which will contain time stamps for each task, and when it ran last.

If the task is running then your issue is something else.

Cheers,
Jason

Thank you for your response @jnugent

Please see the scheduled_tasks database table

image

Here is the error log

[15-Aug-2021 15:10:44 UTC] PHP Warning: Undefined variable $newFile in /home/resaim/journals/plugins/importexport/quickSubmit/QuickSubmitForm.inc.php on line 312
[15-Aug-2021 15:30:23 UTC] PHP Warning: ini_set(): Session ini settings cannot be changed when a session is active in /home/resaim/journals/lib/pkp/classes/session/SessionManager.inc.php on line 69
[15-Aug-2021 15:30:25 UTC] PHP Warning: ini_set(): Session ini settings cannot be changed when a session is active in /home/resaim/journals/lib/pkp/classes/session/SessionManager.inc.php on line 69
[15-Aug-2021 15:30:54 UTC] PHP Warning: ini_set(): Session ini settings cannot be changed when a session is active in /home/resaim/journals/lib/pkp/classes/session/SessionManager.inc.php on line 69
[15-Aug-2021 15:30:58 UTC] PHP Warning: ini_set(): Session ini settings cannot be changed when a session is active in /home/resaim/journals/lib/pkp/classes/session/SessionManager.inc.php on line 69
[15-Aug-2021 15:31:06 UTC] PHP Warning: ini_set(): Session ini settings cannot be changed when a session is active in /home/resaim/journals/lib/pkp/classes/session/SessionManager.inc.php on line 69
[15-Aug-2021 15:31:12 UTC] PHP Warning: ini_set(): Session ini settings cannot be changed when a session is active in /home/resaim/journals/lib/pkp/classes/session/SessionManager.inc.php on line 69
[15-Aug-2021 15:31:18 UTC] PHP Warning: ini_set(): Session ini settings cannot be changed when a session is active in /home/resaim/journals/lib/pkp/classes/session/SessionManager.inc.php on line 69
[15-Aug-2021 15:32:33 UTC] PHP Warning: ini_set(): Session ini settings cannot be changed when a session is active in /home/resaim/journals/lib/pkp/classes/session/SessionManager.inc.php on line 69
[15-Aug-2021 15:32:38 UTC] PHP Warning: ini_set(): Session ini settings cannot be changed when a session is active in /home/resaim/journals/lib/pkp/classes/session/SessionManager.inc.php on line 69
[15-Aug-2021 15:32:39 UTC] PHP Warning: ini_set(): Session ini settings cannot be changed when a session is active in /home/resaim/journals/lib/pkp/classes/session/SessionManager.inc.php on line 69
[15-Aug-2021 15:32:45 UTC] PHP Warning: ini_set(): Session ini settings cannot be changed when a session is active in /home/resaim/journals/lib/pkp/classes/session/SessionManager.inc.php on line 69
[15-Aug-2021 15:33:35 UTC] PHP Warning: ini_set(): Session ini settings cannot be changed when a session is active in /home/resaim/journals/lib/pkp/classes/session/SessionManager.inc.php on line 69
[15-Aug-2021 15:34:33 UTC] PHP Warning: Undefined variable $newFile in /home/resaim/journals/plugins/importexport/quickSubmit/QuickSubmitForm.inc.php on line 312
[15-Aug-2021 15:52:44 UTC] PHP Warning: ini_set(): Session ini settings cannot be changed when a session is active in /home/resaim/journals/lib/pkp/classes/session/SessionManager.inc.php on line 69
[15-Aug-2021 15:52:45 UTC] PHP Warning: ini_set(): Session ini settings cannot be changed when a session is active in /home/resaim/journals/lib/pkp/classes/session/SessionManager.inc.php on line 69
[15-Aug-2021 15:52:48 UTC] PHP Warning: ini_set(): Session ini settings cannot be changed when a session is active in /home/resaim/journals/lib/pkp/classes/session/SessionManager.inc.php on line 69
[15-Aug-2021 15:58:49 UTC] ojs2: 404 Not Found
[15-Aug-2021 16:08:00 UTC] PHP Warning: Undefined variable $newFile in /home/resaim/journals/plugins/importexport/quickSubmit/QuickSubmitForm.inc.php on line 312
[15-Aug-2021 16:27:09 UTC] ojs2: 404 Not Found
[15-Aug-2021 16:55:30 UTC] ojs2: 404 Not Found
[15-Aug-2021 17:04:08 UTC] ojs2: 404 Not Found
[15-Aug-2021 17:04:08 UTC] ojs2: 404 Not Found
[15-Aug-2021 17:04:09 UTC] ojs2: 404 Not Found
[15-Aug-2021 17:04:09 UTC] ojs2: 404 Not Found

Can you please check.

So those errors don’t correspond to the acron plugin (the task hasn’t run yet on the 15th, but the logs are from the 15th). You’ll need to go back much further in time.

Regards,
Jason

you should also look in the scheduledTaskLogs folder inside of your files_dir and look for the ones related to the usage statistics plugin task. There will be specific logs for that.

Thank you for the advice.

Here are the scheduledTaskLogs details.

August 9th

[2021-08-09 18:59:03] [Notice] Task process started.
[2021-08-09 18:59:03] [Error] The directory /home/resaim/public_html/ojsdata/usageStats/processing is not empty. This could indicate a previously failed process, or a concurrently running process. This file will be automatically reprocessed if you are also using scheduledTasksAutoStage.xml, otherwise you will need to manually move any orphaned files in the processing directory back into the stage directory.
[2021-08-09 18:59:05] [Notice] File /home/resaim/public_html/ojsdata/usageStats/processing/usage_events_20210808.log was processed and archived.
[2021-08-09 18:59:15] [Notice] File /home/resaim/public_html/ojsdata/usageStats/processing/usage_events_20210807.log was processed and archived.
[2021-08-09 18:59:15] [Notice] Task process stopped.

August 10th

[2021-08-10 18:59:10] [Notice] Task process started.

August 11th

[2021-08-11 18:59:11] [Notice] Task process started.
[2021-08-11 18:59:11] [Error] The directory /home/resaim/public_html/ojsdata/usageStats/processing is not empty. This could indicate a previously failed process, or a concurrently running process. This file will be automatically reprocessed if you are also using scheduledTasksAutoStage.xml, otherwise you will need to manually move any orphaned files in the processing directory back into the stage directory.

August 12th

[2021-08-12 18:59:13] [Notice] Task process started.
[2021-08-12 18:59:13] [Error] The directory /home/resaim/ojsdata/usageStats/processing is not empty. This could indicate a previously failed process, or a concurrently running process. This file will be automatically reprocessed if you are also using scheduledTasksAutoStage.xml, otherwise you will need to manually move any orphaned files in the processing directory back into the stage directory.

[2021-08-13 18:59:48] [Notice] Task process started.
[2021-08-13 18:59:48] [Error] The directory /home/resaim/ojsdata/usageStats/processing is not empty. This could indicate a previously failed process, or a concurrently running process. This file will be automatically reprocessed if you are also using scheduledTasksAutoStage.xml, otherwise you will need to manually move any orphaned files in the processing directory back into the stage directory.

Can you please check and let me know the issue and solution.

Hi @Psek

So, the log file is telling you what you need to do:

This file will be automatically reprocessed if you are also using scheduledTasksAutoStage.xml, otherwise you will need to manually move any orphaned files in the processing directory back into the stage directory.

You’ll need to move any file still in the processing directory in the files_dir usageStats/processing directory back into the stage directory and let the process run again. If it generates an error because the log is possibly corrupt, we can go from there.

Jason

Thank you @jnugent

I have moved the usage_events log file from processing directory to stage directory.

I will wait for it to process.

I will get back to you whether it is success or fail.

Thank you.

Hi @jnugent

As per your suggestion, I have moved the files from processing folder to stage folder. But still not showing stats even after 48 hours.

This is the scheduledtaskslog

[2021-08-17 09:27:17] [Notice] Task process started.

This is in stage folder

image

This is in processing folder

image

Error log

[16-Aug-2021 19:00:23 UTC] PHP Fatal error: Uncaught Error: Non-static method Core::removeBaseUrl() cannot be called statically in /home/resaim/journals/plugins/generic/usageStats/UsageStatsLoader.inc.php:777
Stack trace:
#0 /home/resaim/journals/plugins/generic/usageStats/UsageStatsLoader.inc.php(172): UsageStatsLoader->_getUrlMatches(‘https://www.jou…’, ‘/home/resaim/oj…’, 1)
#1 /home/resaim/journals/lib/pkp/classes/task/FileLoader.inc.php(167): UsageStatsLoader->processFile(’/home/resaim/oj…’)
#2 /home/resaim/journals/plugins/generic/usageStats/UsageStatsLoader.inc.php(127): FileLoader->executeActions()
#3 /home/resaim/journals/lib/pkp/classes/scheduledTask/ScheduledTask.inc.php(146): UsageStatsLoader->executeActions()
#4 /home/resaim/journals/lib/pkp/plugins/generic/acron/PKPAcronPlugin.inc.php(257): ScheduledTask->execute()
#5 [internal function]: PKPAcronPlugin->shutdownFunction()
#6 {main}
thrown in /home/resaim/journals/plugins/generic/usageStats/UsageStatsLoader.inc.php on line 777
[16-Aug-2021 19:03:31 UTC] PHP Warning: DOMDocument::schemaValidate(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /home/resaim/journals/lib/pkp/classes/xslt/XMLTypeDescription.inc.php on line 134
[16-Aug-2021 19:03:31 UTC] PHP Warning: DOMDocument::schemaValidate(https://www.crossref.org/schemas/crossref4.3.6.xsd): Failed to open stream: no suitable wrapper could be found in /home/resaim/journals/lib/pkp/classes/xslt/XMLTypeDescription.inc.php on line 134
[16-Aug-2021 19:03:31 UTC] PHP Warning: DOMDocument::schemaValidate(): Invalid Schema in /home/resaim/journals/lib/pkp/classes/xslt/XMLTypeDescription.inc.php on line 134
[16-Aug-2021 19:03:31 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/resaim/journals/lib/pkp/plugins/generic/acron/PKPAcronPlugin.inc.php:217) in /home/resaim/journals/lib/pkp/classes/plugins/ImportExportPlugin.inc.php on line 170
[16-Aug-2021 19:03:31 UTC] PHP Fatal error: Uncaught Exception: Could not convert selected objects. in /home/resaim/journals/lib/pkp/classes/plugins/ImportExportPlugin.inc.php:181
Stack trace:
#0 /home/resaim/journals/classes/plugins/PubObjectsExportPlugin.inc.php(397): ImportExportPlugin->displayXMLValidationErrors(Array, ‘<?xml version="…’)
#1 /home/resaim/journals/plugins/importexport/crossref/CrossrefInfoSender.inc.php(124): PubObjectsExportPlugin->exportXML(Array, ‘article=>crossr…’, Object(Journal))
#2 /home/resaim/journals/plugins/importexport/crossref/CrossrefInfoSender.inc.php(66): CrossrefInfoSender->_registerObjects(Array, ‘article=>crossr…’, Object(Journal), ‘articles’)
#3 /home/resaim/journals/lib/pkp/classes/scheduledTask/ScheduledTask.inc.php(146): CrossrefInfoSender->executeActions()
#4 /home/resaim/journals/lib/pkp/plugins/generic/acron/PKPAcronPlugin.inc.php(257): ScheduledTask->execute()
#5 [internal function]: PKPAcronPlugin->shutdownFunction()
#6 {main}
thrown in /home/resaim/journals/lib/pkp/classes/plugins/ImportExportPlugin.inc.php on line 181

Any suggestions please…

Thank you

Hi @Psek

What version of PHP are you using? I think that non-static methods being called statically started generating a fatal error in PHP 8. I don’t think OJS is PHP8 compatible yet.

Regards,
Jason

Hi…@jnugent,

OJS running on Php version 8. Should i roll back old version of php. Will that solve the problem.

Thank you

Hi @Psek,

Yes, you’ll need to drop down to 7.4 or 7.3.

Regards,
Jason

Hi @jnugent,

Thanks a lot. Changing php version to 7.3 populated the stats.

Issue is resolved.

Thank you…

1 Like