Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-18359

Daily statistics not being gathered

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major Major
    • None
    • 1.9.3
    • Performance
    • None
    • Apache/2.2.6 (Unix)
      MySQL 5.0.22
    • MySQL
    • MOODLE_19_STABLE

      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.

            martinlanghoff Martín Langhoff (Inactive)
            ccaajoa Jo Matthews (Inactive)
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.