I have some problems with the statistics. I am using OJS 2.4.4.1 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?
Hmmm…
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?
Hmmm…
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.
Here are some last rows from both tables (it is not possible to upload xlsx files):
metrics
load_id assoc_type context_id issue_id submission_id assoc_id day month file_type country_id region city metric_type metric
|usage_events_20171004.log|260|8|491|5355|4976|20171004|201710|2|NULL|0|NULL|ojs::counter|1|
Sorry for the delay… I somehow lost the tracking of this thread…
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-…