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

Quiz DB error during Moodle 2.9 upgrade

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.9
    • Fix Version/s: None
    • Component/s: Quiz
    • Labels:
      None
    • Affected Branches:
      MOODLE_29_STABLE

      Description

      We are doing test upgrade of Moodle from 2.8.5+ to 2.9+ and got the following error during upgrade:

      Debug info: ERROR: duplicate key value violates unique constraint "mdl_quizsect_quifir_uix"
      DETAIL: Key (quizid, firstslot)=(67302, 1) already exists.
       
      INSERT INTO mdl_quiz_sections
      (quizid, firstslot, heading, shufflequestions)
      SELECT id, 1, $1, shufflequestions
      FROM mdl_quiz
       
      [array (
      0 => '',
      )]
      Error code: dmlwriteexception
      Stack trace:
      line 446 of /lib/dml/moodle_database.php: dml_write_exception thrown
      line 244 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
      line 682 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
      line 873 of /mod/quiz/db/upgrade.php: call to pgsql_native_moodle_database->execute()
      line 706 of /lib/upgradelib.php: call to xmldb_quiz_upgrade()
      line 424 of /lib/upgradelib.php: call to upgrade_plugins_modules()
      line 1630 of /lib/upgradelib.php: call to upgrade_plugins()
      line 433 of /admin/index.php: call to upgrade_noncore()
      

      We didn't see this during our last test upgrade (which would have been to 2.9.0), but I'm not sure if that means the code was integrated in the last few weeks, or that the flaw in our dataset is new, as each time we do the test upgrade we start with a fresh snapshot of prod.

      I haven't had time to dig into it yet.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: