Moodle
  1. Moodle
  2. MDL-26352

enrol_meta error during upgrade from 1.9 to 2.0

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0.2
    • Component/s: Course
    • Labels:
      None
    • Environment:
      Windows, Apache, MySQL
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      During an upgrade from 1.9.10 to Moodle 2.0 I get an error during the enrol_meta upgrade process that says "Can not find data record in database table course" (see screen shot).

      If I flush out the table mdl_meta prior to the upgrade it works fine but obviously I have no child courses or enrolments.
      If I ignore the error then the upgrade continues but meta functionality does not work even though it's enabled in the Moodle 2.0 enrolment settings. I can then not select this as a plugin.

      At this stage I'm not sure where it's failing or what the error message means. My upgrade has over 3000 meta courses, could this be the issue?

        Gliffy Diagrams

          Activity

          Hide
          Petr Skoda added a comment -

          Fix should be available in the next weekly build, thanks for the report.

          Petr

          Show
          Petr Skoda added a comment - Fix should be available in the next weekly build, thanks for the report. Petr
          Hide
          Dongsheng Cai added a comment -

          Tested upgrading moodle 1.9 with invalid records in course_meta table, works well without errors.

          Thanks.

          Show
          Dongsheng Cai added a comment - Tested upgrading moodle 1.9 with invalid records in course_meta table, works well without errors. Thanks.
          Hide
          Lewis Carr added a comment -

          I found out what caused the error!
          In mdl_course_meta there were entries linked to courses that no longer existed in mdl_course.
          When some courses were deleted it left the entry in mdl_course_meta, and obviously when Moodle 2.0 tried to convert the meta data it could not find the resulting course ID number and halted the upgrade.
          I have fixed the entries in my Moodle the upgrade then worked..
          It may be an idea to write something in the install script that checks that all parent courses still exist in the database in case this has happened to anyone else.

          Many thanks.

          Show
          Lewis Carr added a comment - I found out what caused the error! In mdl_course_meta there were entries linked to courses that no longer existed in mdl_course. When some courses were deleted it left the entry in mdl_course_meta, and obviously when Moodle 2.0 tried to convert the meta data it could not find the resulting course ID number and halted the upgrade. I have fixed the entries in my Moodle the upgrade then worked.. It may be an idea to write something in the install script that checks that all parent courses still exist in the database in case this has happened to anyone else. Many thanks.

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: