Mixing of "section" and "id" in course_sections table causing 950.000 sections in a course

Issue #49 resolved
Robert Schrenk created an issue

Hello,

in the last days we had several issues with courses, that hat a few hundred thousand (empty) course sections, causing the system to lock certain user actions (PHP Fatal error: Allowed memory size exhausted).

We are using Moodle 3.9.1+ and format_tiles version 2019052116

All of those courses used the tiles format, and one user reported us, that after adding a new section to a course it was labelled “Kachel 319847”. The courses_section-Table of moodle distinguishes between the primary key “id” and the sorting number “section”. It seems that under certain circumstances the new section gets the same value assigned in “section” as in “id”. So the sort order is something like 1, 2, 3, 319847.

When Moodle rebuilds the course cache it seems that it creates all “missing” sections. The user reported that this only happens if all sections are expanded and it is reproducable for her.

Unfortunately I could not reproduce this issue myself. Even if I log in as that user, I could not reproduce it, But the screenshot is more ore less an evidence.

Can you please investigate this issue, was the number of “ghost sections” is growing each time exponentially! This one had around 320.000, the last one produced more than 950.000 empty sections…

Kind regards

Comments (4)

  1. David Watson repo owner

    Hi this is a duplicate of issue #45 and the solution is the same, to upgrade the plugin to the latest version, so I am marking as resolved.

    It occurs when:

    • you are using Moodle 3.9
    • the incompatible Moodle 3.7 version of the plugin was previously installed and used in Moodle 3.9
    • you have a course which became affected by issue #39 as a result of the above you then try to import into that course, or you back it up and try to restore it

  2. David Watson repo owner

    For anyone affected by this issue, the latest version of the plugin for Moodle 3.9 includes an experimental tool to help you to delete excess sections. You can access the tool Under Site Administration > Plugins > Course formats > Tiles format > Other > Problem courses

  3. Log in to comment