Moodle

Daily statistics not being gathered

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Won't Fix
  • Affects Version/s: 1.9.3
  • Fix Version/s: None
  • Component/s: Performance
  • Labels:
    None
  • Environment:
    Apache/2.2.6 (Unix)
    MySQL 5.0.22
  • Database:
    MySQL
  • Affected Branches:
    MOODLE_19_STABLE

Description

The gathering of daily statistics during the cron job after we upgraded from moodle 1.9 to 1.9.3 is no longer working. If I run the cron job in the browser it shows:

Running daily statistics gathering, starting at 1233705600:
...

After leaving it running for a number of hours users began to complain that they couldn't log in. I checked the process list and found this query running:

INSERT INTO mdl_stats_daily (stattype, timeend, courseid, roleid, stat1, stat2)

SELECT 'enrolments', timeend, courseid, roleid, COUNT(DISTINCT userid), 0
FROM (
SELECT 1233792000 AS timeend, pl.courseid, pl.roleid, pl.userid
FROM (
SELECT DISTINCT ra.roleid, ra.userid, c.id as courseid
FROM mdl_role_assignments ra JOIN mdl_context ctx
ON ctx.id = ra.contextid
CROSS JOIN mdl_course c
JOIN mdl_role_capabilities rc
ON rc.roleid = ra.roleid LEFT OUTER JOIN mdl_course_categories cc1
ON cc1.id = c.category
WHERE ((rc.capability = 'moodle/course:view' )
AND rc.permission = 1 AND rc.contextid = 1
AND (ctx.contextlevel = 10
OR (c.id = ctx.instanceid AND ctx.contextlevel = 50) OR (cc1.id = ctx.instanceid AND ctx.contextlevel = 40)))
) pl
) inline_view
GROUP BY timeend, courseid, roleid

and there was a list queries that were waiting because the tables were locked.
Once I had killed the process moodle was ok but obviously no stats had been gathered. There is a forum post that seems to be related to the same issue http://moodle.org/mod/forum/discuss.php?d=103883.

Before upgrading statistics were working fine. For now I have disabled the gathering of statistics and the cron job completes but we need this feature for producing our monthly reports.

Issue Links

Activity

Hide
Elan Hasson added a comment -

Seems to be a duplicate issue of MDL-18484.

Show
Elan Hasson added a comment - Seems to be a duplicate issue of MDL-18484.
Hide
Michael de Raadt added a comment -

Thanks for reporting this issue.

We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported.

If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.

Michael d;

lqjjLKA0p6

Show
Michael de Raadt added a comment - Thanks for reporting this issue. We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported. If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed. Michael d; lqjjLKA0p6
Hide
Michael de Raadt added a comment -

I'm closing this issue as it appears to have become inactive and is probably not relevant to a current supported version. If you are encountering this problem or one similar, please launch a new issue.

Show
Michael de Raadt added a comment - I'm closing this issue as it appears to have become inactive and is probably not relevant to a current supported version. If you are encountering this problem or one similar, please launch a new issue.

People

Vote (3)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: