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

Error converting submissions for annotation when student is unenrolled from course (recurrence)

XMLWordPrintable

    • MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE
    • MOODLE_34_STABLE, MOODLE_35_STABLE
    • MDL-60014-master-catcherror-nopermission-annotatepdfcron
    • Hide

      Testing instructions: 

      • Create a course, add an assignment and enrol a user as a student
      • As the student, submit a file to the assignment
      • Unenrol the student from the course.
      • Run the convert annotation task (you don't need any PDF converter enabled to run this)
      • The task completes successfully 
      Show
      Testing instructions:   Create a course, add an assignment and enrol a user as a student As the student, submit a file to the assignment Unenrol the student from the course. Run the convert annotation task (you don't need any PDF converter enabled to run this) The task completes successfully 

      I've encountered a recurrence of resolved bug MDL-56810 on Moodle 3.3.1.

      Steps to reproduce:

      • Create a course, add an assignment and enrol a user as a student
      • As the student, submit a file to the assignment
      • Unenrol the student from the course.
      • Run the convert annotation task (you don't need any PDF converter enabled to run this)
      • You will have the following error :

      Execute scheduled task: Préparer les travaux remis pour annotation (assignfeedback_editpdf\task\convert_submissions)
      ... started 08:40:29. Current memory use 19.6MB.
      Convert 1 submission attempt(s) for assignment 7888
      ... used 14 dbqueries
      ... used 0.0099310874938965 seconds
      Scheduled task failed: Préparer les travaux remis pour annotation (assignfeedback_editpdf\task\convert_submissions),error/nopermission
      Backtrace:
      * line 254 of /mod/assign/feedback/editpdf/classes/document_services.php: call to print_error()
      * line 302 of /mod/assign/feedback/editpdf/classes/document_services.php: call to assignfeedback_editpdf\document_services::get_combined_document_for_attempt()
      * line 97 of /mod/assign/feedback/editpdf/classes/task/convert_submissions.php: call to assignfeedback_editpdf\document_services::get_combined_pdf_for_attempt()
      * line 141 of /lib/cronlib.php: call to assignfeedback_editpdf\task\convert_submissions->execute()
      * line 249 of /lib/cronlib.php: call to cron_run_inner_scheduled_task()
      * line 91 of /admin/tool/task/schedule_task.php: call to cron_run_single_task()
      

      Apparently, at some time after the fix to MDL-56810, a call to get_combined_pdf_for_attempt was added at line 97 in convert_submissions.php. This method calls get_combined_pdf_for_attempt, which then calls get_combined_document_for_attempt and list_compatible_submission_files_for_attempt. Both methods check if the user can access the submission, and raise an error if not. Since the error is not catched, the task fails on each execution, as the offending record is never deleled from assignfeedback_editpdf_queue.

      (related question : if we are not using any file converter, can we just disable this scheduled task ?).

      Regards

       

        1. MDL-60014.PNG
          30 kB
          Anna Carissa Sadia

            evdy Eva Davitasvili
            monnardj Jacques Monnard
            Damyon Wiese Damyon Wiese
            David Monllaó David Monllaó
            Anna Carissa Sadia Anna Carissa Sadia
            Votes:
            20 Vote for this issue
            Watchers:
            25 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 30 minutes
                30m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.