Umbraco CMS no node exists with id ‘-21’ bug

I need to share that with you,

I was uploading media using a useful plugin gecko uploadify for Umbraco CMS. Suddenly the Media folder gets empty and all nodes disappeared. I get frustrated because I never realised how this happened. I tried to clear sessions log in again but still no children under the media folder.

So I post that to the Umbraco community (well you can find the post here.), a nice person Tom helped me to find out what went wrong, well actually helped me to find a solution for that and not actually to realise why this happened. Tom helped me on how to debug this, so I found out that there was no children because of a 500 server error. Actually there was an error

No node exists with id '-21'

That means that the recycle bin folder under the Umbraco media section has been deleted for some reason. No matter how this happened I needed a solution to that problem because our client needs the Media folder lol. So Tom again suggest me that post where Damiano shared an SQL script to recreate the Recycle bin. Of course I had a DB back up before trying anything. Then I execute the script and everything ent back to normal. Here is the SQL script

SET IDENTITY_INSERT umbracoNode ON
INSERT INTO umbracoNode (id, trashed, parentID, nodeUser, [level], path, sortOrder, uniqueID, text, nodeObjectType, createDate)
VALUES (- 21, 0, - 1, 0, 0, N'-1,-21', 0, 'bf7c7cbc-952f-4518-97a2-69e9c7b33842', N'Recycle Bin', 'cf3d8e34-1c1c-41e9-ae56-878b57b32113', CONVERT(DATETIME, '2011-03-08 16:48:48', 102))
SET IDENTITY_INSERT umbracoNode OFF

Well I post that to codeplex, please vote for that so developers can hopefully have a look at that. The thing is how that happened. If anyone has any ideas please share it with us. Hopefully it will save your time if this happened to you.

Please share your thoughts with me.

Share it!Share on Google+Share on FacebookTweet about this on TwitterShare on LinkedInShare on StumbleUpon

Leave a reply

Your email address will not be published. Required fields are marked *

Back to Top