immich-cli upload prompts to upload some pictures every run

I run the cli upload on a 2k picture folder, it finds some 700-ish pictures to upload and re-uploads them. It re-uploads those 700-ish pics every time the command is run. I've checked if it actually uploads them and generally seems like it, but I've seen one or two on my folder that don't show up in Immich itself. These are normal jpg pics taken with my phone.
Indexing local assets...
Indexing complete, found 2468 local assets
Comparing local assets with those on the Immich instance...
A total of 704 assets will be uploaded to the server
Do you want to start upload now? (y/n) y
Start uploading...
Upload Progress | ███████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ | 28% || 704/2468 || Current file [/import/VID_2022-10-21-04-32-33-352.mp4]
Failed to upload 0 files []
Indexing local assets...
Indexing complete, found 2468 local assets
Comparing local assets with those on the Immich instance...
A total of 704 assets will be uploaded to the server
Do you want to start upload now? (y/n) y
Start uploading...
Upload Progress | ███████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ | 28% || 704/2468 || Current file [/import/VID_2022-10-21-04-32-33-352.mp4]
Failed to upload 0 files []
14 Replies
Alex Tran
Alex Tran2y ago
So it prompts to upload 704 files everytime you run the CLI?
p4block
p4blockOP2y ago
Yes I've actually isolated which 700, I could maybe test on a single problematic picture one sec Well, same problem with just 1 picture
jrasm91
jrasm912y ago
It doesn't actually import it a second time though? It might upload it then realize it's a duplicate though.
p4block
p4blockOP2y ago
No duplicates in immich itself no This one is actually there on immich (just once, correctly) I've run the cli to upload it 10 times probably now
jrasm91
jrasm912y ago
Were the 700 photos possibly uploaded via the mobile app beforehand?
p4block
p4blockOP2y ago
yes that was from the time I was toying with the app
jrasm91
jrasm912y ago
Right, so it's working as designed currently. We don't know it's a duplicate until after uploading it. In the future the CLI will hash the file and skip the upload if it already exists. Right now it uploads it and then it's hashed and marked as a duplicate.
p4block
p4blockOP2y ago
I see, so I should see something in the logs for one of services about the duplicate And maybe the ones I dont see on immich are ones that I deleted from the phone app (garbage pics) server side detecting I deleted them and ignoring the upload too
jrasm91
jrasm912y ago
If it is deleted in immich you should be able to re-upload it again. When there is a duplicate, you should see a unique constraint violiation in the database logs, but I think that's it. You could also view your total asset count in the administration page and you can verify the count for total assets isn't increasing.
p4block
p4blockOP2y ago
I said that because I recall reading about a "mark as unwanted" mechanism for some edge case where a deleted pic kept being reuploaded in a guys phone but that was probably app-side, don't mind me I'll reaaally check for the 700 to be in the site and delete this local copy folder Moving all my pics to immich hahah
jrasm91
jrasm912y ago
Haha nice Yeah, there is a separate issue of keeping track of files that have been deleted somehow to prevent the mobile app from re-uploading them over and over. We haven't solved that yet. If you delete a photo from immich and it's still on the phone and it's still in an abum that is selected to be backed-up, it will re-upload the file again. That's still an existing problem. When you re-upload a file to immich that already exists on immich it actually fails to put it in the database due to a uniqueu constraint we have requiring all file hashes to be unique (per user) and the operation actually fails, so it doesn't actually get created.
p4block
p4blockOP2y ago
Thanks a lot for the quick support Quick "fix" would be to feedback to the cli the fact that it found N duplicates or something, would prevent people in my situation from asking xD
jrasm91
jrasm912y ago
Funnily enough https://github.com/immich-app/CLI/pull/92 The CLI has quite the long list of backlogged PRs waiting to be merged 🙂
p4block
p4blockOP2y ago
Great success Well that solves it, thanks again have a nice day

Did you find this page helpful?