Calling all developers! We invite you to provide your input on Feature Experimentation by completing this brief survey.

 

Error when trying to empty the recycle bin

Vote:
 

I am having problems emptying the recycle bin in Episerver. I have approximately 16,000 items in the bin, and I receive a timeout error whenever I try and empty this. I have tried on several occasions to do this, but I receive the same error each time.

Is there another way to do this to get around the error?

#163916
Oct 24, 2016 9:58
Vote:
 

Hi Sam,

Have you tried to run a scheduled job "Automatic Emptying of Trash"? It shouldn't time out.

#164182
Oct 24, 2016 11:57
Vote:
 

When I tried running the scheduled task, it came up with the following error 'Connect failed'. I've been trying to work out of there is a SQL query that I can run directly on the database, but wanted to make sure that I don't leave loads of orphaned data in the DB.

#164183
Oct 24, 2016 12:14
Vote:
 

Hi, Sam,

In case of many content items in the recycle bin, I'd suggest going to DB directly (Do back it up first). The timeout can be increased, however, if it's that many items, you'd need to increase it too much and it's valid for any other queries Epi executes.

So, instead, backup and run a SP called editDeleteChilds with page ID of recycle bin (usually 2).

Then, make sure to set up the scheduled job to get executed regularily :)

BR,
Marija

#170690
Oct 26, 2016 15:56
Vote:
 

Hi Sam,

Agree with Marija but before that it is good idea to run this query " SELECT pkId, COUNT(*) FROM tblWorkPage GROUP BY pkID ORDER BY 2 DESC" and then from the sql result run editDeleteChilds with id of the page .. remember there is argument for editDeleteChilds for ForceDelete which if you pass "1" it will deleted even it is linked!

#170707
Oct 27, 2016 6:24
Vote:
 

Thanks Marija and  Aria for your replies. I've just got my DBA to run the SP and although it did delete some items (around 1000), we are now receiving a constrainst error. When we try and re-run again, no further items are deleted.

Do we need to stop the main episerver service to get this to work?

#171197
Nov 02, 2016 14:06
Eric - Jan 02, 2025 11:36
Could be worth mentioning that, if I remember correct, the scheduler does not delete all items it only deletes items older then a certain number of days. So the trash bin will not be empty. To remove all you need to do it from Edit not run the scheduler. Also If you have deleted a structure you could create a plugin removing all items from the ID of that page. Might be a bit more secure then running a SP directly towards the database.

In our projects we have the same problem from time to time so instead of running an SP we have a plugin removing nodes with large amount of children manually directly from the recycle bin.
Vote:
 

In case anyone comes across this topic, there is an article here on this issue and how to resolve

https://support.optimizely.com/hc/en-us/articles/360002082371-Unable-to-empty-Episerver-trash-due-to-corrupt-files-or-excessive-files

#330614
Sep 27, 2024 16:10
Vote:
 

We solved a similar issue by requesting a temporary upscale of the database. The project was hosted on DXP.

A -brief- proper upscale allowed us to run the job properly and delete some larger recycle bins.

#334858
Dec 27, 2024 14:47
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.