[OJS] Error in Scheduled Tasks an not show metrics


I have had an error for almost a month since the Usage Stats are not shown and remain in the stage phase.


I have the Acron plugin enabled and also when I try to run php tools/runScheduledTasks.php plugins/generic/usageStats/scheduledTasks.xml, after a while, it shows me the following error:

PHP Fatal error:  Uncaught Error: Call to a member function getData() on null in /lib/pkp/classes/submission/Representation.inc.php:134
Stack trace:
#0 /lib/pkp/classes/statistics/PKPMetricsDAO.inc.php(378): Representation->getContextId()
#1 /classes/statistics/MetricsDAO.inc.php(47): PKPMetricsDAO->foreignKeyLookup(515, 246408)
#2 /lib/pkp/classes/statistics/PKPMetricsDAO.inc.php(284): MetricsDAO->foreignKeyLookup(515, 246408)
#3 /plugins/generic/usageStats/UsageStatsLoader.inc.php(823): PKPMetricsDAO->insertRecord(Array)
#4 /plugins/generic/usageStats/UsageStatsLoader.inc.php(228): UsageStatsLoader->_loadData('usage_events_20...')
#5 /lib/pkp/classes/task/FileLoader.inc.php(167): UsageStatsLoader->processFile('/datos/usageSta...')
#6 /lib/pkp/classes/submission/Representation.inc.php on line 134

And also shows me:

Undefined offset: 254 in /plugins/generic/usageStats/lib/geoIp/geoipcity.inc on line 146

Hi @asmecher and @bozana,

Could you help me with this problem?

Hi @rcgillis,

Can someone help me with this problem?