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

Missing LTI resource crashes sync_grades task

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Waiting for peer review
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.5.8, 3.6.6, 3.7
    • Fix Version/s: None
    • Component/s: Enrolments, LTI provider
    • Labels:
    • Testing Instructions:
      Hide
      1. Setup two test systems. Enable LTI auth and enrol plugins one one, set up a graded activities and share each separately each via LTI.
      2. Set up other system and consumer. Preconfigure both shared activities and set up an external tool activity for each.
      3. Complete activities as a student from consumer site.
      4. Verify that grades are updated from provider to consumer through the task on the provider system.
      5. On provider delete one activity, but do not change any LTI provider settings.
      6. Complete the other activity as another user on the consumer system.
      7. Allow the grade update task to run.
      8. Check the task log to see that an error is reported, but that whole task completes successfully.
      9. Check consumer to verify that the grades for the working activity where updated correctly.

       

      Show
      Setup two test systems. Enable LTI auth and enrol plugins one one, set up a graded activities and share each separately each via LTI. Set up other system and consumer. Preconfigure both shared activities and set up an external tool activity for each. Complete activities as a student from consumer site. Verify that grades are updated from provider to consumer through the task on the provider system. On provider delete one activity, but do not change any LTI provider settings. Complete the other activity as another user on the consumer system. Allow the grade update task to run. Check the task log to see that an error is reported, but that whole task completes successfully. Check consumer to verify that the grades for the working activity where updated correctly.  
    • Affected Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE
    • Pull from Repository:
    • Pull 3.6 Branch:
      MDL-66671-m36-master
    • Pull 3.7 Branch:
      MDL-66671-m37-master
    • Pull 3.8 Branch:
      MDL-66671-m38-master
    • Pull Master Branch:
      MDL-66671-master

      Description

      As reported in https://moodle.org/mod/forum/discuss.php?d=390299

      If a resource used by LTI is removed "\enrol_lti\task\sync_grades" task crash due to a missing context.

       

      $ php www/admin/tool/task/cli/schedule_task.php --execute='\enrol_lti\task\sync_grades'
       Execute scheduled task: Publication comme outil LTI de synchro des notes (enrol_lti\task\sync_grades)
       Starting - Grade sync for shared tool '1' for the course '2'.
       Not sent - The grade for the user '10' in the tool '1' for the course '2' was not sent as the grades are the same.
       Not sent - The grade for the user '4' in the tool '1' for the course '2' was not sent as the grades are the same.
       Not sent - The grade for the user '12' in the tool '1' for the course '2' was not sent as the grades are the same.
       Completed - Synced grades for tool '1' in the course '2'. Processed 3 users; sent 0 grades.
      Starting - Grade sync for shared tool '3' for the course '2'.
       ... used 27 dbqueries
       ... used 0.095687866210938 seconds
       Scheduled task failed: Publication comme outil LTI de synchro des notes (enrol_lti\task\sync_grades),Impossible de trouver l'enregistrement de données dans la table context de la base de données.
       Debug info:
       SELECT * FROM
      {context}
      WHERE id = ?
       [array (
       0 => '28',
       )]
       Backtrace:
       
      line 1522 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select() line 5115 of /lib/accesslib.php: call to moodle_database->get_record() line 103 of /enrol/lti/classes/task/sync_grades.php: call to context::instance_by_id() line 156 of /admin/tool/task/cli/schedule_task.php: call to enrol_lti\task\sync_grades->execute() 

       

      Reproduced on latest Moodle 3.5.7+.

      Not tested against 3.5.8, 3.6, 3.7 and master yet but seeing enrol_lti git history they should be impacted too.

       

        Attachments

          Activity

            People

            • Assignee:
              dthies Daniel Thies
              Reporter:
              ak4t0sh Arnaud Trouvé
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: