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

dml_write_exception thrown

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Critical Critical
    • None
    • 2.1
    • Course
    • Centos 5.6
    • MySQL
    • MOODLE_21_STABLE
    • Hide

      Log in as site administrator, create a course, the error appears.

      Show
      Log in as site administrator, create a course, the error appears.

      I recently upgraded Moodle from 1.9 to 2.0.2 (Build: 20110221. I have noticed a number of "Error writing to database" errors when creating and deleting new courses. The stange thing is that it seems like the courses have been created and seem to function normally. I have now just upgraded to 2.1, but the problem persists.

      I turned on debugging and I get this when I delete a course:

      Deleting atest
      Deleted - Grades, Items, Categories
      Deleted - Outcomes
      Deleted - Scales
      Deleted - Settings
      Deleted - Letters
      Deleted 0 x assignment
      Deleted 0 x chat
      Deleted 0 x choice
      Deleted 0 x forum
      Deleted 0 x glossary
      Deleted 0 x label
      Deleted 0 x lesson
      Deleted 0 x quiz
      Deleted 0 x resource
      Deleted 0 x scorm
      Deleted 0 x survey
      Deleted 0 x wiki
      Deleted 0 x workshop
      Deleted 0 x feedback
      Deleted 0 x data
      Deleted 0 x folder
      Deleted 0 x imscp
      Deleted 0 x page
      Deleted 0 x url
      Deleted groupings
      Deleted groupings_groups
      Deleted groups_members
      Deleted groups
      Deleted - course tags

      Error writing to database

      More information about this error
      Debug info: Duplicate entry '5-200001' for key 2
      UPDATE mdl_course
      SET sortorder = sortorder + 1
      WHERE category = ?
      [array (
      0 => '5',
      )]
      Stack trace:

      line 396 of /lib/dml/moodle_database.php: dml_write_exception thrown
      line 707 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
      line 1095 of /lib/datalib.php: call to mysqli_native_moodle_database->execute()
      line 74 of /course/delete.php: call to fix_course_sortorder()

      and this when I create courses:

      Debug info: Duplicate entry '4-250000' for key 2
      UPDATE mdl_course
      SET sortorder = ((sortorder) % (10000)) + ?
      WHERE category = ?
      [array (
      0 => '250000',
      1 => '4',
      )]
      Stack trace:

      line 394 of /lib/dml/moodle_database.php: dml_write_exception thrown
      line 707 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
      line 1066 of /lib/datalib.php: call to mysqli_native_moodle_database->execute()
      line 3712 of /course/lib.php: call to fix_course_sortorder()
      line 111 of /course/edit.php: call to create_course()

            skodak Petr Skoda
            misnerspace Steve
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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