Missing statistics in OJS 2


I have some problems with the statistics. I am using OJS and have several publications on the same OJS. The problem is that for some publications there are statistics and for some not.

I have checked and I am sure the base_url-s are correct. Further on I have checked the files in the files directory:

  • there are files in the directories usageEventlogs, processing and stage with very recent files (today)

  • there are files in the directories reject and archived, but only until the December 2017

Any idea what can be wrong or how to investigate it further?

Regards, Primož

Hi @primozs

How do you exactly see that there are no statistics for some articles?

All older statistics log files should be in the folder archive. If they are in the folder reject, it means that something went wrong with processing of those files. You would need to figure out what went wrong and to eventually correct it. For that you would need to process them again and watch after the error/warning message in the appropriate scheduled log files.

How do you run the scheduled tasks? Do you use a cron job or the Acron plugin?

The statistics should be processed daily and just when processing they are moved to the stage and then to the processing folder.

So, it seems like all statistics files are there, but not all were processed successfully. How many files are in the reject folder?
Else, the URLs in those log files are correct i.e. the same as base_url?
What about the DB table metrics? Do the entries there correspond with those files that are in the folder archives? Do you see any entries there for those articles that you said have no statistics?


Hi @bozana

Thank you for help. If I go to:

  • “View Report”
  • “Timed Views Report” with unchecked checkbox for old plugin
  • “Timed Views Report” with checked box for old plugin

I get a cvs file with only header line and no data. That is why I consider statistics are missing.

We are using Acron plugin.

The processing folder contains one file, with today change date, but all entries in it are from 2017-06-28.

The stage folder contains many files (one per day?) with dates up to today. I have checked and the entries in those files look OK (URLs, dates,…).

Best regards, Primož

Hi @primozs

It seems like your log files cannot be processed for some reason…
But before we try to process them again while watching in the scheduled task log files for errors, could you see how your DB table metrics and usage_stats_temporary_records look like?
And maybe to also double check if there is the entry with plugins.generic.usageStats.UsageStatsLoader in your DB table scheduled_tasks and what is the last_run date there.


Hi @bozana,

Here is the info about the execution:

plugins.generic.usageStats.UsageStatsLoader: last_run = 2018-03-27 22:14:34

Here are some last rows from both tables (it is not possible to upload xlsx files):


load_id	assoc_type	context_id	issue_id	submission_id	assoc_id	day	month	file_type	country_id	region	city	metric_type	metric



assoc_id assoc_type day metric country_id region city load_id file_type entry_time



I hope you find something.

Best regards, Primož

Hi @bozana,

Did you have a chance to look into the provided data? Should I provide any more data?

Best regards, Primož

Hi @primozs

Sorry for the delay… I somehow lost the tracking of this thread… :frowning:
Hmmm… There are some values in your DB table metrics, so you should see something in the reports. Maybe the views and timedView reports do not consider the metric type ojs::counter, but the older OJS metrics (the default OJS view and from the timed views plugin). Do you also have “Generate custom report” option on the “Stats & Reports” page i.e. do you get any values in the report there?
It seems that the files were processed long time ago. Also, it seems like the scheduled tasks is triggered correctly.
Maybe to try to process a few old files, one by one… and try to figure out why the processing is not successful…
Backup your files folder first!!!
Then move all files from processing, reject and stage folder somewhere else, so that these folders are empty. Leave only two files in the usageEventLogs folder: take one/next old file that could not be processed and leave the most recent file (from today) there – the most recent file from today should stay there to log the current accesses.
Double check your permissions on the files folder and the subfolders usageStats and scheduledTaskLogs – the user or group your application is running under (web user/group) should be able to create and move (copy and delete) files there.
Then remove the entry from your DB table scheduled_tasks with plugins.generic.usageStats.UsageStatsLoader.
Then access an article page and watch your server PHP error log file and see what happened with those files from the usageEventLogs folder. Copy the file from today back again into that folder – it should stay there to log the current accesses. What happened with the old file, was it processed correctly (is there an entry for that file in the DB table metrics and is the file in the archive folder)? See, especially if the file(s) were not processed correctly, the last/current file in the scheduledTaskLogs starting with something like Usagestatisticsfileloadertask-


Hi @bozana

No problem, I appreciate your help even if I wait a little bit :slight_smile:

I have several journals on the OJS and it is interesting that I get some reports for some journals:

  • one journal has views report as well as custom report, but seems data is up to few years ago
  • one journal has nothing in views report , but there is data in custom report, seems like also from later time then from the above journal
  • one journal has no data in views nor in custom report
    Is that interesting for you too?

Maybe to try to process a few old files, one by one… and try to figure out why the processing is not successful…

If you can let me know how to to that I will give a try. Are that the lines following?

Best regards, Primož

Hi @primozs

Yes, that would be the lines following. Let me know if you have any questions or …

Lets then first see what is happening with file processing, then we will see further…