Statistics Issue

Hi!

I’m having some issues with the statistics on an OJS, I can see some of the logs in the “usageStats/reject” directory, and the logs for the task doesn’t show any error, it only shows this:
image

However, the articles that are in the logs of “usageStats/archive” should show some statistics but they all are in 0 views.

On the other hand, the rejected logs, show the url like this: https://institution.edu.co/index.php/journal1/article/download/1297/3268/10101

However, the links in this OJS are modified by apache with the following vhost configuration:

<VirtualHost *:80>
ServerName journal1.institution.edu.co
ServerAdmin root@openjournalweb.institution.edu.co
DocumentRoot /var/www/html/ojs/
DirectoryIndex index.php/journal1

ErrorLog /var/www/log/journal1_error.log
CustomLog /var/www/log/journal1_access.log common

<Directory “/var/www/html/ojs/”>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted

    RewriteEngine on
    RewriteRule ^/index.php/journal2 - [R=404]
    RewriteRule ^/index.php/journal3 - [R=404]
    RewriteRule ^/index.php/journal4 - [R=404]
    RewriteRule ^/index.php/journal5 - [R=404]

Can this configuration be messing with the schedule task or with the statistics processed in “usageStats/archive”?

The other issue is that in the “usageStats/reject” directory are only logs from 08/21/2022 to 05/09/2022 and in my “usageStats/archive” the last date for the logs is 23/12/2021, is there any way to generate the logs missing from 2022?

Best regards,

Juan.

Hi @Juan_Lopez,

Hmmm… It sounds like there are several problems occurring there – the log file creation, log file processing, statistics compilation…
What OJS version are you using?
Are you using Acron plugin?
Do other folders, e.g. processing/ or stage/ contain any other, missing usage stats log files? – it is a mystery that the log files are missing…
Regarding the Apache rewrites: Did you also make any changes in the OJS config.inc.php file? The URL in the log file should not be the problem – those are internal/canonical URLs… However, when stats are compiled, the URLs are parsed using/considering the entries in the config.inc.php file (e.g. base_url and base URL override settings)… If the base URL there is correct and there are no base URL override settings, then it should not be a problem, I think.
The missing usage stats log files cannot be re-created, but theoretically it should be possible to compile the statistics for the missing dates also form the Apache log files…

Do you see any errors in the Apache error log file? – Maybe it would be best to take a look immediately after log file processing, because else it could be difficult to spot the error coming exactly from the log file processing: You could try to copy one rejected and one archived log file to the folder stage/ or usageEventLogs/ and take a look in the Apache error log file immediately after the scheduled task plugins.generic.usageStats.UsageStatsLoader has run. The scheduled task runs every day and you can see when it ran the last time in the DB table scheduled_tasks. If you are using Acron plugin, you can also initiate the task to run again immediately by removing that entry/row from that DB table (where class_name = plugins.generic.usageStats.UsageStatsLoader) and visiting an article page, for example. Then or concurrently take a look at the Apache error log file.

So much for now…
Best,
Bozana

Hi @bozana

We’re using OJS 3.3.0.13 and we’re using the Acron plugin.

The reject folder is the other one that has logs in it… we tried moving all those logs to the stage folder, and manually ran the scheduletask but it didn’t change anything, the logs end up in the reject folder.

We’re not doing any override to the base URL :confused:

The apache error log doesn’t shown any error when we manually run the scheduletask nor when the cron runs every night.

Best,
Juan

Hi @Juan_Lopez,

Hmmm…
If the log files are in the reject folder, it could be that the processing script is for some reason not able to open and read the log file, or if a log file entry is not valid. The strange thing is that in any case the error message should be logged (in the scheduledTaskLogs/Usagestatisticsfileloadertask....log file) and you do not see any error message, right? :thinking: :woman_shrugging:
Hmmm… Because the log files are created correctly I would think that your access rights on the files and usageStats/ folder are correct… Could you double check it? The web user should be able to create a log file, to read and write it.
Do you have a cron job that runs the UsageStatsLoader scheduled task?
Have you maybe tested it with only one file – e.g. to copy only one log file from reject into the stage or usageEventLogs folder – and you still do not see any errors, neither in the scheduledTaskLogs folder nor in Apache error log file?

:woman_shrugging:
Bozana