The problem was solved updating customdata field from mdl_task_adhoc, removing the module id that is causing the error from the list of modules in customdata field. We had to intervene directly in moodle database.
Re: One Adhoc task failing -> [Deletion in progress] for all modules
Re: One Adhoc task failing -> [Deletion in progress] for all modules
I get the following error in cron in moodle 3.6.3:
Adhoc task failed: core_course\task\course_delete_modules,Detectado un error de codificación, debe ser corregido por un programador: The course module 278134 could not be deleted. #0 /home/produccion/public_html/admin/tool/recyclebin/lib.php(151): tool_recyclebin\course_bin->store_item(Object(stdClass))
#1 /home/produccion/public_html/course/lib.php(1141): tool_recyclebin_pre_course_module_delete(Object(stdClass))
#2 /home/produccion/public_html/course/classes/task/course_delete_modules.php(66): course_delete_module('278134')
#3 /home/produccion/public_html/lib/cronlib.php(185): core_course\task\course_delete_modules->execute()
#4 /home/produccion/public_html/lib/cronlib.php(74): cron_run_inner_adhoc_task(Object(core_course\task\course_delete_modules))
#5 /home/produccion/public_html/admin/cron.php(81): cron_run()
#6 {main}
With the following query, I located the indicated record: SELECT * FROM `mdl_task_adhoc` WHERE customdata like '% 278134%'
{"cms":[{"id":"278134","course":"5146","module":"17"........
I understand that I will delete the following value: "id": "278134" leaving it like this: "id": ""
Confirm please. Thank you.
Re: One Adhoc task failing -> [Deletion in progress] for all modules
Hi Moisés,
My customdata was something like:
{"cms":{"52650":{"id":"52650"},"52651":{"id":"52651"},"52652":{"id":"52652"},"52667":{"id":"52667"},"52668":{"id":"52668"}....
What I did was remove the entire "52667":{"id":"52667"}. So I updated the field to something like:
{"cms":{"52650":{"id":"52650"},"52651":{"id":"52651"},"52652":{"id":"52652"},"52668":{"id":"52668"}....
In my case I removed the entire record related to that id.
Best,
susana
Re: One Adhoc task failing -> [Deletion in progress] for all modules
Hi Susana.
What do you mean by deleting the entire record related to it? Which table or tables are you referring to?
Thanks
Re: One Adhoc task failing -> [Deletion in progress] for all modules
Hi Jerry,
For instance, you don't want the task to delete the module 52655. Here's what I did:
select id,customdata from mdl_task_adhoc where id=36893;
id | customdata ---------------- 36893 | {"cms":{"52650":{"id":"52650"},"52651":{"id":"52651"},"52652":{"id":"52652"},"52653":{"id":"52653"},"52654":{"id":"52654"},"52655":{"id":"52655"},"52739":{"id":"52739"}},"userid":"3094","realuserid":"3094"}
update mdl_task_adhoc set customdata = '{"cms":{"52650":{"id":"52650"},"52651":{"id":"52651"},"52652":{"id":"52652"},"52653":{"id":"52653"},"52654":{"id":"52654"},"52739":{"id":"52739"}},"userid":"3094","realuserid":"3094"}' where id=36893;
So, I removed the reference to 52655 from the list of modules.
Best!
susana
Re: One Adhoc task failing -> [Deletion in progress] for all modules
Ah yes.. that is what I thought.. you just copied the original data and removed the offending modules in the query string.
But if you remove it, how do you know if the removed module(s) is actually removed or behaving properly?
Thanks
Re: One Adhoc task failing -> [Deletion in progress] for all modules
In my case, the "offending modules" were not visible anywhere. I actually did not solve any problem with that modules because they were not shown to the user. It seems they were deleted before but, for some reason, still appearing in that list (customdata field, mdl_task_adhoc table).
So after suppressing those "offending modules" from the list of modules, the scheduled task no longer fails at the scheduled time and all the other modules from the list are actually removed. The whole entry is also removed from mdl_task_adhoc table and the modules which had "deletion in progress" label before finally disappear from gradebook... that was my real problem.
This is more of a workaround than a proper solution...
What should be really done:
- Understand the problem with that external module and correct it;
- Propose a solution for moodle in order to keep the deletion task of the modules even if it finds any problematic module.
Best,
susana
Re: One Adhoc task failing -> [Deletion in progress] for all modules
I have the same warning in the gradebook after 24hr and have found several offending modules in my cron logs (10-15) , is there any downside risk to removing them all from the mdl_task_athoc ? What risk is associated with removing modules here?
My mdl_task_athoc table is somewhat lengthy, should I focus on every record that references the offending modules or should they all be found in 1 record?
Will this adversely effect anything else in moodle? From what I can see now it 1] prevents the Recycle Bin from working and 2] displays the warning in the gradebook to teachers for deleted Quizzes? Are any other cron jobs not being run?
I suspect the problem is related to 1-2 plugins that didnt uninstall properly in the past. I tried uninstalling one of them again but got a 503 error while in moodle 3.3.6, since then I have upgraded to 3.5.5 should I try uninstalling the plugin again (its currently 'missing from disk') ?
Re: One Adhoc task failing -> [Deletion in progress] for all modules
Is another workaround Disabling the Recycle Bin, or will the warning still appear in the Gradebook?
If this can mitigate the problem I can live without the recycle bin (Ill miss it!) if that ensures everything else functions as expected.
Re: One Adhoc task failing -> [Deletion in progress] for all modules
I would make a copy of the production to a test system. everything must be the same include os, moodle version/build, php, db, web server, etc. and configuration settings
In the test system, uninstall the offending module and install the newer versions.
They run the cron.php again for a few days.. if you still see it in the adhoc_task table, I would remove the offending one.
You can also contact the developer of the plugin and let them know what is going on.
good luck
Re: One Adhoc task failing -> [Deletion in progress] for all modules
Fresh install of moodle 3.5.5 and we are getting the error again,
has moodle addressed this problem in newer versions?