immich
immich copied to clipboard
[BUG] Deleting duplicate pictures lead to negative remainder counter
Describe the bug After adding the Camera album on my Android phone to Immich I deleted numerous pictures from another app (duplicate finder). The assets remained in the cloud and the dashboard now show a negative Remainder.
To Reproduce Steps to reproduce the behavior:
- Add an album to Backup Albums on the mobile app with numerous duplicate pictures
- Wait for backup to be finished
- Batch delete duplicate pictures in that album from a 3rd party app
- Pictures are not on the phone anymore but still backed up leading to a negative Remainder counter
Expected behavior Some kind of purging mechanism where pictures that don't live on the phone are deleted from the server.
Screenshots If applicable, add screenshots to help explain your problem.
System
- Phone OS Android:
12
- Server Version:
1.35
- Mobile App Version:
1.35
Additional context Add any other context about the problem here.
confirmed
I don't know to what extent you want the two way sync to be authoritative but I'd expect the phone to be the single source of trust for the pictures and those deleted from there should be deleted from the server, either real time or through a pruning cron-job type process that makes sure that server is sync'd to phone daily or so.
@ytzelf I don't think you want that because then if you remove photos or videos on the phone to have more space to take more photos they will be also deleted on the server. Which is not what backing up means.
OK then i'm not sure how to work around that issue.
What I could see working is 1/ Select all items in backups and not on the phone (separate issue - easily selecting all items, items for a specific date range or items based on their storage location is needed) 2/ Delete these items on the backup location from the mobile app (maybe a delete subdialog on pictures - "delete from phone" and "delete from backup")
If you're fine having pictures on backup that were explicitely deleted from the phone then I'm not sure this is even an issue at all tbh (and the remainder counter can just be max(0, total-uploaded)). Probably more a matter of being able to view, quickly select, and delete quickly these pictures.
May be related to this issue but I got a negative number after closing and re-opening the app, no deleting needed.
Same proplem for me.
May be related to this issue but I got a negative number after closing and re-opening the app, no deleting needed.
I just left my phone to do it's first backup on a freshly new immich server during the night and I got this.
May be related to this issue but I got a negative number after closing and re-opening the app, no deleting needed.
I just left my phone to do it's first backup on a freshly new immich server during the night and I got this.
Beside backup up from the phone, did by chance upload anything else from the web or from the CLI? If you go on the web and hover on the question mark next to the Photos button, what is the sum of the photos and videos count?
May be related to this issue but I got a negative number after closing and re-opening the app, no deleting needed.
Beside backup up from the phone, did by chance upload anything else from the web or from the CLI?
Nop, just through this phone.
If you go on the web and hover on the question mark next to the Photos button, what is the sum of the photos and videos count?
This? It is exactly 1913 (as shows on the phone)
Is this related to Live Photos being stored as two parts (and showing up in the count as two separate assets)? Is there a way for you to easily tell how many live photos you have?
Ideally the backup count should be how many assets are left to backup, which is unrelated to how many are on the server or have previously been backed-up to the server. It should be something like: count(assets from selected albums on device) - count(where on device asset is in list of assets on the server)
.
Is this related to Live Photos being stored as two parts
Wouldn't have thought so as I have zero live photos.
All I did when I got this initially was to install the app and let it sync. No other upload methods used at that point in time.
Is this related to Live Photos being stored as two parts
Wouldn't have thought so as I have zero live photos.
All I did when I got this initially was to install the app and let it sync. No other upload methods used at that point in time.
I think you have some duplicate photos or videos and the app doesn't handle the duplication count correctly. Can you help me confirm if you have some duplicate photos or videos in your library?
Is this related to Live Photos being stored as two parts
Wouldn't have thought so as I have zero live photos. All I did when I got this initially was to install the app and let it sync. No other upload methods used at that point in time.
I think you have some duplicate photos or videos and the app doesn't handle the duplication count correctly. Can you help me confirm if you have some duplicate photos or videos in your library?
Just quickly looked through all my photos and I can't find any duplicates (at least the file names are always different).
I think you have some duplicate photos or videos and the app doesn't handle the duplication count correctly. Can you help me confirm if you have some duplicate photos or videos in your library?
Not as far as I'm aware. Depends on what the criteria is? File names will all be unique, anything "duplicate" will be things like downloaded items that have no or minimal metadata?
Just opened the app (not logged in for a while as the server/app was not the same version so have been "locked out" until I could update the server) and using foreground backup it is now backing up -43 assets, and this number is decreasing i.e. first image uploaded then remainder is -44 etc. None of the current photos are duplicates and certainly not all of them.
I have also noticed this issue on Android.
Dropping by to share a finding.
- I noticed that on my partner's device, the negative count
-1
coincides with the exact number of files stuck in theupload
subfolder (which was corrupted due to incomplete/failed upload). - However that number for my device
-30
is still much larger than the number of stuck files5
.- I cannot explain why but perhaps I deleted some files after they were uploaded
- Note that failed photos/videos are just stuck there. I verified that the intended files were (re)uploaded successfully and were placed in the right folders in the
library
subfolder.
My hypothesis is that there is a possibility that files stuck in the upload
folder may count towards library size and therefore contribute towards this negative photo count issue.
My two cents on source of truth and this issue overall:
- I agree with @alextran1502 in that the device should not be the single source of truth, but the server is.
- In the event that some assets were deleted from the devices, they should still exist in the library (server).
- I really dislike the approach that the big G uses where deletion on the App or Web will result in deletion of that asset across all devices.
- I have some really huge videos that should not belong to any device but the server. Going through the process of deleting just on the device and not syncing that deletion was a huge pain.
- That annoyance subconsciously restricted my use of videos in recording memories, which is a huge waste.
- Perhaps a mitigation here would be
- Correctly display statistics on assets that only exist on the server
- Need to fix logic on counting assets coming from each device
- If the asset does come from the device in question, don't count it as
Remainder
- Have a filtered view for assets that do not exist locally on the device in question
- Correctly display statistics on assets that only exist on the server
Just encountered this bug too, on Android. I did not manually delete any photos, but overnight the app has ended up with Remainder: -9
, and I have a permanent notification saying Backing up your assets... 42% (3/7)
.
Looking at my library, the two newest photos have a cloud icon with a line through it, which I take to mean that they aren't backed up (looking at progres logs, looks like I've encountered https://github.com/immich-app/immich/issues/2547 too). Perhaps worth noting that I hadn't launched the app in a while. I launched it this morning after I saw the stuck notification, got a message about a server update, updated the server but the problem remains.
There were 10 files in the /usr/src/app/upload/upload/<uid>
folder, I deleted them but that hasn't addressed the problem.
Using iOS client:
I understand that the counter just subtracts 'Backup' number from 'Total' that's on device.
My suggestion would be to compare the last backed up photo/video ID with the one on device and then count from there how many more photos/videos are to be backed up.
Wanted to leave a note that I just experienced this as well on iOS. Not sure if you need me to help gather information or not for you.
Seem to have the same problem:
Workflow: I started by uploading images from my new phone using immich - after deciding it's a great tool I installed immich on my old phone to upload these pictures, too. Maybe that's the problem?! ...
Same issue. Fresh setup and was backing up ~8000 photos/videos on my Android phone. I had made changes during the process, adding 2 more albums, and restarting my phone. At one point the Total started showing ~5000 even though camera still had 8000 assets.
I was able to resolve the issue by deleting the app's cache and data. Upon login to a fresh app, I reselected the backup albums and the Total is now correct, matching Backup.
Same issue. Fresh setup and was backing up ~8000 photos/videos on my Android phone. I had made changes during the process, adding 2 more albums, and restarting my phone. At one point the Total started showing ~5000 even though camera still had 8000 assets.
I was able to resolve the issue by deleting the app's cache and data. Upon login to a fresh app, I reselected the backup albums and the Total is now correct, matching Backup.
Thank you, this workaround fixes the issue for me also :)
Same issue. Fresh setup and was backing up ~8000 photos/videos on my Android phone. I had made changes during the process, adding 2 more albums, and restarting my phone. At one point the Total started showing ~5000 even though camera still had 8000 assets.
I was able to resolve the issue by deleting the app's cache and data. Upon login to a fresh app, I reselected the backup albums and the Total is now correct, matching Backup.
That ... did it for me as well. Thanks a lot it was somewhat irking ^^
I freshly installed immich two times, to see if the error was on my side, but i can confirm this bug:
- Install Immich server
- Install Android app
- Select "Camera" Folder to upload (not much, ~400 Photos)
- Let the phone sit for a while to finish
- Encounter this bug (numbers seem to differ each installation)
//edit: deleting cache does not help in my case. maybe a full wipe of the app-data would ...
I can confirm that this does happen with the Android app with a freshly installed server and that deleting app cache and data doesn't really solve the issue
I was able to reproduce getting a negative number following these steps (I am on ios).
- Have auto-upload in foreground on
- Start app and let it upload new pictures
- Don't migrate away from Photos tab, go to one of the new pictures that was uploaded. You can still click the "upload asset" button. Click it and confirm upload
- The asset will be uploaded again and now the remaining will be "negative" indefinitely.
Deleting app data and cached on Android worked for me
I have the same problem. Mine is -1677. I have theorized that what caused it was initially having the "Recent" category selected when I enabled auto-backup. Items in that category will overlap items in other selected categories/locations. So once I realized and deselected it, there were already "extra" items uploaded that the app now sees as a negative count. More items auto-uploaded than the app is set for.
Deleting the app data (Android) and setting up auto-backup again did reset everything for me.
That might be what caused it for you, but I just selected the folders (not including "recent"), let it sync, and found the negative number when I came back. Somewhere along the way, the "total" is getting way off track.
Im not sure about official team's position on this, but IMO it could be solved by checking # of images that were shot after latest upload timestamp