Avatar keeps getting deleted from media/attachments/ directory
Steps to reproduce
- set profile picture on your account (in my case it was a 500px png file)
- Use funkwhale from multiple devices for some time (I don't know exactly when the issue occurs
- You may note a broken image icon replaces the usual avatar
- Go to profile, and right click/save as where the image would be and note that it's now a 1px gif.
What happens?
Old summary of the issue
After a period of time, not known exactly, my avatar is replaced with a 1px gif file, and the path provided for said file is as below: `data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7` The first time I came across this however, the resulting "avatar" was a `.bin` file, though this has not re-occurred.So, I replaced the avatar again yesterday, made a note of where the file is uploaded to on my server and also the location of the resized image too. This was as of yesterday stored under data/media/attachments/74/f7/23/avatar.png Today, I opened Funkwhale to find the avatar has yet again disappeared, and browsing to the above location confirmed that the folder (not just the image itself, the 74 folder is also deleted) was no longer present. The image uploaded under sized however, is still present and has not been deleted.
What is expected?
Avatar should remain as normal. I have uploaded a 3000px jpeg avatar this time around as this is within the recommendations though I doubt that's the issue.
Context
Funkwhale version(s) affected: 1.3.0
I can't provide any logs as I don't know exactly when the change occurs, nor what logs it would fall under. I note that in CSS, a 1x1 transparent gif has some uses and I'm wondering if something else is happening here. Perhaps the image is being corrupted, and when going to the profile settings and right clicking where the avatar would be, I am instead interacting with a stop gap filler whilst no actual image is present?
Update
Okay, so having been discussing this again in the support chat, there is a possibility that this may have something to do with django_cleanup task but it's not confirmed. I will just confirm what have have noted:
- The image used for the top bar profile icon, and the profile icon themselves are "sized" versions of the original upload stored under data/media/sized/attachments/XX/XX/XX/image_crop_etc.jpg
- These images are deleted completely. data/media/sized/attachments/XX remains, but the 2 subfolders after are removed.
- The image still exists under data/media/attachments/XX/XX/XX/
- However, attempting to recover this image from the location in point 3 results in what appears to be a corrupt image
- But if opened in a text editor, you will find the following which then suggests the image file has been replaced with a html file but the image extension has been preserved (weird)
<html>
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>nginx/1.23.4</center>
</body>
</html>