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

Backing up courses with SCORM package with SQL Server 2019 causes lock in DB

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.7.9, 3.8.6, 3.9.3, 3.10
    • Fix Version/s: None
    • Component/s: Backup, Course, SCORM
    • Labels:
    • Environment:
      Database Server:
      Microsoft SQL Server 2019
    • Database:
      Microsoft SQL
    • Affected Branches:
      MOODLE_310_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE

      Description

      The experience had here is the same as MDL-57698

      I only ran into the issue when upgrading to SQL Server 2019.

      This is the error thrown after killing the process once it locks:

      Debug info: SQLState: HY000<br>
      Error Code: 0<br>
      Message: [Microsoft][ODBC Driver 17 for SQL Server]Unspecified error occurred on SQL Server. Connection may have been terminated by the server.<br>
      SQLState: HY000<br>
      Error Code: 596<br>
      Message: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Cannot continue the execution because the session is in the kill state.<br>
      SELECT 'x' FROM #mdl_backup_ids_temp WITH (NOLOCK) WHERE backupid = N'bd67803fedb82d760e80b9d767d5b9a9' AND itemname = N'filefinal' AND itemid = '19727' ORDER BY 1 OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY
      [array (
       0 => 'bd67803fedb82d760e80b9d767d5b9a9',
       1 => 'filefinal',
       2 => '19727',
      )]
      Error code: dmlreadexception
      Stack trace: * line 486 of \lib\dml\moodle_database.php: dml_read_exception thrown
      * line 324 of \lib\dml\sqlsrv_native_moodle_database.php: call to moodle_database->query_end()
      * line 431 of \lib\dml\sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->query_end()
      * line 896 of \lib\dml\sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->do_query()
      * line 1902 of \lib\dml\moodle_database.php: call to sqlsrv_native_moodle_database->get_recordset_sql()
      * line 1887 of \lib\dml\moodle_database.php: call to moodle_database->record_exists_sql()
      * line 1871 of \lib\dml\moodle_database.php: call to moodle_database->record_exists_select()
      * line 169 of \backup\util\dbops\backup_structure_dbops.class.php: call to moodle_database->record_exists()
      * line 1769 of \backup\moodle2\backup_stepslib.php: call to backup_structure_dbops::move_annotations_to_final()
      * line 34 of \backup\util\plan\backup_execution_step.class.php: call to move_inforef_annotations_to_final->define_execution()
      * line 181 of \backup\util\plan\base_task.class.php: call to backup_execution_step->execute()
      * line 222 of \backup\moodle2\backup_activity_task.class.php: call to base_task->execute()
      * line 178 of \backup\util\plan\base_plan.class.php: call to backup_activity_task->execute()
      * line 119 of \backup\util\plan\backup_plan.class.php: call to base_plan->execute()
      * line 337 of \backup\controller\backup_controller.class.php: call to backup_plan->execute()
      * line 100 of \admin\cli\backup.php: call to backup_controller->execute_plan()

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            matt_ovitraders Matthew Sawatzky
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona), Damyon Wiese, Dan Marsden, Matteo Scaramuccia, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated: