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

Backup: It's possible to put asynchronous course backup into an irrecoverable state

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Waiting for peer review
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.7.1
    • Fix Version/s: None
    • Component/s: Backup
    • Database:
      Any
    • Testing Instructions:
      Hide
      • Enable async backups from the advanced site settings in Moodle
      • Create a course in Moodle
      • Choose backup from the course menu
      • Navigate to the end of the backup options screens (specific backup options are not required)
      • The backup processing screen should indicate there is a backup pending
      • Don't navigate away from the screen
      • Run system cron to process the pending backup
      • Once the Moodle UI indicates that the backup has completed, refresh the web browser window and say yes to resubmitting form data when prompted by the web browser.

      With this patch applied the expected behaviour is you will be presented with a new backup pending screen. Running the cron again should see this backup complete successfully.

      Without the patch the cron process will exit with an error and the backup will not complete.

      Show
      Enable async backups from the advanced site settings in Moodle Create a course in Moodle Choose backup from the course menu Navigate to the end of the backup options screens (specific backup options are not required) The backup processing screen should indicate there is a backup pending Don't navigate away from the screen Run system cron to process the pending backup Once the Moodle UI indicates that the backup has completed, refresh the web browser window and say yes to resubmitting form data when prompted by the web browser. With this patch applied the expected behaviour is you will be presented with a new backup pending screen. Running the cron again should see this backup complete successfully. Without the patch the cron process will exit with an error and the backup will not complete.
    • Affected Branches:
      MOODLE_37_STABLE
    • Pull 3.7 Branch:
      MOODLE_37_STABLE_MDL-66225_async_backup_state
    • Pull Master Branch:
      master_MDL-66225_async_backup_state

      Description

      Reported on MDL-65858 (though not caused by that code):

      Steps to reproduce:

      1. Schedule a backup, using the 'jump to final step' button, and wait on the polling page.
      2. Run cron, backup is created successfully, polling page shows '100%'.
      3. Refresh the polling page
      4. Run cron again, notice it fails.

      Execute adhoc task: core\task\asynchronous_backup_task
      ... started 10:57:34. Current memory use 39.9MB.
      Processing asynchronous backup for backup: 10044b287d000117b1775b81db0d9369
      ... used 2 dbqueries
      ... used 0.0010480880737305 seconds
      Adhoc task failed: core\task\asynchronous_backup_task,error/backup_controller_dbops_loading_invalid_controller
      Backtrace:
      * line 363 of /backup/controller/backup_controller.class.php: call to backup_controller_dbops::load_controller()
      * line 55 of /lib/classes/task/asynchronous_backup_task.php: call to backup_controller::load_controller()
      * line 272 of /lib/cronlib.php: call to core\task\asynchronous_backup_task->execute()
      * line 155 of /lib/cronlib.php: call to cron_run_inner_adhoc_task()
      * line 76 of /lib/cronlib.php: call to cron_run_adhoc_tasks()
      * line 61 of /admin/cli/cron.php: call to cron_run()
      

      Then, we're unable to schedule any more backups for this course. I see the "....allow a user to have one pending backup for a resource at a time.." warning when clicking backup from the course settings cog menu.

      What's happening? It seems the adhoc task is being created with the first backupid (the one that's now on status 1000 and is complete). It needs to use the newer backup id to work. Once the task has been created, it just fails over and over and users are unable to create any new backups.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mattp@catalyst-au.net Matt Porritt
                Reporter:
                jaked Jake Dallimore
                Participants:
                Component watchers:
                Adrian Greeve, Mihail Geshoski, Peter Dias
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: