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

    • Database:
      Any
    • Testing Instructions:
      Hide
      1. Login as admin
      2. Go to "Administration / Courses / Backups / Asynchronous backup/restore"
      3. Enable asynchronous backups
      4. Create a course
      5. Choose backup from the course menu
      6. "Jump to final step" to navigate to the end of the backup options screens (specific backup options are not required)
      7. The backup processing screen should indicate there is a backup pending
      8. Don't navigate away from the screen
      9. Run system cron to process the pending backup
      10. Wait until the cron job finish
      11. Access again to the backup course page you leave in step #7
      12. Check "The backup process has completed" message is displayed (it might take a few seconds to be updated after cron execution)
      13. Refresh the web browser window and say yes to resubmitting form data when prompted by the web browser
      14. Check "The backup process is pending" message is displayed again
      15. Run system cron to process the pending backup
      16. Check no error is displayed in the cron execution
      17. Access again to the backup course page you leave in step #14.
      18. Check "The backup process has completed" message is displayed (it might take a few seconds to be updated after cron execution)

       

      Show
      Login as admin Go to "Administration / Courses / Backups / Asynchronous backup/restore" Enable asynchronous backups Create a course Choose backup from the course menu "Jump to final step" to 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 Wait until the cron job finish Access again to the backup course page you leave in step #7 Check "The backup process has completed" message is displayed (it might take a few seconds to be updated after cron execution) Refresh the web browser window and say yes to resubmitting form data when prompted by the web browser Check "The backup process is pending" message is displayed again Run system cron to process the pending backup Check no error is displayed in the cron execution Access again to the backup course page you leave in step #14. Check "The backup process has completed" message is displayed (it might take a few seconds to be updated after cron execution)  
    • Affected Branches:
      MOODLE_37_STABLE
    • Fixed 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
              Peer reviewer:
              Peter Dias
              Integrator:
              Sara Arjona (@sarjona)
              Tester:
              Gladys Basiana
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                11/Nov/19

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour, 4 minutes
                  1h 4m