I've upgrade our Umbraco site from 3.06 to 4.0, 4.0.1 and finally 4.0.2.1
And throughout the process I've been unable to empty the recyle bin, the progress bar just keeps running and stating that there's 156 items remaining, and yes I've left it running for hours...
Could I have som DB problems preventing the emptying?
Is there perhaps a "magic bullet" ie. sql script which could empty the recyle bin?
Have you checked whether all script files are still in place and all permissions settings are correct. Also, have you checked the page using firebug in Firefox?
I'm fairly sure it's not your db, otherwise you wouldn't be able to do anyting in the backend?
Firefox has some great addon and extensions that allow to more actively profile what is going on. I'd suggest to install firefox and firebug extension. It'll tell you lots about what is going there as I'm quite sure a script file is responsible for this.
I've installed Firefox and the Firebug extension, I'm however a bit unsure of what I should be on the lookout for...
I've managed to find the script being run to empty the recycle bin (code below), I can however not find the umbraco.presentation.webservices.trashcan.EmptyTrashcan webservice... I suppose it's compiled code and only visible in the sourcecode.
Michael
<script type="text/javascript"> 1 2 3 var emptyTotal = '156'; 4 5 function emptyRecycleBin() { 6 jQuery('#formDiv').hide(); 7 jQuery('#buttons').hide(); 8 jQuery('#animation').show(); 9 jQuery('#anim').attr("src","/umbraco_client/images/progressBar.gif"); 10 11 // call the empty trashcan webservice 12 umbraco.presentation.webservices.trashcan.EmptyTrashcan(); 13 14 // wait one second to start the status update 15 setTimeout('updateStatus();', 1000); 16 } 17 18 function updateStatus() { 19 umbraco.presentation.webservices.trashcan.GetTrashStatus(updateStatusLabel, failure); 20 } 21 22 function failure(retVal) { 23 alert('error: ' + retVal); 24 } 25 26 function updateStatusLabel(retVal) { 27 jQuery('#statusLabel').html("<strong>" + retVal + " Remaining</strong>"); 28 29 if (retVal != '' && retVal != '0') { 30 setTimeout('updateStatus();', 500); 31 } else { 32 jQuery('#div_form').hide(); 33 jQuery('#notification').show(); 34 jQuery('#notification').html("<p>The recycle bin is now empty </p> <p><a href='#' onClick='top.closeModal()'>Close this window</a></p>"); 35 top.reloadCurrentNode(); 36 } 37 38 } 39
I cleaned out the DB manually for any nodeids in the -20 parent (recycle bin) + childnodes of those nodes and related nodes in cmsDocument, cmsContent and cmsPropertyData.
Finally the recycle bin is empty...
The core problem is however not solved, when new items are placed in the recycle bin, it's still not possible to empty the recycle bin, unless removing the nodeids manually from the DB.
Yeah, too bad I couldn't mark the post as solved, but I marked Peters remark instead, and just above that post is my solution, so hopefully others in search of this will find the solution without too much trouble :)
Check your lucene.net.dll version in /bin - must be 2.0.0.4 (if you're running v.4)
Check your _systemUmbracoIndexDontDelete folder, there has to be at least 3 files in this folder ( one or more .cfs files and one deletabel and segments file). If these files aren't present your index isn't correctly build. You can reindex by loading this page <server>/umbraco/reindex.aspx. Push the refresh LINK to see the progress (can take a while).
I've had this same issue on an upgraded site. Followed *ALL* of the suggestions above (Including ensuring I have the correct Lucene version & reindexed, and the recycle bin is still hanging (I currently have 131 Items).
I have sort of the same problem. Except in my case the number of nodes to delete increase everytime I try to empty the recycle bin. Michael, do you mind sharing your SQL script for deleting the recycle bin nodes? I am about to do a deployment and am kinda stuck.
I have the same problem. Followed all the steps in this topic but still can't empty the bin. The umbracolog shows an error compaining about some file missing in the "don't delete" folder but I have re-indexed a few time so I am kind of stuck. Anyone has some db script to get rid of these deleted items?
Here is what I use. I got this from @drobar and made a few mods. I am going to pass on his message to you....this is not sanctioned functionality and is therefore used at your own risk. I can say, it's worked beautifully for me.
-- Uncomment below to verify the number of nodes returned is the -- same as the number of nodes that is in the Recycle Bin -- select * from umbracoNode where path like '%-20%' and id!=-20
-- Delete all 'related' nodes and table contents... delete from cmsContent where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20)
delete from cmsContentXML where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20)
delete from cmsDocument where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20)
delete from cmsPropertyData where contentNodeId in (select id from umbracoNode where path like '%-20%' and id!=-20)
-- delete the XML nodes.... delete from umbracoNode where path like '%-20%' and id!=-20
I'm having the same issue. I've made sure the Lucene dll is the 2.0.0.4 version, I've deleted the "_systemUmbracoIndexDontDelete" and re-indexed and am still unable to remove the items in the recycle bin. Does anyone have a sql script to clean up the db on the backend? Any help would be appreciated!
I ran into some problems executing the script Nick posted. The problem is on the last statement:
deletefrom umbracoNode where path like '%-20%'and id!=-20
The error is: The DELETE statement conflicted with the SAME TABLE REFERENCE constraint "FK_umbracoNode_umbracoNode"
It seems that some of the data are actually nodes that serve as parent for some other nodes. So I changes the script to delete only those node that are not used by another node as parent. We cannot execute recursive sql (well exept if using a storeprocedure) but If you execute the statement a few times then the nodes should be deleted. Right? Here is the statement I used:
delete
Node from umbracoNode Node
where Node.pathlike'%-20%'and Node.id!=-20 and notexists(select*from umbracoNode childNode where childNode.parentID=Node.id)
Like I said, that should do the trick. So I checked it by trying to empty the recylcebin in the Umbraco backend. WTF?! still 84 items left (we started with over 550 items). And worst of all... umbraco is not deleting them for me :(
So now some investigation, and that really shocked me.
I found a node (1602) with this path: -1,-20,1102,1602 (-20 so it must be in the bin). So I searched the table and sure I found a node (1603) that has this node as parent. But the path here is -1,1063,1189,1187,1188,1102,1602,1603 so that is NOT in the recycle bin. I cannot find it in the content tree either, so it must be some corrupted leftover but........ how... what...
Hmm I am still working on this -because the full bin annoyes me simply :) - and it seems to occur a lot that soem roque noe is out there with a node in it's path that is actually in the recycle bin. Sometime I have to follow node up the tree more then one node.
I can't seem to do this in a single sql script so i'll write a .net control that does this and put it somewhere in the backend's app tree. I allready had in mind to create a maintenance section to clean up orphin media items (items that are on the harddisk but not in the media section tree), so this will be there too I think.
I manually deleted the items using sl server management studio to access the table umbracoNodes but accidentilly removed the foriegn key (FKumbracoNodeumbracoNode) and can't seem to figure out how to put it back. I've tried this:
I had to update the script for 4.5.2 to take account of new tables? and the order to ensure no foreign key constraint errors... thought I'd share.
-- Uncomment below to verify the number of nodes returned is the -- same as the number of nodes that is in the Recycle Bin -- select * from umbracoNode where path like '%-20%' and id!=-20 -- Delete all 'related' nodes and table contents... delete from cmsPreviewXml where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20) delete from cmsContentVersion where contentId in (select id from umbracoNode where path like '%-20%' and id!=-20) delete from cmsDocument where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20) delete from cmsContentXML where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20) delete from cmsContent where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20) delete from cmsPropertyData where contentNodeId in (select id from umbracoNode where path like '%-20%' and id!=-20) -- delete the XML nodes.... delete from umbracoNode where path like '%-20%' and id!=-20
Sorry to revive this old thread, but I'm having a similar issue in version 4.11.5 and the SQL commands posted here doesn't fix it. I'm not particularly knowledgable when it comes to the Umbraco database, so hopefully some of you can help me. I'm getting the following error when running script posted by Mike Chambers:
Msg 547, Level 16, State 0, Line 16 The DELETE statement conflicted with the SAME TABLE REFERENCE constraint "FK_umbracoNode_umbracoNode". The conflict occurred in database "DatabaseName", table "dbo.umbracoNode", column 'parentID'.
This worked for me (if you're still having trouble) Use at your own risk!
begin transaction -- Uncomment below to verify the number of nodes returned is the -- same as the number of nodes that is in the Recycle Bin -- select * from umbracoNode where path like '%-20%' and id!=-20 -- Delete all 'related' nodes and table contents... delete from cmsPreviewXml where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20) delete from cmsContentVersion where contentId in (select id from umbracoNode where path like '%-20%' and id!=-20) delete from cmsDocument where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20) delete from cmsContentXML where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20) delete from cmsContent where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20) delete from cmsPropertyData where contentNodeId in (select id from umbracoNode where path like '%-20%' and id!=-20) delete from umbracoRelation where parentId in (select id from umbracoNode where path like '%-20%' and id!=-20) delete from umbracoRelation where childId in (select id from umbracoNode where path like '%-20%' and id!=-20)
ALTER TABLE umbracoNode NOCHECK CONSTRAINT FK_umbracoNode_umbracoNode delete umbracoNode where id in (select id from umbracoNode where path like '%-20%' and id!=-20) ALTER TABLE umbracoNode CHECK CONSTRAINT FK_umbracoNode_umbracoNode
-- delete the XML nodes.... delete from umbracoDomains WHERE domainRootStructureID in (SELECT id FROM umbracoNode WHERE path like '%-20%' and id != -20) delete from umbracoNode where path like '%-20%' and id!=-20 commit transaction
Empty recyle bin does not complete
Hi,
I've upgrade our Umbraco site from 3.06 to 4.0, 4.0.1 and finally 4.0.2.1
And throughout the process I've been unable to empty the recyle bin, the progress bar just keeps running and stating that there's 156 items remaining, and yes I've left it running for hours...
Could I have som DB problems preventing the emptying?
Is there perhaps a "magic bullet" ie. sql script which could empty the recyle bin?
Best regards,
Michael Pultz-Hansen
Hi Michael,
Have you checked whether all script files are still in place and all permissions settings are correct. Also, have you checked the page using firebug in Firefox?
Cheers,
/Dirk
Hi Dirk,
permissions are correct, IIS_WPG have modify rights from root and down.
I'm unsure about the scripts, how would I check that?
I have not tried Firefox.
I'm fairly sure that the problems are DB related... but any suggestions are welcome :)
Michael
I'm fairly sure it's not your db, otherwise you wouldn't be able to do anyting in the backend?
Firefox has some great addon and extensions that allow to more actively profile what is going on. I'd suggest to install firefox and firebug extension. It'll tell you lots about what is going there as I'm quite sure a script file is responsible for this.
Cheers,
/Dirk
I've seen the same behaviour on an upgraded site. I didn't have time to investigate what it caused though.
Closing the screen and doing it a couple of times fixed the slowness though in my situation.
I'll see if I can investigate this when I have some extra time.
PeterD
Hi Dirk!
I've installed Firefox and the Firebug extension, I'm however a bit unsure of what I should be on the lookout for...
I've managed to find the script being run to empty the recycle bin (code below), I can however not find the umbraco.presentation.webservices.trashcan.EmptyTrashcan webservice... I suppose it's compiled code and only visible in the sourcecode.
Michael
<script type="text/javascript">
1
2
3 var emptyTotal = '156';
4
5 function emptyRecycleBin() {
6 jQuery('#formDiv').hide();
7 jQuery('#buttons').hide();
8 jQuery('#animation').show();
9 jQuery('#anim').attr("src","/umbraco_client/images/progressBar.gif");
10
11 // call the empty trashcan webservice
12 umbraco.presentation.webservices.trashcan.EmptyTrashcan();
13
14 // wait one second to start the status update
15 setTimeout('updateStatus();', 1000);
16 }
17
18 function updateStatus() {
19 umbraco.presentation.webservices.trashcan.GetTrashStatus(updateStatusLabel, failure);
20 }
21
22 function failure(retVal) {
23 alert('error: ' + retVal);
24 }
25
26 function updateStatusLabel(retVal) {
27 jQuery('#statusLabel').html("<strong>" + retVal + " Remaining</strong>");
28
29 if (retVal != '' && retVal != '0') {
30 setTimeout('updateStatus();', 500);
31 } else {
32 jQuery('#div_form').hide();
33 jQuery('#notification').show();
34 jQuery('#notification').html("<p>The recycle bin is now empty </p> <p><a href='#' onClick='top.closeModal()'>Close this window</a></p>");
35 top.reloadCurrentNode();
36 }
37
38 }
39
I had a similar problem (also on an upgraded site).
I solved it by emptying the bin several times, when the counter was hangin for about 5 min. It took some time, but finaly it was empty.
If you hit the problem, the easiest cheat is to empty it regularly, it only seems to be a problem when you've got lots of content in their
Thank you for your inputs...
I cleaned out the DB manually for any nodeids in the -20 parent (recycle bin) + childnodes of those nodes and related nodes in cmsDocument, cmsContent and cmsPropertyData.
Finally the recycle bin is empty...
The core problem is however not solved, when new items are placed in the recycle bin, it's still not possible to empty the recycle bin, unless removing the nodeids manually from the DB.
Perhaps the problem is related to this issue I've reported on codeplex: http://umbraco.codeplex.com/WorkItem/View.aspx?WorkItemId=23423
Michael
SOLVED!
After reading this post: http://forum.umbraco.org/yaf_postst9252_Empty-recyclebin-error-v4.aspx
It occurred to me that indexes play a major role in deleting elements in Umbraco.
We have kept the old Lucene.Net.dll (1.9.0.0) due to compatibility issues with our website search.
After putting the Lucene.Net.dll (2.0.0.4) that's shipped with Umbraco V.4 in the bin folder and trying to delete - everything works like a charm!
(I did however first delete the files in /data/_systemUmbracoIndexDontDelete to force a new reindex of the site.)
The related problem at codeplex (umbraco.codeplex.com/.../View.aspx?...Id=23423</span> ) is also solved by using the correct version of Lucene.Net.dll.
Thank you all for your assistance - I hope my troubles will assist in troubleshooting an upgraded site with delete issues in the future :)
Michael
Good! Too bad you can't mark your own post as solved here, but you got my vote for it :)
Thanks for investigating, this is something I probably need to check on my site as well.
My vote as well! It would indeed be great if moderators could mark a post as solved as well...
/Dirk
Yeah, too bad I couldn't mark the post as solved, but I marked Peters remark instead, and just above that post is my solution, so hopefully others in search of this will find the solution without too much trouble :)
Michael
Sadly this did not work for me.
I have a recyclebin with 206 items in it. I cannot empty it... the screen "deleting" stays up forever "206 remaining".
This is what I did
- emptied _systemUmbracoIndexDontDelete folder
- installed the umbracoUtilities Package
- after install let umbSearch do an index build
............ try to empty recycle bin. No luck.
new idea's? Did I miss something?
Check your lucene.net.dll version in /bin - must be 2.0.0.4 (if you're running v.4)
Check your _systemUmbracoIndexDontDelete folder, there has to be at least 3 files in this folder ( one or more .cfs files and one deletabel and segments file). If these files aren't present your index isn't correctly build. You can reindex by loading this page <server>/umbraco/reindex.aspx. Push the refresh LINK to see the progress (can take a while).
Hope this helps you out :)
Michael
I've had this same issue on an upgraded site. Followed *ALL* of the suggestions above (Including ensuring I have the correct Lucene version & reindexed, and the recycle bin is still hanging (I currently have 131 Items).
Any other suggestions?
Appreciate any help on this one.
I have sort of the same problem. Except in my case the number of nodes to delete increase everytime I try to empty the recycle bin. Michael, do you mind sharing your SQL script for deleting the recycle bin nodes? I am about to do a deployment and am kinda stuck.
Thanks,
Nik
Oh, and I have around 1500 nodes in there...
I have the same problem. Followed all the steps in this topic but still can't empty the bin. The umbracolog shows an error compaining about some file missing in the "don't delete" folder but I have re-indexed a few time so I am kind of stuck. Anyone has some db script to get rid of these deleted items?
Here is what I use. I got this from @drobar and made a few mods. I am going to pass on his message to you....this is not sanctioned functionality and is therefore used at your own risk. I can say, it's worked beautifully for me.
Hope this helps.....
-- Nik
I'm having the same issue. I've made sure the Lucene dll is the 2.0.0.4 version, I've deleted the "_systemUmbracoIndexDontDelete" and re-indexed and am still unable to remove the items in the recycle bin. Does anyone have a sql script to clean up the db on the backend? Any help would be appreciated!
w_moze, check out the script and post above yours. :)
Got it! Guess you have to read the whole thread :)
I ran into some problems executing the script Nick posted. The problem is on the last statement:
The error is: The DELETE statement conflicted with the SAME TABLE REFERENCE constraint "FK_umbracoNode_umbracoNode"
It seems that some of the data are actually nodes that serve as parent for some other nodes. So I changes the script to delete only those node that are not used by another node as parent. We cannot execute recursive sql (well exept if using a storeprocedure) but If you execute the statement a few times then the nodes should be deleted. Right? Here is the statement I used:
Like I said, that should do the trick. So I checked it by trying to empty the recylcebin in the Umbraco backend. WTF?! still 84 items left (we started with over 550 items). And worst of all... umbraco is not deleting them for me :(
So now some investigation, and that really shocked me.
I found a node (1602) with this path: -1,-20,1102,1602 (-20 so it must be in the bin). So I searched the table and sure I found a node (1603) that has this node as parent. But the path here is -1,1063,1189,1187,1188,1102,1602,1603 so that is NOT in the recycle bin. I cannot find it in the content tree either, so it must be some corrupted leftover but........ how... what...
Hmm I am still working on this -because the full bin annoyes me simply :) - and it seems to occur a lot that soem roque noe is out there with a node in it's path that is actually in the recycle bin. Sometime I have to follow node up the tree more then one node.
I can't seem to do this in a single sql script so i'll write a .net control that does this and put it somewhere in the backend's app tree. I allready had in mind to create a maintenance section to clean up orphin media items (items that are on the harddisk but not in the media section tree), so this will be there too I think.
I manually deleted the items using sl server management studio to access the table umbracoNodes but accidentilly removed the foriegn key (FKumbracoNodeumbracoNode) and can't seem to figure out how to put it back. I've tried this:
Looks like my previous post was corrupted.
Here's the script I tried:
To not violate referential integrity I had to execute this query first in the provided script (Using version 4.5.2)
delete from cmsContentVersion where ContentId IN (select id from umbracoNode where path like '%-20%' and id!=-20)
I had to update the script for 4.5.2 to take account of new tables? and the order to ensure no foreign key constraint errors... thought I'd share.
I got this script working by adding ON DELETE CASCADE to the FK_cmsContentVersion_cmsContent constraint in the cmsContentVersion table...
Sorry to revive this old thread, but I'm having a similar issue in version 4.11.5 and the SQL commands posted here doesn't fix it. I'm not particularly knowledgable when it comes to the Umbraco database, so hopefully some of you can help me. I'm getting the following error when running script posted by Mike Chambers:
Msg 547, Level 16, State 0, Line 16
The DELETE statement conflicted with the SAME TABLE REFERENCE constraint "FK_umbracoNode_umbracoNode". The conflict occurred in database "DatabaseName", table "dbo.umbracoNode", column 'parentID'.
Any help is appreciated!
This worked for me (if you're still having trouble)
Use at your own risk!
is working on a reply...