I’m having an issue with OJS 3.5.0‑1 where usage statistics are not being updated.
Main symptom
-
Article and issue statistics remain at 0, even though the journal is being visited.
-
The usage stats pipeline does not complete: log files are moved into
usageStats/dispatch, but no new files appear inusageStats/archiveand no new metrics are written to the database.
usageStats directory structure and behaviour
-
usageStats/archive: contains only older log files (e.g. up to a certain date such as 22/12). No new log files have been moved here since that date. -
usageStats/dispatch: contains manyusage_events_YYYYMMDD.logfiles (including recent days) that never leave this directory. -
usageStats/usageEventLogs: contains only today’s file; files from previous days have been moved todispatch. -
The other directories (
processing,reject,stage) are empty or show no recent activity. -
File permissions under
usageStatsallow the PHP user to read and write.
Task scheduler / jobs
-
The task scheduler is enabled and appears to be working.
-
When I run:
bashphp lib/pkp/tools/scheduler.php testit offers
APP\tasks\UsageStatsLoaderin the menu. -
Running it produces output like:
bash┌ Qual comando você gostaria de executar? ─────────────────────┐
│ APP\tasks\UsageStatsLoader │
└──────────────────────────────────────────────────────────────┘Running [APP\tasks\UsageStatsLoader] ........................................ 5–8ms DONE -
The job finishes with status DONE in a few milliseconds, but no files are moved from
dispatchtoarchiveand no new metrics appear.
Temporary table usage_stats_total_temporary_records
-
The table exists and is currently empty:
sqlSELECT*FROMusage_stats_total_temporary_records;
-- returns 0 rows -
The first column is:
-
usage_stats_temp_total_id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT -
It is the primary key and has AUTO_INCREMENT set in the “Extra” field.
-
-
This means my schema does not match the issue where this column was missing AUTO_INCREMENT; that fix is not applicable here.
-
After running
APP\tasks\UsageStatsLoaderviascheduler.php test, the table still has 0 rows (no temporary records are inserted at all).
UsageStatsLoader code
-
classes/tasks/UsageStatsLoader.phphas the following implementation:phpnamespaceAPP\tasks;useAPP\jobs\statistics\CompileCounterSubmissionDailyMetrics;
useAPP\jobs\statistics\CompileCounterSubmissionInstitutionDailyMetrics;
useAPP\jobs\statistics\CompileIssueMetrics;
useAPP\jobs\statistics\CompileSubmissionGeoDailyMetrics;
useAPP\jobs\statistics\CompileUniqueInvestigations;
useAPP\jobs\statistics\CompileUniqueRequests;
useAPP\jobs\statistics\DeleteUsageStatsTemporaryRecords;
useAPP\jobs\statistics\ProcessUsageStatsLogFile;
usePKP\jobs\statistics\ArchiveUsageStatsLogFile;
usePKP\jobs\statistics\CompileContextMetrics;
usePKP\jobs\statistics\CompileSubmissionMetrics;
usePKP\jobs\statistics\RemoveDoubleClicks;
usePKP\site\Site;
usePKP\task\PKPUsageStatsLoader;classUsageStatsLoaderextendsPKPUsageStatsLoader
{
protectedfunctiongetFileJobs(string$filePath, Site $site):array
{
$logFileName = basename($filePath);
return[
newProcessUsageStatsLogFile($filePath, $logFileName),
newRemoveDoubleClicks($logFileName),
newCompileUniqueInvestigations($logFileName),
newCompileUniqueRequests($logFileName),
newCompileContextMetrics($logFileName),
newCompileIssueMetrics($logFileName),
newCompileSubmissionMetrics($logFileName),
newCompileSubmissionGeoDailyMetrics($logFileName),
newCompileCounterSubmissionDailyMetrics($logFileName),
newCompileCounterSubmissionInstitutionDailyMetrics($logFileName),
newDeleteUsageStatsTemporaryRecords($logFileName),
newArchiveUsageStatsLogFile($logFileName, $site),
];
}
} -
This file has not been manually modified.
-
VS Code shows a static warning on
ArchiveUsageStatsLogFile($logFileName, $site)(“Too many arguments”), but there is no runtime error; the scheduler reports DONE without any PHP error in the logs.
Environment
-
Application: OJS 3.5.0‑1.
-
PHP 8.3.
-
error_logis empty regarding this task (no notices, warnings, or errors whenUsageStatsLoaderruns). -
Cron is configured to call the scheduler regularly; other scheduled tasks run fine.
Questions
-
Are there any known issues or bugs in OJS 3.5.0‑1 that could cause usage stats log files to get stuck in
dispatchand never reacharchive, withAPP\tasks\UsageStatsLoaderfinishing as DONE but not inserting any rows intousage_stats_total_temporary_records? -
Is there a recommended way to debug the
UsageStatsLoaderpipeline in 3.5.0‑1 (for example, increasing log verbosity for the jobs/queue system, or running a specific jobs command with more verbose output) to see whether log parsing or job dispatch is failing silently? -
Is there a patch or commit in a newer 3.5.0‑x / 3.5.x release that addresses this kind of behaviour in the usage stats implementation, or any documented procedure to re‑process logs with the new jobs/queue‑based statistics system?
Note: I am a native Brazilian Portuguese speaker, and this text was drafted with the help of Perplexity AI to make sure I can explain the technical details clearly in English ![]()


