miotto / moodle-fileconverter_flasksoffice

This Moodle plugin uses a separat Linux server with Flask and LibreOffice for converting documents.
3 stars 2 forks source link

Random failure found in cron debugging output of moodle #1

Closed aec2016 closed 1 year ago

aec2016 commented 3 years ago

Install the latest release on moodle.org site with moodle version 3.11.2

Here is the cron debugging output:

Execute scheduled task: Prepare submissions for annotation (fileconverter_flasksoffice\task\convert_submissions)
... started 14:37:58. Current memory use 13.9MB.
flasksoffice: Processing pending document conversions
flasksoffice: Processing conversions for file id: 13602889
flasksoffice: Found: 1 conversions for file id: 13602889

Warning: copy(/home/moodledata/moodledata/filedir/e3/77/e3775a6c75ced9710961e3766dc5e7004eec8811): failed to open stream: No such file or directory in /var/www/html/moodle311/lib/filestorage/file_system_filedir.php on line 234
... used 5 dbqueries
... used 0.26699900627136 seconds
Scheduled task failed: Prepare submissions for annotation (fileconverter_flasksoffice\task\convert_submissions),Coding error detected, it must be fixed by a programmer: operation aborted by callback (42)
Debug info:
42
Backtrace:

line 235 of /files/converter/flasksoffice/classes/converter.php: call to fileconverter_flasksoffice\converter->start_document_conversion()
line 77 of /files/converter/flasksoffice/classes/task/convert_submissions.php: call to fileconverter_flasksoffice\converter->poll_conversion_status()
line 253 of /lib/cronlib.php: call to fileconverter_flasksoffice\task\convert_submissions->execute()
line 167 of /admin/cli/scheduled_task.php: call to cron_run_inner_scheduled_task()

However, some time the debugging output looks fine as:

Execute scheduled task: Prepare submissions for annotation (fileconverter_flasksoffice\task\convert_submissions)
... started 16:11:29. Current memory use 13.8MB.
flasksoffice: Processing pending document conversions
... used 2 dbqueries
... used 0.017715930938721 seconds
Scheduled task complete: Prepare submissions for annotation (fileconverter_flasksoffice\task\convert_submissions)

It just fails randomly without an obvious pattern, any advice or suggestion would be much appreciated, thanks!

miotto commented 3 years ago

I have changed something in the code for curl upload. Previously I had copied the file and then sent it to the conversion server. Now the file is sent directly to the conversion server. I can't say if this fixes the error, but the file copying problem should not occur anymore. Please try the code from the branch https://github.com/miotto/moodle-fileconverter_flasksoffice/tree/iss1 You can update the whole plugin or just replace the classes/converter.php file. Please let me know if it solves the problem.

miotto commented 1 year ago

No further response, close the issue.