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

Error updating config_plugins records for assignment types

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      Upgrading from 1.9.x to 2.0 under PostgreSQL, I get:

      ERROR: duplicate key value violates unique constraint "mdl_confplug_plunam_uix"

      UPDATE mdl_config_plugins SET plugin = $1,name = $2,value = $3 WHERE id=$4
      [array ( 'plugin' => 'assignment_online', 'name' => 'version', 'value' => '2005042900', 0 => '23', )]
      Stack trace:
      line 365 of /lib/dml/moodle_database.php: dml_write_exception thrown
      line 223 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
      line 883 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
      line 937 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->update_record_raw()
      line 2224 of /lib/db/upgrade.php: call to pgsql_native_moodle_database->update_record()
      line 987 of /lib/upgradelib.php: call to xmldb_main_upgrade()
      line 237 of /admin/index.php: call to upgrade_core()

      It seems that the (assignment_online, version) tuple already exists and something previous in the upgrade is inserting it, so the 2009061703 block in main upgrade fails.

      Solution: check for existing tuple before inserting AND delete the original ones

        Attachments

          Activity

            People

            • Assignee:
              stronk7 Eloy Lafuente (stronk7)
              Reporter:
              stronk7 Eloy Lafuente (stronk7)
              Participants:
              Component watchers:
              Adrian Greeve, Mihail Geshoski, Peter Dias, Matteo Scaramuccia, Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                24/Nov/10