ad hoc tasks fail during async backup for course copy routine

ad hoc tasks fail during async backup for course copy routine

by Whalon Herbert -
Number of replies: 4
Good morning good folks,

Wondering if anyone can steer me in the right direction. I am troubleshooting the failure of these adhoc tasks. For some reason, it seems like only one user of mine is having an issue with the Copy Course functionality..which seems to involve taking/restoring an asynchronous backup (which is have enabled).  

A list of failed tasks from adhoc scheduler.

details behind a specific failed ad hoc task

I am running Moodle 4.2.3 on Windows Server and SQL Server...when browsing the adhoc task table, i am noticing a few fields are NULL....Moodle is not throwing an error, but it seems weird that 'component' is blank, 'userid' , 'hostname', & 'pid' are NULL, right? 

mdl_task_adhoc

In the query below, i had already updated userid from NULL to 4...but it did not make a difference.

command line output from running \admin\cli\adhoc_tasks.php --id=3789

logs from failed run of core\task\asynchronous_copy_task
In the course of troubleshooting this, i have picked up that we had some plugins that needs to be removed/uninstalled...that has been done, so both my web servers show identical info on active plugins. 

So does anything stick out? 

Thanks for reading this...
WH
Average of ratings: -
In reply to Whalon Herbert

Re: ad hoc tasks fail during async backup for course copy routine

by Renaat Debleu -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
When running tasks using cron or adhoc, nobody has to be logged in, so the user can be 0.

Perhaps a way to find the problem is
  1. disabling asynchronous backup
  2. enable debugging
  3. enable display debugging
  4. create a manual backup of the course with id 470.
Perhaps you will see more info where things go wrong.
In reply to Renaat Debleu

Re: ad hoc tasks fail during async backup for course copy routine

by Whalon Herbert -
Hi Renaat,


Admittedly, we started on Moodle 1.x way back when and have tried to keep up as versions change. Through the last few major version changes, I have not done as much testing as I should have. This is the first time I’ve ever had to investigate scheduled or adhoc task issues, as most of our prior issues seem to clear when cron runs from windows scheduled tasks. The documentation I read on the course copy/move feature seemed to change recently, leading me to turn on async backups…

To confirm your approach, I should enable debugging from front end settings and inside config.php, then disable async backups and take a manual backup to test if the course itself has issues? Great input…thank you vm…I’ll try that asap.

Moments after I submitted this post, a transformer at my office park blew and now  am in darkness for the next 3-4 hours. I’ll be back….

In reply to Whalon Herbert

Re: ad hoc tasks fail during async backup for course copy routine

by Whalon Herbert -
Back today with power and good news...from what I can tell, I did not have automated backups set to 'Enabled'. I took your advice on trying to manually backup the course and that is what led me to see the underlying issue of the incorrect backup settings. Thanks again Renaat for extending a helping hand. 

In reply to Whalon Herbert

Re: ad hoc tasks fail during async backup for course copy routine

by Gregor McNish -
Picture of Particularly helpful Moodlers
Site Admin/Server also has the very useful Task Logs screen, which lets you see logs from all tasks -- you can filter on failing tasks and view the logs which allows you to work out what is going wrong.