No statistics available

No statistics available

by Oliver Smitkowski -
Number of replies: 2
Hi all,
 
I just realized there are no statistics available on our moodle 4.2.1 website. All I get is "Sorry, there is no available data to display" and a link to the docs. This is true for the site statictics (/report/stats/index.php) as well as for the individual course statictics (/report/stats/index.php?course=<id>).

This is what I checked:

  • Statistics have been enabled since yesterday (enablestats on admin/settings.php?section=optionalsubsystems).
  • All options are set to default (statsfirstrun, statsmaxruntime, statsruntimedays, and statsuserthreshold on admin/settings.php?section=stats).
  • The job "Background processing for statistics" (\core\task\stats_cron_task) ran at midnight for 35 seconds (success; 59 reads; 16s writes). I also ran it manually two hours ago from /admin/tool/task/scheduledtasks.php (success; 0 reads; 4 writes).
The docs mention a potential problem with missing files in the moodle/mod folder. I'm not sure what "If you find any, they should be deleted" means exactly. I don't see any messages about missing files in the browser window, however.
 
There are log entries for each course going back several months. The cronjob should generate statistics from these entries, right?
 
Thanks
Oliver
Average of ratings: -
In reply to Oliver Smitkowski

Re: No statistics available

by Brian Dan -

Ensure that the required statistics tables in your Moodle database are set up correctly. Sometimes, missing or corrupted tables can lead to this issue.
Verify that there’s enough recent activity in your courses to generate meaningful statistics. Since you mentioned months of log entries, there should be enough data, but it’s good to double-check.
Since you’ve already run the stats cron job manually, make sure that it’s scheduled to run at an appropriate frequency in your site’s cron settings.
Look into the Moodle logs for any errors or warnings related to statistics processing. That might give you more context on what’s going wrong.
The mention of missing files usually refers to certain plugins or modules that may not be fully installed or could be corrupt. Check if all standard Moodle modules are present in your /mod folder.

Average of ratings: Useful (1)
In reply to Brian Dan

Re: No statistics available

by Oliver Smitkowski -
Thank you! We did all the things you recommend back in May. That didn't seem to help at first, but a few days or weeks after my original post, statistics going back four weeks were available. Since then we have not looked at the issue, but now I have checked again: Stats are now available for the last five months. I've just changed statsfirstrun from three months to “none” and I'm curious to see if the time period will continue to grow.