Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • mph 44 posts 78 karma points
    Jul 08, 2009 @ 11:59
    mph
    0

    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

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jul 08, 2009 @ 12:40
    Dirk De Grave
    0

    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

  • mph 44 posts 78 karma points
    Jul 08, 2009 @ 12:54
    mph
    0

    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

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jul 08, 2009 @ 13:10
    Dirk De Grave
    0

    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

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Jul 08, 2009 @ 13:26
    Peter Dijksterhuis
    0

    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

  • mph 44 posts 78 karma points
    Jul 08, 2009 @ 14:42
    mph
    0

    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

  • Martin Bentzen 83 posts 145 karma points
    Jul 08, 2009 @ 16:08
    Martin Bentzen
    0

    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.

  • Andrew McDonald 3 posts 20 karma points
    Jul 08, 2009 @ 17:26
    Andrew McDonald
    0

    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

  • mph 44 posts 78 karma points
    Jul 09, 2009 @ 10:42
    mph
    0

    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

  • mph 44 posts 78 karma points
    Jul 09, 2009 @ 13:25
    mph
    7

    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

     

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Jul 09, 2009 @ 13:34
    Peter Dijksterhuis
    100

    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.

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jul 09, 2009 @ 14:05
    Dirk De Grave
    0

    My vote as well! It would indeed be great if moderators could mark a post as solved as well...

    /Dirk

  • mph 44 posts 78 karma points
    Jul 09, 2009 @ 19:28
    mph
    0

    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

  • RolandWolters 32 posts 32 karma points
    Jul 10, 2009 @ 09:30
    RolandWolters
    0

    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?

  • mph 44 posts 78 karma points
    Jul 10, 2009 @ 10:39
    mph
    0

    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

  • sritchie 48 posts 80 karma points
    Aug 07, 2009 @ 02:26
    sritchie
    0

    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.

  • Nik Wahlberg 639 posts 1237 karma points MVP
    Aug 13, 2009 @ 17:12
    Nik Wahlberg
    0

    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

  • Nik Wahlberg 639 posts 1237 karma points MVP
    Aug 13, 2009 @ 17:12
    Nik Wahlberg
    0

    Oh, and I have around 1500 nodes in there...

  • RolandWolters 32 posts 32 karma points
    Oct 07, 2009 @ 14:47
    RolandWolters
    0

    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?

  • Nik Wahlberg 639 posts 1237 karma points MVP
    Oct 07, 2009 @ 17:42
    Nik Wahlberg
    2

    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

    Hope this helps.....

    -- Nik

  • w_moze 30 posts 25 karma points
    Oct 14, 2009 @ 22:01
    w_moze
    0

    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!

     

  • Nik Wahlberg 639 posts 1237 karma points MVP
    Oct 15, 2009 @ 03:28
    Nik Wahlberg
    0

    w_moze, check out the script and post above yours. :)

  • w_moze 30 posts 25 karma points
    Oct 20, 2009 @ 20:53
    w_moze
    0

    Got it! Guess you have to read the whole thread :)

  • RolandWolters 32 posts 32 karma points
    Nov 03, 2009 @ 14:35
    RolandWolters
    0

    I ran into some problems executing the script Nick posted. The problem is on the last statement:

    delete from 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.path like '%-20%' and Node.id!=-20 and
    not exists(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...

  • RolandWolters 32 posts 32 karma points
    Nov 03, 2009 @ 15:05
    RolandWolters
    0

    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.

  • w_moze 30 posts 25 karma points
    Apr 06, 2010 @ 23:47
    w_moze
    0

    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:

    USE

     

    [NCATE]

    GO

    ALTER

     

    TABLE [dbo].[umbracoNode] WITH CHECK ADD CONSTRAINT [FKumbracoNodeumbracoNode] FOREIGN KEY([parentID])

    REFERENCES

     

    [dbo].[umbracoNode] ([id])

    GO

    ALTER

     

    TABLE [dbo].[umbracoNode] CHECK%3

  • w_moze 30 posts 25 karma points
    Apr 07, 2010 @ 15:34
    w_moze
    0

    Looks like my previous post was corrupted.

    Here's the script I tried:

    USE

     

    [NCATE]

    GO

    ALTER

     

    TABLE [dbo].[umbracoNode] WITH CHECK ADD CONSTRAINT [FKumbracoNodeumbracoNode] FOREIGN KEY([parentID])

    REFERENCES

     

    [dbo].[umbracoNode] ([id])

    GO

    ALTER

     

    >

  • Danny 49 posts 104 karma points
    Jan 18, 2011 @ 17:41
    Danny
    0

    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)

  • Mike Chambers 636 posts 1253 karma points c-trib
    Mar 19, 2011 @ 00:05
    Mike Chambers
    2

    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

  • Tom Allen 50 posts 71 karma points
    Oct 25, 2011 @ 12:18
    Tom Allen
    0

    I got this script working by adding ON DELETE CASCADE to the FK_cmsContentVersion_cmsContent constraint in the cmsContentVersion table...

  • Mikkel B. Mikkelsen 52 posts 81 karma points
    Apr 09, 2013 @ 15:03
    Mikkel B. Mikkelsen
    0

    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!

  • wolulcmit 357 posts 693 karma points
    Jul 08, 2013 @ 13:09
    wolulcmit
    0

    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
Please Sign in or register to post replies

Write your reply to:

Draft