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

moodle_exception can't be caught in course_backup_task class by missing courseid

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      1. Create "MDL-71136" course.

      2. Set Automated backup to manual:

      php admin/cli/cfg.php --component=backup --name=backup_auto_active --set=2

      3. Set the schedule:

      php admin/cli/cfg.php --component=backup --name=backup_auto_weekdays --set='1111111'

      4. Set execute time:

      php admin/cli/cfg.php --component=backup --name=backup_auto_hour --set=1

      5. Generate mdl_backup_courses records:

      php admin/cli/automated_backups.php

      6. Update nextstarttime:
      Postgres:

      update mdl_backup_courses set nextstarttime = round(extract(epoch from now()));

      MySQL:

      update mdl_backup_courses set nextstarttime = UNIX_TIMESTAMP();

      7. Generate ad-hoc task:

      php admin/cli/automated_backups.php

      8. Confirm, that ad-hoc task was created:

      select classname, nextruntime, faildelay, customdata from mdl_task_adhoc where classname = '\core\task\course_backup_task';

      9. Delete the course "MDL-71136":

      10. Run cron:

      php admin/cli/cron.php

      8. Confirm, that cron log has correct exception and looks like:

      Scheduled task complete: Background processing for scheduled allocation (workshopallocation_scheduled\task\cron_task)
      Execute adhoc task: core\task\course_backup_task
      ... started 03:26:52. Current memory use 42.5MB.
      Invalid course id: 3, task aborted.
      ... used 1 dbqueries
      ... used 0.00081300735473633 seconds
      Adhoc task complete: core\task\course_backup_task
      

       

      9. Run SQL:

      select classname, nextruntime, faildelay, customdata from mdl_task_adhoc where classname = '\core\task\course_backup_task';

      10. Confirm, that ad-hoc task has been finished (so the previous query return no rows).

       

      Show
      1. Create " MDL-71136 " course. 2. Set Automated backup to manual: php admin/cli/cfg.php --component=backup --name=backup_auto_active --set= 2 3. Set the schedule: php admin/cli/cfg.php --component=backup --name=backup_auto_weekdays --set= '1111111' 4. Set execute time: php admin/cli/cfg.php --component=backup --name=backup_auto_hour --set= 1 5. Generate mdl_backup_courses records: php admin/cli/automated_backups.php 6. Update nextstarttime: Postgres: update mdl_backup_courses set nextstarttime = round(extract(epoch from now())); MySQL: update mdl_backup_courses set nextstarttime = UNIX_TIMESTAMP(); 7. Generate ad-hoc task: php admin/cli/automated_backups.php 8. Confirm , that ad-hoc task was created: select classname, nextruntime, faildelay, customdata from mdl_task_adhoc where classname = '\core\task\course_backup_task' ; 9. Delete the course " MDL-71136 ": 10. Run cron: php admin/cli/cron.php 8. Confirm , that cron log has correct exception and looks like: Scheduled task complete: Background processing for scheduled allocation (workshopallocation_scheduled\task\cron_task) Execute adhoc task: core\task\course_backup_task ... started 03 : 26 : 52 . Current memory use 42 .5MB. Invalid course id: 3 , task aborted. ... used 1 dbqueries ... used 0.00081300735473633 seconds Adhoc task complete: core\task\course_backup_task   9. Run SQL: select classname, nextruntime, faildelay, customdata from mdl_task_adhoc where classname = '\core\task\course_backup_task' ; 10. Confirm , that ad-hoc task has been finished (so the previous query return no rows).  
    • Affected Branches:
      MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE
    • Fixed Branches:
      MOODLE_310_STABLE, MOODLE_39_STABLE
    • Pull 3.9 Branch:
    • Pull 3.10 Branch:
      MDL-71136_310
    • Pull 3.11 Branch:
      MDL-71136_311
    • Pull Master Branch:
      MDL-71136_master

      Description

      In the MDL-67502, the bug was fixed for missing 'backup_courses',

      But the bug is still appeared when 'course' is missing.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              tomotsuyuki Tomo Tsuyuki
              Reporter:
              tomotsuyuki Tomo Tsuyuki
              Peer reviewer:
              Mikhail Golenkov Mikhail Golenkov
              Integrator:
              Sara Arjona (@sarjona) Sara Arjona (@sarjona)
              Tester:
              Gladys Basiana Gladys Basiana
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                10/May/21

                  Time Tracking

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