Jump to:

23450 Posts in 18899 Topics by 2877 members

General Questions

SilverStripe Forums » General Questions » Files & images disappearing from assets directory

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 741 Views
  • benjamin-smith
    Avatar
    Community Member
    17 Posts

    Files & images disappearing from assets directory Link to this post

    Hi all. The person over here - http://www.silverstripe.org/general-questions/show/9784 - was having a similar issue as me in 2009 on SS 2.3.3 - no solution was posted.

    Basically, sometime in the last month, all of the images on the assets folder are lost on the filesystem for 2 sites. This includes the upload files, as well as any files created by SS (_resampled).

    I have used SS on 100+ sites, including 20 others on the same server. This has happened to me on two different sites on two different servers.

    On the first site, I am running 2.4.0 on a LAMP server, with DOM, userforms, google sitemaps. All rows in the File table are lost. This site has been used in production for months, without any /dev/build or flushes for that time.

    On the second site, I am running 2.4.5 on a LAMP server, same modules. All rows in the File tab are NOT lost. Minor updates have been made to the code recently, but nothing involving Images or DataObjects that have images.

    I have *no* idea what could have caused this. Sure, 1 server, I can see a hiccup or something - crazier things have happened. But 2 different installs on two different servers? Scary stuff here. I don't even know where to begin. I have looked through my code, I don't see anything troublesome.

    Any help or direction would be greatly appreciated. The issue was here in 2009, but no solution was ever posted.

  • Scott Farmer
    Avatar
    Community Member
    35 Posts

    Re: Files & images disappearing from assets directory Link to this post

    Have you turned on php error reporting in .htaccess file located in the root?

    Add "php_value display_errors On" to this file to see what the 500 error message is.

    Cheers
    Scott

  • benjamin-smith
    Avatar
    Community Member
    17 Posts

    Re: Files & images disappearing from assets directory Link to this post

    There is no error on the site now. The images are simply gone - they are all displayed on the front-end as broken. The HTML <img> tags point to images that do not exists. Poof, they're gone.

    The problem is that the problem is very hard to duplicate - I have never seen it happen. In fact, I'm not sure exactly when the images disappeared, just sometime in the last month (it is a low traffic site).

  • Scott Farmer
    Avatar
    Community Member
    35 Posts

    Re: Files & images disappearing from assets directory Link to this post

    Have you checked using ftp to see if the uploaded images actually exist?

    From that forum it seems it is just resampled images. This could be a permission issue. Check all folders and files in assets have 777 permission set.

    Also I had a issue with files not displaying. This was caused by null values in the files table. Removing all nulls fixed this.

    cheers
    Scott

  • benjamin-smith
    Avatar
    Community Member
    17 Posts

    Re: Files & images disappearing from assets directory Link to this post

    The files are indeed gone when I check via FTP. This includes the resampled files as well as the original uploads. This also includes several PDFs and Word DOCs.

    I don't have the exact permissions in front of me, but everything was working fine before, so I imagine that unless they were changed, that shouldn't be the issue?

  • Scott Farmer
    Avatar
    Community Member
    35 Posts

    Re: Files & images disappearing from assets directory Link to this post

    Does your client have access to this area? I had a client who thought the files had gone, but turned out the renamed a folder. Easy for a client to remove all files.

    What modules do you have installed?

    Hard one to work out, without seeing your code etc.

    Regards
    Scott

  • benjamin-smith
    Avatar
    Community Member
    17 Posts

    Re: Files & images disappearing from assets directory Link to this post

    The problem is back.

    Many, many images on my site have been deleted, BOTH the actual image files from the server AND from the FILE table. This leads me to believe it is nothing but a SS problem (not related to the server, hosting, user error, etc.).

    I think this was the uploader that caused the problem, but I cannot be sure (DOM module, updated a couple months ago):

    $ThumbnailField = new ImageUploadField('ThumbnailImage','Thumbnail - must be 280x97 pixels');
    $ThumbnailField->copyOnImport = FALSE;
    $ThumbnailField->setUploadFolder('Uploads/Images/projects/');
    $f->addFieldToTab('Root.Content.Main', $ThumbnailField);

    I cannot figure out why some images have been deleted, and other not. I cannot identify any pattern.

    Has anyone run into this problem before - or does anyone have any ideas???

    741 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.