I have been using Obsidian since last 1 and a half year. I use it on my Laptop (HP Pavallion) and my Android phone. I encountered this issue for the first time in March of this year. At that time the android phone I was using was Moto G82. What happens is that the attachment files get deleted all at once from the vault. This takes place on my phone which can be clearly seen in the sync log and then it gets synced to my laptop and everything is deleted from there as well.
I reached out to the support and we found that it might be because of Google photos backing up the attachments folder and then after completing the back up it might be deleting all these attchment files from the local storage. So we used a .nomedia file which would prevent Google Photos from reading the attachments files and hence it won’t be able to delete them but that also didn’t work.
After that I have shifted from Moto G82 to a new phone Samsung A35 but the issue is still there. Can u please fix this for me ? If there’s any other information needed from my end kindly let me know. Also these Sync logs which I have attached are not the latest ones, as soon as this problem occurs again which will definitely happen in maybe a week’s time I ll update them with the latest sync logs
If google photos is responsible for deleting the files, There’s nothing we can do about it.
I am not sure the . nomedia file is used by google photos to exclude a folder from being optimized. You need to go into google photos settings and make sure your obsidian vault is not managed by google photos.
Already did that and even stopped Google Photos from backing up that particular folder containing all the attachments, but that didn’t work. I reached out to Obsidian support and we had a really long discussion about the same (almost 60 emails) after which it was concluded that it is a very specific type of bug only affecting a few android devices and I ll have to post it here to get it fixed.
Adding from a support standpoint, this seems to be an off and on issue with some Android users, but I mostly see it in those who use Pixel devices.
@Shubhang is there any file/size optimization on you device that might be trying to save space? For example, Apple Devices are known for enabling such features by default, but I am not sure if Samsung has the same.
It is just my guess that it is Google Photos, after backing up all the photos it deletes them from the local storage all at once and that is exactly what can be seen in the Sync Log that all the attachments get deleted together.
Another thing which I would like to add is that I have changed phones, I was previously using Moto G82 and am now using Samsung A35. The problem is still there so it was not something related to the phone software.
I don’t think any such feature is there on my device. The only thing is the storage optimization which regularly gives me suggestions to delete irrelevant files but doesn’t delete anything on its own
Otherwise, are you using an attachment plugin for Obsidian which creates automatically subfolders in your attachments directory?
Just saying, maybe you see unknown folders in your file browser app / photo album app, which are in reality your auto-generated attachment subfolders in obsidian.
And because you didn’t create those folders you delete them in an attempt to manage files and clean up your photo album app/ file browser. This happened to me twice.
I don’t use any such plugin but there is a setting in Obsidian which I turned on that puts all the attachments into one single folder I have decided. So is that creating problems ?
Obsidian’s default setting are for sure not the cause of your problem. The “attachment” setting in Obsidian registers only a path to a selected folder, that’s all.
Another possible cause of data loss could be some sort of synch mechanism. Do you share your attachments folder with Google drive, apple cloud or similar?
Also, if you sync your laptop / pc with your phone, deactivate all links related to Obsidian and stop syncing .
Now, backup your attachments folder or your vault as a zip. Next, do a manual sync and check if your attachments in Obsidian are still available.
Probably the help desk gave you already this kind of advices.
Yet another idea, try to rename your attachments folder to a English name.
Finally don’t allow other mobile applications to manage your attachments folder in Obsidian. You can manage application privileges under phone settings>applications . In there you should find something like “app privilege manager” or “app special access” . Otherwise, use the search field to look after keywords like “privilege” or “access”, etc as some settings are difficult to find because deeply nested in the preferences.
Other than that, I wouldn’t know. Hopefully you can find the issue, I wish you success.
Some devices experience a recurring attachment sync issue within a vault system. This issue silently deletes all attachments, with no alerts or notifications provided to the user. Deleted files remain recoverable in the sync system for only two weeks, after which they are permanently lost. Users must independently notice the deletion and restore their files within this window, or risk irreversible data loss.
Current workaround
Check attachments every day to see if they are still there. Very inconvenient.
Proposed solution
To address the risk of silent data removal, I propose implementing a fix that would trigger a UI alert whenever attachments are removed from a device. This alert would be triggered as soon as the issue is detected in the log, providing immediate feedback to the user. Additionally, add a new toggle in the sync settings, labeled “Alert me when attachments are deleted from my device”. This toggle gives users control over whether they want to see these UI alerts, ensuring they can opt in or out based on their preferences. By providing this option, the system respects user preferences for notifications while maintaining functionality for those who rely on such alerts.
Which issue are you referring to? Is there a bug report for this already?
If there is a bug in Obsidian Sync we should fix that not open introduce a machinery to work around it.
I directed the user to make this post (though I said as a FR), on this.
This specific issue has to do with Android and media files, and the device not honoring .nomedia to prevent management of attachments via Google Photos, Samsung Photos, etc. Pixel users tend to be disproportionally affected by this issue.
How can I know that? I just installed the app from google store and its in the default folder installation on android.
Other
For context:
I added the .nomedia plugin
I dont use google photos nor any other way to backup my photos.
I am not mixing multiple cloud sync tools. I only used obsidian sync until I lost all my attachments and couldnt recover them, and since then, I also use Remotely save to Dropbox. The attachment sync issues happened before this plugin and continue happening after I installed it, so its not the cause.
I have had this phone for more 1-2 years and this issue has been always happening on this phone. I didnt have other phone to test.