Immich is incorrectly marking photos as duplicates during fresh install

I recently had to reinstall immich, and had to reupload all my photos. However, when uploading the photos it terminates when not all the photos have been uploaded. I had uploaded 20k photos previously, but am only able to import 15k. The rest are refusing to upload (likely because they are duplicates). I am uploading using the cli. I don't believe the 5k photos are duplicates, as that is a pretty large amount. There are no errors in my server or microservices log, the last lines are letting me know the server has been started.
29 Replies
Alex Tran
Alex Tran2y ago
Can you show the screenshots when the upload completed?
pineapplecone57
pineapplecone57OP2y ago
No description
Alex Tran
Alex Tran2y ago
No description
Alex Tran
Alex Tran2y ago
it has finished upload those to the server
pineapplecone57
pineapplecone57OP2y ago
It has finished uploading, but it hasn't actually uploaded the photos When I try running it again it says that 6879 photos still need to be uploaded
Alex Tran
Alex Tran2y ago
so those got rejected by the server because of duplication
pineapplecone57
pineapplecone57OP2y ago
I have two folders, a fresh one containing the photos I am now uploading to immich and an old one containing the photos I previously uploaded to immich I am uploading the images to the fresh one from the directory containing the old one Technically, the photo count in both should be the same. The old one contains all the photos uploaded to immich so it should contain no duplicates. The new one is when I upload photos from my old directory Unless there was a significant change in detecting duplicates, I don't think 25% of the photos I previously uploaded to immich would now be marked as duplicates
Alex Tran
Alex Tran2y ago
I am disgesting this There is not, all based on file's content
pineapplecone57
pineapplecone57OP2y ago
When I run something like fdupes, it doesn't find any duplicates. Is there another way you guys are finding duplicates?
Alex Tran
Alex Tran2y ago
just by calculating the hash of the files Can you check the server logs when it is uploading from the CLI?
Alex Tran
Alex Tran2y ago
if ther is duplicated it will have messages like this
No description
pineapplecone57
pineapplecone57OP2y ago
Both microservices and server logs don't print anything
pineapplecone57
pineapplecone57OP2y ago
No description
pineapplecone57
pineapplecone57OP2y ago
Do I need to change verboseness
Alex Tran
Alex Tran2y ago
It should print from the postgres container
pineapplecone57
pineapplecone57OP2y ago
No description
pineapplecone57
pineapplecone57OP2y ago
To note, some users may have redundant photos between users. As in User A may have some photos User B may have uploaded, although I'm not sure if duplicates are considered between users.
Alex Tran
Alex Tran2y ago
duplicated only considered from a single user Are you a developer?
pineapplecone57
pineapplecone57OP2y ago
Yes, although I'm not super familiar with docker or postgres
Alex Tran
Alex Tran2y ago
If you want to make sure, you can pull up the database, and check of of the asset based on its checksum value report in the database
Alex Tran
Alex Tran2y ago
Database Queries | Immich
Keep in mind that mucking around in the database might set the moon on fire. Avoid modifying the database directly when possible, and always have current backups.
Alex Tran
Alex Tran2y ago
No description
Alex Tran
Alex Tran2y ago
This section choose one of the reported checksum, find the createdAtDate, check for that photo on the timeline and then check again in your directory if you have it reupload again
pineapplecone57
pineapplecone57OP2y ago
So in something like this 2023-10-17 02:34:58.586 UTC [18846] DETAIL: Key ("ownerId", "libraryId", checksum)=(9cee2165-ed52-4cde-8ba0-317c934f37b9, 18c94438-777d-437d-8068-c8c718401fbf, \x4f17d99a4978d4b89ffdd134c5ef47bcfd7a1d3d) already exists 9cee.. 18cc, and \x4f.. are 3 different checksums?
Alex Tran
Alex Tran2y ago
\x4f17d99a4978d4b89ffdd134c5ef47bcfd7a1d3d is the checksum 9c is the ownerId 18 is the libraryId
pineapplecone57
pineapplecone57OP2y ago
So I ran the query using
4f17d99a4978d4b89ffdd134c5ef47bcfd7a1d3d
4f17d99a4978d4b89ffdd134c5ef47bcfd7a1d3d
and found one row. I'm guessing that means that it is indeed a duplicate?
Alex Tran
Alex Tran2y ago
yes sir
pineapplecone57
pineapplecone57OP2y ago
Suppose that means that somewhere along the way, some duplicate photos were introduced. Thanks for your help!

Did you find this page helpful?