Can't remove [Deletion in progress]activities Moodle 3.4

Can't remove [Deletion in progress]activities Moodle 3.4

by Umam Mustain -
Number of replies: 13

Hello! I have a problem with deleting course activities. When I delete some activity or even resource it doesn't end up in "Recycle bin". But when I go to the "Gradebook setup" it shows the activities as [Deletion in progress] and a Warning: Activity deletion in progress! Some grades are about to be removed. There is no option to delete the activities from the Gradebook even.


I tried running cron.php manually and purging the cash but nothing seems to be working. I am totally at a loss. If anyone knows any solution please help me.

Average of ratings: -
In reply to Umam Mustain

Re: Can't remove [Deletion in progress]activities Moodle 3.4

by Mark Sharp -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

It could be that another task is blocking everything. This happens if the adhoc task fails.

Have a look in your mdl_task_adhoc to see if it's filling up.

Average of ratings: Useful (2)
In reply to Mark Sharp

Re: Can't remove [Deletion in progress]activities Moodle 3.4

by Umam Mustain -

Can you please tell me where can I find that file. I am fairly new to Moodle. 

In reply to Umam Mustain

Re: Can't remove [Deletion in progress]activities Moodle 3.4

by Mark Sharp -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

mdl_task_adhoc is a database table. When Moodle tries to delete things from the Rubbish bin, it queues up the items to be deleted in this table.

When cron runs it basically runs to processes: scheduled tasks & adhoc tasks. Course module deletions get put in the mdl_task_adhoc table. If you're able to view the cron logs, you'll see if the adhoc tasks are failing. It may showing a "locking" error. If it's failing this way, cron just stops, so it never gets to run any other adhoc task.


Average of ratings: Useful (1)
In reply to Mark Sharp

Re: Can't remove [Deletion in progress]activities Moodle 3.4

by Nadav Kavalerchik -
Picture of Core developers Picture of Plugin developers Picture of Testers Picture of Translators

Thanks. it helped smile

I also had to temporarily comment out the exception at the "public function __destruct()" lib/classes/lock/lock.php

to clear all the pending locks that accumulated in the table. run cron from CLI. to clear it. and un comment it back. Now, course grades get re calculated quickly when I delete a module from any course smile 

In reply to Nadav Kavalerchik

Re: Can't remove [Deletion in progress]activities Moodle 3.4

by ahmed galal -

please

Possible to send the steps step 

In reply to Mark Sharp

Re: Can't remove [Deletion in progress]activities Moodle 3.4

by arnel marquez -

Hi Mark,

Good day.

I just want a clarification, so this table mdl_task_adhoc should be empty?

I run sql and it contains lot of things. Should delete its content?

thanks

arnel

Attachment mdl_task_adhoc.jpg
In reply to arnel marquez

Re: Can't remove [Deletion in progress]activities Moodle 3.4

by Tomasz Król -

Still an issue to me.

What is the solution?


In reply to Umam Mustain

Re: Can't remove [Deletion in progress]activities Moodle 3.4

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

I tried running cron.php manually

Please set the debugging level to the most verbose developer debugging level and run the cron manually again. Copy the cron output and attach it here or paste it to some temporary area (such as PasteBin.com or a similar place) so that we can look at it.

In reply to Umam Mustain

Re: Can't remove [Deletion in progress]activities Moodle 3.4

by Diane Soini -

Hey, I want to try to help you or anyone else who happens by if the problem is the same for them.

In my case the problem was with the ouwiki activity module. If you deleted an ouwiki activity from the course, it would break the gradebook. I discovered this when I exported a course with an ouwiki and imported it to create a new course. I saw an error message after the import that said "You have declared one of ouwiki_grade_item_update and ouwiki_update_grades but not both. This will cause broken behaviour."

Sure enough, the module didn't define both functions. I put in an issue with the ouwiki people.

If you don't have an ouwiki, you might try the same trick I did and see if some other module has a similar problem.

Average of ratings: Useful (1)
In reply to Diane Soini

Re: Can't remove [Deletion in progress]activities Moodle 3.4

by Susana L. -

Hi!

We are also experiencing a similar problem:

1) Grade book with items labeled [Deletion in progress]
2) some items on mdl_task_adhoc (3 items)
3) error messages on moodle_cron.log ("Adhoc task failed: core_course\task\course_delete_modules... The course module xxxx could not be deleted.")

When searching for the modules referenced on moodle_cron log we could understand they were all Turnitin assignment modules restored from old courses. We know we usually get an error when trying to restore a course with a Turnitin module in it, so we tell teachers to disable turnitin modules on restore. But some of them forget to do it...

Now my question is: what is the best approach to solve this kind of issue?

Thank you!
susana

PS: Moodle 3.5 - PostgreSQL

In reply to Susana L.

Re: Can't remove [Deletion in progress]activities Moodle 3.4

by Diane Soini -

This is a good question. Is it enough to delete the instances of these items in the mdl_modwhatever table?

In reply to Diane Soini

Re: Can't remove [Deletion in progress]activities Moodle 3.4

by Susana L. -

Hi Diane,

When trying to find those items in mdl_turnitintooltwo module, they were not there. And I think the problem is related to that. The items only exist in mdl_course_modules with "instance" field "0".

Here's my recent post: https://moodle.org/mod/forum/discuss.php?d=382972

Thank you for your input.

Best,
susana