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

Error during upgrade due to apparent duplicate capability

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a bug
    • Icon: Minor Minor
    • None
    • 2.6
    • Administration
    • None
    • MOODLE_26_STABLE

      I received the below while upgrading as part of MDL-40240. My database prefix is outcomes2_

      Error writing to database

      More information about this error
      Debug info: ERROR: duplicate key value violates unique constraint "outcomes2_capa_nam_uix"
      DETAIL: Key (name)=(moodle/outcome:mapoutcomes) already exists.
      INSERT INTO outcomes2_capabilities (name,captype,contextlevel,component,riskbitmask) VALUES($1,$2,$3,$4,$5)
      [array (
      'name' => 'moodle/outcome:mapoutcomes',
      'captype' => 'write',
      'contextlevel' => 10,
      'component' => 'moodle',
      'riskbitmask' => 0,
      )]
      Error code: dmlwriteexception
      Stack trace:

      line 439 of /lib/dml/moodle_database.php: dml_write_exception thrown
      line 239 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
      line 848 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
      line 900 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->insert_record_raw()
      line 2719 of /lib/accesslib.php: call to pgsql_native_moodle_database->insert_record()
      line 1551 of /lib/upgradelib.php: call to update_capabilities()
      line 341 of /admin/index.php: call to upgrade_core()

      Its curious because this is coming out of core code. The capability only appears once in access.php. I'm not sure what the outcomes code could be doing to cause this but if its a core upgrade code issue how has this not come up before now?

            Unassigned Unassigned
            andyjdavis Andrew Davis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

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