Failed upload-file taking up space (1gb)

I tried to upload a 1gb .gif file for cover image on my ghost website (in the ghost admin design settings), near the end it resulted in a server error. As it was uploading for several minutes, I could see the disk usage go up in the DigitalOcean graphs. After the error nothing happened, and the space is still taken up.

I checked for all the files in /var/www/ghost/content/images, and used the ‘find’ command to find the file by name. Needless to say, I couldn’t find it anywhere. I also cleaned the trash, which was 30mb.

Do you know where, under what name to look for it? Or how to remove it? It’s quite a lot of space.

Thanks in advance!

A 1 GB file? That’s way too big for an image, so are you sure that’s what you’re doing?

1 Like

Looking in your content directory is the right place.

If you search for “phantom disk space” for LInux, you’ll find that in some cases, disk space can appear to be used by files that have been deleted. I believe it happens when an app still has a filehandle open to the file.

Depending on how Ghost crashed, it’s possible that the filehandle it opened for the file was not released. That would be a bug in Ghost. If that’s the case, you would see the disk space released by restarting Ghost. Let us know if this happens!

The GIF format is incredibly inefficient generally, and especially for videos. Consider using another format for the image or video, which will likely save you so much disk space it will put you below the default upload limit. (From memory, the default max upload size is 50 MB, but I may be wrong).

1 Like

No, but in development (I tried to create a good quality gif, and didn’t want to edit the theme to insert a video) I wanted to try how it would work.

In the end I realized this is exactly what I am keeping snapshots on DigitalOcean for, so I restored the website to an earlier version (I have only been editing the theme since then, so no problem). I didn’t try ghost restart, so I don’t know if that would’ve worked, unfortunately. I could try re-uploading the gif again, just to see if it produces the error again, though.

EDIT: I did reproduce the error for the sake of science, ghost restart did not resolve it. Very interestingly, whether the max upload size is 50 MB or not (I never touched it), ghost went through the whole upload of the 1 GB file, and only after some thinking did it grant me the “Request was rejected due to server error” response.