Skip to content

Provide a more verbose failure message if a archiving job fails #11

Description

@abias

Today, I tried to set up a local_archiving instance with a fresh quiz archive worker backend.

When running the first archiving job in Moodle, the job failed and the logs said this:

2026-06-08 12:20:03 [ INFO] Job status: Archiving (30)
2026-06-08 12:20:03 [ INFO]  -> Activity archiving task status: CREATED (20)
2026-06-08 12:20:03 [DEBUG]  -> Created token for web service with ID 2: 0acf316d0e7beb7f3d6c347eefabeb25
2026-06-08 12:20:03 [TRACE]  -> Counting number of attachments in all attempts ...
2026-06-08 12:20:03 [TRACE]  -> Found 0 attachments in all attempts.
2026-06-08 12:20:03 [ INFO]  -> Enqueued new worker job with UUID 9cfaaab2-6323-11f1-92f6-0242ac110002
2026-06-08 12:20:03 [ INFO]  -> Activity archiving task status: AWAITING_PROCESSING (40)
2026-06-08 12:20:03 [DEBUG] ^---------- Finished execution cycle 1780914003 ----------^
2026-06-08 12:20:03 [ INFO]  -> Activity archiving task status: RUNNING (100)
2026-06-08 12:20:03 [ INFO]  -> Activity archiving task 2 progress updated: 0%
2026-06-08 12:20:03 [ INFO]  -> Activity archiving task status: FAILED (250)
2026-06-08 12:20:03 [DEBUG]  -> Destroyed web service token: 0acf316d0e7beb7f3d6c347eefabeb25
2026-06-08 12:20:09 [DEBUG] v---------- Starting execution cycle 1780914009 ----------v
2026-06-08 12:20:09 [ INFO] Job status: Backup Collection (40)
2026-06-08 12:20:09 [ INFO] Job status: Post-Processing (50)
2026-06-08 12:20:09 [ INFO] Job status: Failure (240)
2026-06-08 12:20:09 [FATAL] local_archiving/no_activity_artifacts_found
2026-06-08 12:20:09 [DEBUG] ^---------- Finished execution cycle 1780914009 ----------^
2026-06-08 12:21:10 [DEBUG] v---------- Starting execution cycle 1780914070 ----------v
2026-06-08 12:21:10 [DEBUG] ^---------- Finished execution cycle 1780914070 ----------^

The reason why the job failed was because the quiz archive worker was hanging in this state after its very first startup:

[2026-06-08 10:20:03,950] | ERROR    | archiveworker.quiz_archive_job::<9cfaaab2-6323-11f1-92f6-0242ac110002> | Job failed with error: Error: BrowserType.launch: Executable doesn't exist at /root/.cache/ms-playwright/chromium_headless_shell-1208/chrome-headless-shell-linux64/chrome-headless-shell
╔════════════════════════════════════════════════════════════╗
║ Looks like Playwright was just installed or updated.       ║
║ Please run the following command to download new browsers: ║
║                                                            ║
║     playwright install                                     ║
║                                                            ║
║ <3 Playwright Team                                         ║
╚════════════════════════════════════════════════════════════╝

Regardless of the fact that this worker zombie status might be solved in the meantime on the worker side (if I interpret the recent changelog on https://github.com/ngandrass/moodle-quiz-archive-worker/blob/master/CHANGELOG.md correctly), this is a general operation problem:

The worker accepted the job and let it fail.
And for me as Moodle admin, the reason for this failure was not obvious at all. The archiving job in Moodle just failed without further information.

I would like to propose to add a more verbose failure message to the logs of the archiving job, if possible. At least, it would help to have a note which says "Your worker accepted the job initially, thus it is be running. Go to the quiz archive worker and look at its logs for more details".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions