Could someone please take a look and see if you can figure out why my STATS aren't running.

Ok,
One of the things that I would check first is to ensure that you have the timezone setup in your php.ini. In the Date section find the line ;date.timezone =, you will want to uncomment it by removing the semi-colon from the front of it and set it to the timezone that you have set in Administration > Locations. The line in your ini file should look like this date.timezone ='American/Denver' Make sure that you keep the single quotes or it won't work.
Scott Karren
Running daily statistics gathering, starting at 1210482000: ................ finished until 1210568400: Monday, 12 May 2008, 12:00 (in 1 s) ................ finished until 1210654800: Tuesday, 13 May 2008, 12:00 (in 1 s) ................ finished until 1210741200: Wednesday, 14 May 2008, 12:00 (in 1 s) ................ finished until 1210827600: Thursday, 15 May 2008, 12:00 (in 1 s) ................ finished until 1210914000: Friday, 16 May 2008, 12:00 (in 0 s) ................ finished until 1211000400: Saturday, 17 May 2008, 12:00 (in 1 s) ................ finished until 1211086800: Sunday, 18 May 2008, 12:00 (in 0 s) ................ finished until 1211173200: Monday, 19 May 2008, 12:00 (in 1 s) ................ finished until 1211259600: Tuesday, 20 May 2008, 12:00 (in 1 s) ................ finished until 1211346000: Wednesday, 21 May 2008, 12:00 (in 0 s) ................ finished until 1211432400: Thursday, 22 May 2008, 12:00 (in 1 s) ................ finished until 1211518800: Friday, 23 May 2008, 12:00 (in 0 s) ................ finished until 1211605200: Saturday, 24 May 2008, 12:00 (in 0 s) ................ finished until 1211691600: Sunday, 25 May 2008, 12:00 (in 1 s) ................ finished until 1211778000: Monday, 26 May 2008, 12:00 (in 1 s)
Hello!
We are having the same problem, statistics from september 20th are not working anymore "there is no data". I have the cron.php not working and have to execute it myself.
Up until then the statistics are all recorded and working perfectly when asked into the system. We are running Moodle 1.8.
They used to work perfectly, until apparently the users table got problems and I had to Repair it, and the table works fine since then; but following to that (I do not know if it is related or not) statistics are not being recorded.
Can anyone help us?
Thanks a lot
We are experiencing a similar thing on our new Moodle 1.9 built over the summer with the addition of 1.8 courses through the backup process.
I can see 4 week old statistics but nothing within the last two weeks, I can see all the logs it's just the statistics that aren't working
Our error message say " Statistics is currently in catchup mode. So far 22 day(s) have been processed and 20 are pending. Check back soon!"
Hope you can help?
I tried Chistopher's solution, but still get this error that the end of http://mysite.org/admin/cron.php
<!--StartFragment-->Running auth crons if required...
...preventing stats to run, last execution was less than 20 hours ago.
Cron script completed correctly
Execution took 18.531617 seconds
Can anyone shed some light on this?
TIA,
Eric
How do I set those to 0:
mysql> select * from mdl_config where name like '%stats%';
+------+----------------------------+------------+
| id | name | value |
+------+----------------------------+------------+
| 42 | enablestats | 1 |
| 103 | statsfirstrun | 604800 |
| 104 | statsmaxruntime | 0 |
| 105 | statsuserthreshold | 0 |
| 127 | statsruntimestarthour | 0 |
| 128 | statsruntimestartminute | 45 |
| 229 | statsfirstrunlock | 0 |
| 231 | statslastdaily | 1261465200 |
| 232 | statslastweekly | 1257663600 |
| 233 | statslastmonthly | 1257055200 |
| 269 | statsrolesupgraded | 1175719586 |
| 414 | statscatdepth | 4 |
| 961 | statsruntimedays | 31 |
| 1000 | coursereport_stats_version | 2007101501 |
| 1004 | statslastexecution | 1266911110 |
| 1115 | statsrunning | 1266912515 |
+------+----------------------------+------------+
Starting activity modules
Processing module function assignment_cron ...done.
Processing module function forum_cron ...Starting digest processing...
Cleaned old digest records
done.
Processing module function journal_cron ...done.
Processing module function workshop_cron ...done.
Finished activity modules
Starting blocks
Processing cron function for rss_client....
http://youngentrepreneurfoundation.wordpress.com/feed/ ok
http://dansmath.libsyn.com/rss ok
http://history360.blogspot.com/atom.xml ok
http://www.pbs.org/teachersource/learning.now/rss2/index.xml ok
http://moodletraining.blogspot.com/atom.xml ok
http://www.speedofcreativity.org/feed/ ok
http://feeds.feedburner.com/netfamilynews/MmPS?forss.xml ok
http://www.sciencedaily.com/rss/newsfeed.xml ok
http://sciencenow.sciencemag.org/rss/current.xml ok
http://speakingofhistory.blogspot.com/feeds/posts/default ok
Technology club
Next execution: Thursday, 25 February 2010, 02:00 AM
Classroom MGT 101
Next execution: Thursday, 25 February 2010, 02:00 AM
Informal Geometry-High School
Next execution: Thursday, 25 February 2010, 02:00 AM
Spanish II
Next execution: Thursday, 25 February 2010, 02:00 AM
Spanish I
Next execution: Thursday, 25 February 2010, 02:00 AM
English 2 - Masterton
Next execution: Thursday, 25 February 2010, 02:00 AM
Pre-Calculus/Trigonometry-- Parker
Next execution: Thursday, 25 February 2010, 02:00 AM
M.Smith Math Courses
Next execution: Thursday, 25 February 2010, 02:00 AM
Geometry - Webb
Next execution: Thursday, 25 February 2010, 02:00 AM
Heads Up! Reading
Next execution: Thursday, 25 February 2010, 02:00 AM
921834
SKIPPING - hidden+unmodified
Next execution: Thursday, 25 February 2010, 02:00 AM
Geometry
Next execution: Thursday, 25 February 2010, 02:00 AM
Pre-Algebra
SKIPPING - hidden+unmodified
Next execution: Thursday, 25 February 2010, 02:00 AM
College Composition Nolting
Next execution: Thursday, 25 February 2010, 02:00 AM
Algebra I - Busby
Next execution: Thursday, 25 February 2010, 02:00 AM
Geometry - GSmith
Next execution: Thursday, 25 February 2010, 02:00 AM
US History 500
Next execution: Thursday, 25 February 2010, 02:00 AM
Character Education 101
Next execution: Thursday, 25 February 2010, 02:00 AM
Chemistry
Next execution: Thursday, 25 February 2010, 02:00 AM
English 9
Next execution: Thursday, 25 February 2010, 02:00 AM
Biology
Next execution: Thursday, 25 February 2010, 02:00 AM
Graphics Design
Next execution: Thursday, 25 February 2010, 02:00 AM
Geometry-keep
Next execution: Thursday, 25 February 2010, 02:00 AM
Accounting 1 Keep
Next execution: Thursday, 25 February 2010, 02:00 AM
Cisco CCNA Discovery (1): Networking for Home and Small Businesses
Next execution: Thursday, 25 February 2010, 02:00 AM
Blended Learning Environments
Next execution: Thursday, 25 February 2010, 02:00 AM
Natural Science 2
Next execution: Thursday, 25 February 2010, 02:00 AM
VALTS US History (KM)
Next execution: Thursday, 25 February 2010, 02:00 AM
Emergency Medical Technician
Next execution: Thursday, 25 February 2010, 02:00 AM
Language Arts I
Next execution: Thursday, 25 February 2010, 02:00 AM
Think Globally....Act Locally
SKIPPING - hidden+unmodified
Next execution: Thursday, 25 February 2010, 02:00 AM
Entrepreneurship
Next execution: Thursday, 25 February 2010, 02:00 AM
Cisco CCNA Discovery (2): Working at a Small-to-Medium Business or ISP
Next execution: Thursday, 25 February 2010, 02:00 AM
Spanish III
Next execution: Thursday, 25 February 2010, 02:00 AM
8th Grade Careers
SKIPPING - hidden+unmodified
Next execution: Thursday, 25 February 2010, 02:00 AM
VALTS English Quarter 3 Winter 2010
Next execution: Thursday, 25 February 2010, 02:00 AM
US History (Semester 2: 2009-2010)
Next execution: Thursday, 25 February 2010, 02:00 AM
World History (Semester 2: 2009-2010)
Next execution: Thursday, 25 February 2010, 02:00 AM
Advanced Environmental Science Spring '10
Next execution: Thursday, 25 February 2010, 02:00 AM
General Biology Spring '10
Next execution: Thursday, 25 February 2010, 02:00 AM
Algebra 1A Spring 2010
Next execution: Thursday, 25 February 2010, 02:00 AM
Crawford High School Principal Information
Next execution: Thursday, 25 February 2010, 02:00 AM
Vet Science
Next execution: Thursday, 25 February 2010, 02:00 AM
Small Animal Care and Management
Next execution: Thursday, 25 February 2010, 02:00 AM
High School Vocal Music
Next execution: Thursday, 25 February 2010, 02:00 AM
Rhodes Weights and Fitness
Next execution: Thursday, 25 February 2010, 02:00 AM
Girls Physical Education
Next execution: Thursday, 25 February 2010, 02:00 AM
Gering Alternative Program
Next execution: Thursday, 25 February 2010, 02:00 AM
Guidance 12 Grade Timeline
Next execution: Thursday, 25 February 2010, 02:00 AM
Electronics
Next execution: Thursday, 25 February 2010, 02:00 AM
ART II, Cook
Next execution: Thursday, 25 February 2010, 02:00 AM
Mr Sulu - Spanish 1
Next execution: Thursday, 25 February 2010, 02:00 AM
Automotive Technology 1
Next execution: Thursday, 25 February 2010, 02:00 AM
9TH Grade Welding
Next execution: Thursday, 25 February 2010, 02:00 AM
Sra. Vohland Spanish II
Next execution: Thursday, 25 February 2010, 02:00 AM
Auto Cad 1
Next execution: Thursday, 25 February 2010, 02:00 AM
Boys 10th Grade Physical Education
Next execution: Thursday, 25 February 2010, 02:00 AM
High School Instrumental Music
Next execution: Thursday, 25 February 2010, 02:00 AM
9th Grade Computers
Next execution: Thursday, 25 February 2010, 02:00 AM
Spanish IV
Next execution: Thursday, 25 February 2010, 02:00 AM
Guidance 12 Grade Timeline
Next execution: Thursday, 25 February 2010, 02:00 AM
Welding 1
Next execution: Thursday, 25 February 2010, 02:00 AM
Advanced Auto technology
Next execution: Thursday, 25 February 2010, 02:00 AM
Crawford PBS
Next execution: Thursday, 25 February 2010, 02:00 AM
Technology B2
Next execution: Thursday, 25 February 2010, 02:00 AM
Art III
Next execution: Thursday, 25 February 2010, 02:00 AM
Art IV
Next execution: Thursday, 25 February 2010, 02:00 AM
Physical Science
Next execution: Thursday, 25 February 2010, 02:00 AM
Freshman Regional Studies
Next execution: Thursday, 25 February 2010, 02:00 AM
Mrs. Trautman's Math 2
Next execution: Thursday, 25 February 2010, 02:00 AM
American Government
Next execution: Thursday, 25 February 2010, 02:00 AM
Introduction to Law
Next execution: Thursday, 25 February 2010, 02:00 AM
Transition Issues I
Next execution: Thursday, 25 February 2010, 02:00 AM
Physiology 1
Next execution: Thursday, 25 February 2010, 02:00 AM
International Relations
Next execution: Thursday, 25 February 2010, 02:00 AM
Transition Issues II
Next execution: Thursday, 25 February 2010, 02:00 AM
Mrs. Trautman's Math 3
Next execution: Thursday, 25 February 2010, 02:00 AM
Physiology 2
Next execution: Thursday, 25 February 2010, 02:00 AM
Work Experience
Next execution: Thursday, 25 February 2010, 02:00 AM
Mrs. Trautman's Math 4
Next execution: Thursday, 25 February 2010, 02:00 AM
English 9A(HS)
Next execution: Thursday, 25 February 2010, 02:00 AM
English 10A (HS)
Next execution: Thursday, 25 February 2010, 02:00 AM
English 10B (HS)
Next execution: Thursday, 25 February 2010, 02:00 AM
English 9B (HS)
Next execution: Thursday, 25 February 2010, 02:00 AM
Advanced Mathematics
Next execution: Thursday, 25 February 2010, 02:00 AM
Mrs. Gable Family and Consumer Sciences
Next execution: Thursday, 25 February 2010, 02:00 AM
Beyond the Basics Sign Language
Next execution: Thursday, 25 February 2010, 02:00 AM
US History Demo Unit
Next execution: Thursday, 25 February 2010, 02:00 AM
Consumer Math
Next execution: Thursday, 25 February 2010, 02:00 AM
Koenen-High scchool General English
Next execution: Thursday, 25 February 2010, 02:00 AM
Quadratics
Next execution: Thursday, 25 February 2010, 02:00 AM
Sociology
Next execution: Thursday, 25 February 2010, 02:00 AM
Language Arts I
Next execution: Thursday, 25 February 2010, 02:00 AM
Psychology
Next execution: Thursday, 25 February 2010, 02:00 AM
Comparative Religion
Next execution: Thursday, 25 February 2010, 02:00 AM
United States History
Next execution: Thursday, 25 February 2010, 02:00 AM
Western Civilization II
Next execution: Thursday, 25 February 2010, 02:00 AM
Accordian Example
Next execution: Thursday, 25 February 2010, 02:00 AM
Online Learning Professional Development
Next execution: Thursday, 25 February 2010, 02:00 AM
Current Global Issues
Next execution: Thursday, 25 February 2010, 02:00 AM
Environmental Science
Next execution: Thursday, 25 February 2010, 02:00 AM
Matt McKay- Earth Science
Next execution: Thursday, 25 February 2010, 02:00 AM
American Government
Next execution: Thursday, 25 February 2010, 02:00 AM
Manage Your Money!
Next execution: Thursday, 25 February 2010, 02:00 AM
American History 8
Next execution: Thursday, 25 February 2010, 02:00 AM
Intro to Family and Consumer Sciences
Next execution: Thursday, 25 February 2010, 02:00 AM
NEVA Course Format Ideas
Next execution: Thursday, 25 February 2010, 02:00 AM
External Web 2.0 Tools
Next execution: Thursday, 25 February 2010, 02:00 AM
9th Basic Math - Busby
Next execution: Thursday, 25 February 2010, 02:00 AM
Backup tasks finished.
Running rssfeeds if required...
Generating rssfeeds...
assignment: ...NOT SUPPORTED (file)
chat: ...NOT SUPPORTED (file)
choice: ...NOT SUPPORTED (file)
data: generating ...OK
forum: generating Updating RSS feed for Discussion on Interview Techniques (Quiz Grade) , ID: 399
Updating RSS feed for A Standard forum for general use, ID: 451
Updating RSS feed for A Standard forum for general use, ID: 499
Updating RSS feed for Unit forum, ID: 523
Updating RSS feed for Unit forum, ID: 524
Updating RSS feed for Unit forum, ID: 533
Updating RSS feed for A Standard forum for general use, ID: 999
...OK
glossary: generating ...OK
hotpot: ...NOT SUPPORTED (file)
journal: ...NOT SUPPORTED (file)
label: ...NOT SUPPORTED (file)
lams: ...NOT SUPPORTED (file)
lesson: ...NOT SUPPORTED (file)
quiz: ...NOT SUPPORTED (file)
resource: ...NOT SUPPORTED (file)
scorm: ...NOT SUPPORTED (file)
survey: ...NOT SUPPORTED (file)
wiki: ...NOT SUPPORTED (file)
workshop: ...NOT SUPPORTED (file)
feedback: ...NOT SUPPORTED (file)
dimdim: ...NOT SUPPORTED (file)
attforblock: ...NOT SUPPORTED (file)
elluminate: ...NOT SUPPORTED (file)
Ending rssfeeds......OK
Rssfeeds finished
Running auth crons if required...
...preventing stats to run, more than 4 hours since scheduled time.
Cron script completed correctly
Execution took 7.891609 seconds
Some of the values are still 0. Is this correct, should they still be 0?
Moodle 1.9.5 (Build: 20090515)
+------+----------------------------+------------+
| id | name | value |
+------+----------------------------+------------+
| 42 | enablestats | 1 |
| 103 | statsfirstrun | all |
| 104 | statsmaxruntime | 14400 |
| 105 | statsuserthreshold | 0 |
| 127 | statsruntimestarthour | 0 |
| 128 | statsruntimestartminute | 45 |
| 229 | statsfirstrunlock | 0 |
| 231 | statslastdaily | 1261983600 |
| 232 | statslastweekly | 0 |
| 233 | statslastmonthly | 0 |
| 269 | statsrolesupgraded | 1175719586 |
| 414 | statscatdepth | 1 |
| 961 | statsruntimedays | 31 |
| 1000 | coursereport_stats_version | 2007101501 |
| 1004 | statslastexecution | 1267429513 |
| 1115 | statsrunning | 1267445276 |
+------+----------------------------+------------+
Hi Eric
Was wondering did you ever get this issue fixed. Im having the same problem.
Need to have a report done on moodle within the next week. I have tried the suggestions above but nothing seems to work.
I have 442 day to process only 96 were done. It stays at 96 all the time.
Hi, I acctivated my statistics some time back but I still get the message that there are no stats avaiblable.
I am in Moodle 2.0.2, the table names match the ones mentioned above but not the field names mentioned in the mdl_config that need to be put to 0.
Can anyone help?
FINAL SOLUTION:
to get statistics working 100% follow these steps:
1) open the file : moodle/lib/statslib.php and scroll down around line 90: and comment out the statements from :
if (isset($CFG->statslastexecution) and ((time() - 20*60*60) < $CFG->statslastexecution))
to the statement :
set_config('statslastexecution', time());
the last statement must be included (do not comment it)
2) go to Server->Statistics and enure that:
Statistics are enabled
Max Processing Interval: All
Max Runtime: until complete
Days to Process: (put any large number, for me I put 1000)
Run At: (set the clock for the current time)
and leave other settings as they are.
3) log in as admin and open the URL: /moodle/admin/cron.php
and wait until processing completes (it may take from minutes to several hours depending on site traffic)
4) go to : reports -> statistics -> and choose whatever you want, then submit, then enjoy the graph.
important note: this walkthrough is for people who want to see statistics effect right now, and how the graph and logs will look like, however, it's not a recommended approach for a heavy traffic moodle site.
Thanks Murad,
For this detailed resolution. FInally it works.
cheers,
jaswant
i already follow step by step but it still having problem.error message that appear
"There is no available data for that combination of course and time period."
Please help me.I really need this statistic for my report to my superior.
if you really followed my approach above exactly, the stats must work for you ...
if it did not work, that means, nobody tried to login or use your moodle site at all, that's why there is no stats ...
@Fedora, if your cron.php page has problems finishing some tasks, open admin/cron.php file, and comment lines between two mtrace statements for the same job, you can comment all mtrace statements and leave the mtrace statemtment that belongs to statistics as is, if you do so, when you open the cron page from browser the statistics job will only work and any other cron jobs will be ignored
Rechecked our MOODLE version it is 1.99.10. Statistics has been enabled but processing is not occurring.
Enable statisticsenablestats
@Justin, your question is not clear ... however, if you want to get statistics working try the solution above .. titled "Final Solution" ...
Thanks Murad, will try it out and see what happens. WIll let you know the result.
Hi Murad
We tried the solution you gave. Unfortuantely, still not working, and giving the same pink box message. "Sorry there is no available data to display." Any ideas?
Thanks Justin
Hi Murad
Tried your suggestion. I have gone through the logs for my course. We are only getting activity report hits, live logs, but no stats still. Our version is 1.99.10.
Any other ideas?
ok ...
did you try the second suggestion mentioned above, here it is:
"
@Fedora, if your cron.php page has problems finishing some tasks, open admin/cron.php file, and comment lines between two mtrace statements for the same job, you can comment all mtrace statements and leave the mtrace statemtment that belongs to statistics as is, if you do so, when you open the cron page from browser the statistics job will only work and any other cron jobs will be ignored"
if this does not work for you, give me admin access to your moodle site and FTP access to code (in a private message here), and I will run the statistics for you in minutes.
The "FINAL SOLUTION" above worked for me. There is an if, else if, else statement that says
So if the cron job has never been run before it gets caught up in this statement. Simply commenting out the if statement (lines 120-129 in Moodle 2.0 lib/statslib.php) and leaving the statment:
set_config('statslastexecution', time()); /// Grab this execution as last one
un commented, it will run for the first time witout issue. I have yet to test if it will run on its own after the first time if I uncomment the code that I commented.
P.S. I ended up setting up a cron job on my server to handle cron.php
if your server has met the criteria of the IF ELSEIF ELSE block listed above it must run on its own after the first time ... if It didn't run, please post the problem here ..
I got the same problem with a clean install of 1.9.10 + direct upgrade to 1.9.13.
I have logged in as a student, made some quizes and after that ran the statistics. Statistic tables are filled with some data. However, I recieve the Sorry, there is no available data to display as well.
Stack trace:
look at the "FINAL SOLUTION" reply above ...
Hi, I am on 2.0.3 and my statistics aren't working.
They are enabled.
I did the DB check and get all the ok's as above (see below):
mdl_stats_daily check status OK
mdl_stats_monthly check status OK
mdl_stats_user_daily check status OK
mdl_stats_user_monthly check status OK
mdl_stats_user_weekly check status OK
mdl_stats_weekly check status OK
mdl_log check status OK
But I do not have the following fields in my DB; statsfirstrunlock, statslastdaily, statsruntimestarthour, and statsruntimestarminute, so I can not change them to 0.
The cron is working as I tried the test /admin/cron.php and get:
"Cron script completed correctly
Execution took 1.177381 seconds"
Can anyone suggest anything?
Thanks
Hi guys,
I am just wondering, my statistics is not working, although I tried out the described solutions.
I thought, that moodle was working just with normal site administration?
Why do I have to tweek php files and manipulate the database entries?
Does this mean, that the statistics functions of moodle are not working?
Statistics is something substantial, but obviously I need to be a php programmer to make it working. Why dont you distribute SW which was tested and is working?
Manfred
Hi
We are currently running Moodle 1.9.3 on hosting site and it’s been working fine for us over 5 years. Hopefully upgrade over the summer to 2.0.
In the past I was having trouble with my stats not updating/processing and by following this forum I got them running again.
However we got upgraded to a new professional server to improve performance on the site and since then our stats have stopped running. I have followed everything that I did before and I still can’t get this to update.
In Notifications area it states that the cron.php maintenance script has been completed in over 24 hrs. I can run it normally from the address bar admin/cron.php and it will update some stats manually. However the next day the message appears again.
I contacted the hosing company and they say the cron jobs are working.
Here are my cron commands
*/5 * * * * cd '/home2/stcather/public_html/moodle/admin/' ; /ramdisk/bin/php5 -q 'cron.php' > /dev/null ;
They asked me to change it to the following
*/5 * * * * /ramdisk/bin/php5 -q /home2/stcather/public_html/moodle/admin/cron.php >/dev/null 2>&1
Still didn’t make a difference.
Any help appreciated
Have you tried using php rather than php5. In fact try using php rather than * * * * /ramdisk/bin/php5
My php is the latest version but the installer stopped separating the php5 version in some time ago.
Alternatively, try the other version where you so a command line get on the file using (from the 1.9 cron.php script)
wget -q -O /dev/null 'http://moodle.somewhere.edu/admin/cron.php'
i get an email that says the following
/bin/sh: /ramdisk/bin/php: No such file or directory
What about using the wget version from another server?
OK i have used the following code
wget -q -O /dev/null 'http://ouraddressinhere/admin/cron.php'
the message that kept on appearing every day regarding the maintence script hasn't ran in 24hours is gone.
and im starting to get backup summary emails again which is a good start. However my stats still will not update. I have just changed the Maximum processing interval to the last 4 months as it was set to all.
However when i click on stats on a user profile i get the following message.
I check back on this tomorrow to see if it changes
My Cron jobs are running now however my Stats are not updating.
I have tried all suggestions from above and still not getting anywhere.
Database test results all comeback as ok, i have reset the values to 0 nothing. any other suggestions would be great. Need to have some stats in for the boss soon.
All working again thanks.
Took a while but i'm not sure how but i'm glad it is.
Hello,
Thank you for the solutions, I followed the steps and statistics seems to work fine.
However, I can see course statistics only for the last month. Is there any chance to have them for the last 3 months, for exemple?
I set statsfirstrun to 4 months, statsruntimedays to 120 but when I go to the statistic page the statistics shown are limited to 4 weeks. We are working on 2.0 version.
Thank you.