Problem with statistics

I have a problem with statistics.
The version, that was installed, is 2.4.3, and I have never updated.
Acron and usageStats are enabled. Base_url is correct in config.inc.php.

I have statistics only for some days, which is stored in the table “metrics”. The metric type in the table “metrics” is ojs::counter, other metrics are not. Also, the successfully processed log files of these days are located in the archive folder.

I checked other folders and discovered that there are a lot of files in the stage folder from 2014 to 2019 years. 19
In the processing folder there is one file “usage_events_20181110.log” and it doesn’t move neither reject nor archive folders. UsageEventLogs folder contains single log file for current day. Reject folder is empty.

I turned on scheduled_tasks in the config.inc.php.
I can’t analyze what happened because I don’t have any schedules task logs in scheduledTaskLogs starting with Usagestatisticsfileloadertask…
03
The table “usage_stats_temporary_records” is not empty. It contains 665 rows of these logs:
17
The table “scheduled_tasks” is
45
The date of last_run is 2019-07-11 that is today (when I am writing).
Also, I executed the query to the table “plugin_settings” and gave the following result:
22

I don’t know what I have to do. What should I do to get the correct statistics?
Thank you.

If en_US is not your primary locale, the logfile in scheduledTasksLogs will be named in your primary locale. This may explain why you are not finding “Usagestatisticsfileloadertask…” files.

If you have no (or no recent) files in the scheduledTaskLogs folder, check your file permissions to ensure your web process can write to this location during the acron run.

If the process is not currently running, you can safely clear the usage_stats_temporary_records table and move the file from the “processing” folder back into the “stage” folder. At the next run, the Usage Stats File Loader task will try to reprocess the file(s) from the “stage” folder and from the “usageEventLogs” folder.

To force that run to happen sooner, remove the “last_run” value from the “plugins.generic.usageStats.UsageStatsLoader” row in the scheduled_tasks table.

Thank you for your advice.

Permission of the “usageState” folder and its subfolders is 775.
I have a question. Should I create the scheduledTaskLogs folder, or this folder is created automatically by system?

I moved the log file from the “processing” folder to the “stage” folder. Then, I deleted all from the “usage_stats_temporary_records” table and removed the “last_run” value from the “plugins.generic.usageStats.UsageStatsLoader” row in the “scheduled_task” table.

I achieved the following results.
The “usage_stats_temporary_records” table was updated, the new row with load_id = “usage_events_20181211.log” was added in this table. Also, this “usage_events_20181211.log” log file was moved from the “stage” folder to the “processing” folder. The DB table “metrics” was updated by statistics from “usage_events_20181211.log” log file.

Other log files, which are located in the “stage” folder, stay in this folder.

The system should have created the “scheduledTaskLogs” folder, directly within your files_dir. This should be writable via the same permissions which your other subfolders of files_dir are writable. (Note that just the permissions mode is not enough to ensure the folder is writable - this also depends on file ownership and possibly other PHP or system permissions.) If the “scheduledTaskLogs” folder does not exist in your files_dir, you will need to recreate it. The log files created there should processing errors on the usage_events_20181211.log file. If processing had succeeded, it would be moved from the “processing” folder to the “archive” folder. If a fatal PHP error has occurred (which sounds likely) this error will be written into your webserver’s PHP error log. Check this log for more details (ignoring PHP Notice and PHP Deprecated warnings, if you have not disabled these).

Now, the new created log file was moved from the “processing” folder to the “achive” folder. But in the DB table “metrics” there isn’t this log file.

Why didn’t the “metrics” table update?

What messages do you find in the corresponding “Usagestatisticsfileloadertask…” (or translation thereof) log files in the scheduledTaskLogs directory?

I don’t have the scheduledTaskLogs directory.

You will need to create that directory within your files_dir. It will need to be writable by the web process; generally use the same strategy applied to your files_dir, “cache” and “public” directories.

With the “scheduledTaskLogs” folder re-created and writable, you will see logs indicating the success or failure of your scheduled tasks.