Copied to clipboard

Flag this post as spam?

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


  • Jamie 35 posts 87 karma points
    May 18, 2011 @ 12:57
    Jamie
    0

    Emptying RecycleBin in Media deletes /media/ folder and all files within

    I have found a major problem with my Umbraco installation, I'm not sure if it is an incorrect permssion setting on a file or a plugin /setting mis-behaving and I need some hepl or guidence on how to trouble shoot this.

    I have found if I delete items in the media folder {via right click/delete/confirm delete} then empty the recycle bin ALL the 'physical' files on the HDD in the media folder are removed - infact the /media folder is removed altogether. and until I recreate it I can't even upload more images.

    I had a large collection of folders each with 20 ~ 60 or more image nodes in them, I removed some items and then emptied the recycle bin to find the nodes in the recycle bin gone, the main media nodes were all OK, but the files they linked to were displayed and no thumbnails as they had been deleted. The folders were made by 'hand' individually right clicking and making the folder, but the majority of images were all uploaded via the Geko Uploader plugin. I noticed that the plaugin stores the images on the disc as /media/nodeid/filename.extn (and associated thumb) where as if I made an image node and uploaded to it myself it was stored as /media/nodeid-filename.extn.

    I re-uploaded some images to some of the nodes and tested agian to see if it was re-peatable - and it was. I also remember as it counted down the deleted file list that it froze before completing - and it to be re-run. (I know it said not to close the window, but it went from 90 -> 33 in 15sec or so then sat for 2min on that 33, running again it completed quickly and all seemed well). When I repeated the deletion process it went without and pause / lock up and still delted the directory - so I don't think it is too relevent.

    Whats going on how can I find out how to stop this? This site is going to have many 'gallery folders' and they will chnage over time. If I - or anyone deltes one and emptys the recycle bin it could be disaterous. And if we dont I could end up storing GB's of un needed data.

    This also left me with the slow process of having to delete every broken image node one by one so I could use the bulk Geko Uploader again to populate the folders (as finding the matching file and re-uploading by hand seemed like an even slower task)

    umbraco v 4.5.2 (Assembly version: 1.0.3891.20719) installed and had started with the Creative Website Stater {by warren buckly 2..3} as a base, and added the Geko Uploader, Ucomponents plugin and Umbraco Log Mangager for Umbraco... and that is about all apart from some Css and template changes. I also have added an image cropper Data Type to the image Media Type.

  • Jamie 35 posts 87 karma points
    May 19, 2011 @ 12:43
    Jamie
    0

    I know my description looks daunting, but does any one have any ideas here?

  • Matt Watson 33 posts 55 karma points
    Mar 19, 2012 @ 12:27
    Matt Watson
    0

    Hi,

    Did you ever get an answer to this? I am getting the exact same issue in Umbraco 4.7

    Cheers, 

    Matt :)

  • Terry Kernan 4 posts 24 karma points
    Jul 13, 2012 @ 15:11
    Terry Kernan
    0

    I've also got this same issue!

  • vvsupport 20 posts 39 karma points
    Jul 18, 2012 @ 20:51
    vvsupport
    0

    Hi, I have the same issue in my test server and in my production server, I was wonder about internet hacking or something but after read this post I recall that yes I empty the recycle bins (content and media) in both servers and all my media files were gone in both servers. IIS7, SQL2008R2, UMB 4.7.1.1.

    thanks.

     

  • Henri Toivonen 77 posts 111 karma points
    Jul 20, 2012 @ 11:20
    Henri Toivonen
    0

    Oh wow, this looks like a terrible bug. But it has never happened to me, is there any good way to reproduce it?

  • Jamie 35 posts 87 karma points
    Jul 20, 2012 @ 12:20
    Jamie
    0

    OK guys, I only just saw there has been movement on this.

    Yes I eventually found out what this is.. at leat I think so stopping this one change has meant I have no had the problem again. If you have changed a setting in the umbraco config file so that Media uploads are not stored in folders by node image eg /media/1123/file_name.jpg but instead  as a single file list in the media folder eg /media/1123_file_name.jpg then upon emptying the recycle bin ALL files in the media folder in the file system are delted. the Database node structure remains but you lose media.

    from \config\umbracoSettings.config [line 22]

     <!-- should umbraco store the uploaded files like /media/xxx/filename.ext or like /media/xxx-filename.ext
    should be set to false if the aspnet account hasn't got readrights of the driveroot up to the /media directory -->
    <UploadAllowDirectories>True</UploadAllowDirectories>

    Why did I do this? This used to be a setting I'd change when settign the error404 handeler to a useful node ID. My logic in doing so was becuase I kept aa /Assets/ folder of static images inside my media folder for reference in my CSS - it seemed neat to have everythign in the media folder, but the A-Z sort view in Filemanager windows would of course put numbered folder names above my Assets folder meaning I'd have to scroll down to find it everytime. annyoing.So having media as a list of files meant my folder would sit at the top. That was my reasoning, I now just have the Assets folder in my /scripts/  with the css.

    Why does this happen. My guess is that the logic in the code was to remove the file and its container folder to ensure that any other files (eg thumbnails) that may have been created are removed. This logic back-fires if you have all files being stored in the root folder.

    I don't have a patch for it being just 'a user' and have simply stopped making that config change with new projects. Though I do still live in fear that a client using an older install will one day empty the recycle bin - so would be interested in a patch. Thank god I have a versiond back up system to fall back on.

     

    Hope this helps.

    [edited as  some code references were being removed. - why does it keep doing it!]

  • vvsupport 20 posts 39 karma points
    Jul 20, 2012 @ 17:11
    vvsupport
    0

    First at all, thank you so much for the answer I undertand the problem and I think that the Bug should be patched. I think that have a directory for each image is not a good solution for me ( I respect other opinions). umbraco give us  the option to store all images in same folder so I took that option . The ideal solution for me is some kind of match between logical folders and Physical folders in media section that will help to manage the pictures once we have thousands.

    Thanks Again.

  • Jamie 35 posts 87 karma points
    Jul 21, 2012 @ 05:56
    Jamie
    0

    vvsupport - yes I understand your thinking on this, it took me some time to realise the power and felixibility of letting umbraco handel media - about the same amount of time it took me to realy 'get' XLST. But once you do you will see that there is no real need for the virual file system to be reflected in the disc file system. If you are relying the the layout to stay the same on the disc for code purposes then you are relying on users never wanting to rename or move the 'virtual' folders around - which is just as bad as having to hope they don't delete the recycle bin.

  • Erik 18 posts 39 karma points
    Sep 27, 2012 @ 19:42
    Erik
    0

    FYI, I just had this bug occur on a 4.7.1 install but I already keep the media files in seperate folders (UploadAllowDirectories = true).

  • Erik 18 posts 39 karma points
    Sep 27, 2012 @ 20:53
    Erik
    0

    Lies... though UploadAllowDirectories = true already it seems that my files are saving under the media folder (probably some custom code) and thus causing the same issue. It would be great if this didn't happen.... it deleted +750mb of media files off of a production site.

  • Erik 18 posts 39 karma points
    Sep 27, 2012 @ 21:32
    Erik
    0

    This happened to me when I tried to delete a content node that referenced a media item that was a direct child of the media folder.

  • Erik 18 posts 39 karma points
    Sep 27, 2012 @ 22:58
    Erik
    0

    Has someone created a bug for this?

  • Erik 18 posts 39 karma points
    Oct 01, 2012 @ 16:16
    Erik
    0

    I found the bug for this issue. If you find this thread and want a solution then upvote this: http://issues.umbraco.org/issue/U4-172

Please Sign in or register to post replies

Write your reply to:

Draft