Usage log reprocesse issue / ojs 3.3.0.-14

Hi all

We try to reprocesse some usage log files by moving it back to the stage folder.

The command
php tools/runScheduledTasks.php plugins/generic/usageStats/scheduledTasks.xml

then generates following fatal error:

PHP Fatal error:  Uncaught Error: Call to a member function getCategory() on null in /var/www/ojs/plugins/generic/usageStats/UsageStatsLoader.inc.php:513
Stack trace:
#0 /var/www/ojs/plugins/generic/usageStats/UsageStatsLoader.inc.php(459): UsageStatsLoader->getOJSAssoc()
#1 /var/www/ojs/plugins/generic/usageStats/UsageStatsLoader.inc.php(174): UsageStatsLoader->getAssoc()
#2 /var/www/ojs/lib/pkp/classes/task/FileLoader.inc.php(167): UsageStatsLoader->processFile()
#3 /var/www/ojs/plugins/generic/usageStats/UsageStatsLoader.inc.php(127): FileLoader->executeActions()
#4 /var/www/ojs/lib/pkp/classes/scheduledTask/ScheduledTask.inc.php(146): UsageStatsLoader->executeActions()
#5 /var/www/ojs/lib/pkp/classes/cliTool/ScheduledTaskTool.inc.php(111): ScheduledTask->execute()
#6 /var/www/ojs/lib/pkp/classes/cliTool/ScheduledTaskTool.inc.php(95): ScheduledTaskTool->executeTask()
#7 /var/www/ojs/lib/pkp/classes/cliTool/ScheduledTaskTool.inc.php(67): ScheduledTaskTool->parseTasks()
#8 /var/www/ojs/tools/runScheduledTasks.php(34): Schedul in /var/www/ojs/plugins/generic/usageStats/UsageStatsLoader.inc.php on line 513

We have problems to resolve it. Thanks.
jan

The stack trace indicates that an article file is assigned an id for a genre (Article Component) which no longer exists in the database.

If you have access to the database via SQL to perform a query, you could try:
SELECT DISTINCT genre_id FROM submission_files WHERE genre_id NOT IN (SELECT genre_id FROM genres);

This would allow you to scope how many missing genres you might be dealing with.