Upload error: duplicate key value violates unique constraint "UQ_assets_own" on all uploads
I recently downloaded all Pictures from my google Photos account and it seems i cant upload any of them to Immich either via cli on Desktop or web-interface dragndrop via Chromium.
I might be plagued by this github issue here: https://github.com/immich-app/immich/issues/15051 but i am not sure about this. I do use the Android App as well but these pictures are not on my phone at all. It does not matter if i pick one image or several or the whole folder. Uploading pictures via the android app seems fine, i did not try to copy the pictures on my phone first and uploading them via the app though.
Uploading via ia Webinterface shows always one picture uploaded and i can see an empty thumbnail that is endlessly loading....removing this one completely and emptying the trash completely does not seem to help either.
There are some json metadata files in this folder but i assume that's no problem since Immich uploads only compatible file formats and ignores everything else?
Immich CLI:
I added the corresponding Immich Docker logs.
Environment:
Rocky Linux 9
Immich runs in Docker
Immich version v1.138.0
I hope i didnt miss any Information.
Thanks in Advance for your help and Support.
33 Replies
:wave: Hey @n1ete,
Thanks for reaching out to us. Please carefully read this message and follow the recommended actions. This will help us be more effective in our support effort and leave more time for building Immich :immich:.
References
- Container Logs:
docker compose logs
docs
- Container Status: docker ps -a
docs
- Reverse Proxy: https://immich.app/docs/administration/reverse-proxy
- Code Formatting https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline#h_01GY0DAKGXDEHE263BCAYEGFJA
Checklist
I have...
1. :blue_square: verified I'm on the latest release(note that mobile app releases may take some time).
2. :blue_square: read applicable release notes.
3. :blue_square: reviewed the FAQs for known issues.
4. :blue_square: reviewed Github for known issues.
5. :blue_square: tried accessing Immich via local ip (without a custom reverse proxy).
6. :blue_square: uploaded the relevant information (see below).
7. :blue_square: tried an incognito window, disabled extensions, cleared mobile app cache, logged out and back in, different browsers, etc. as applicable
(an item can be marked as "complete" by reacting with the appropriate number)
Information
In order to be able to effectively help you, we need you to provide clear information to show what the problem is. The exact details needed vary per case, but here is a list of things to consider:
- Your docker-compose.yml and .env files.
- Logs from all the containers and their status (see above).
- All the troubleshooting steps you've tried so far.
- Any recent changes you've made to Immich or your system.
- Details about your system (both software/OS and hardware).
- Details about your storage (filesystems, type of disks, output of commands like fdisk -l
and df -h
).
- The version of the Immich server, mobile app, and other relevant pieces.
- Any other information that you think might be relevant.
Please paste files and logs with proper code formatting, and especially avoid blurry screenshots.
Without the right information we can't work out what the problem is. Help us help you ;)
If this ticket can be closed you can use the /close
command, and re-open it later if needed.
[Issue] Upload error: duplicate key value violates unique constraint "UQ_assets_owner_checksum" (immich-app/immich#15051)Unable to send file: RangeNotSatisfiableErrorAre you using a (badly configured) reverse proxy? This sounds like something between your uploading client and the server messes with requests
mmmh i will check thanks my phone access the Immich server trough the same proxy though.....but i will double check i have haproxy with tcp passtrough as a frontend and caddy as a backend running nice from public network...i will try with a vpn or access without proxy to rule that out. Thanks
Yeah testing it directly would be a good first troubleshooting step :)
Same problem if access happens directly through
http://immich.my.domain:2283/
You get the same RangeNotSatisifableError?
It would be better to test with an IP instead of a domain
a local IP
that resolves to my local ip, changed in the hosts file but let me check that aswell
do you have any weird network stuff going on? VLANs, high MTU, etc?
can i somehow upload from local storage easy, to test that?
I mean you can just use 127.0.0.1:2283 on the hosting machine
i am a network engineer so i tend to break things quite often but i have a separate production environment since years
using immich cli on the local machine? or can i do it without nodejs...? i prefer not to install nodejs there
You should already have the cli available on the Immich container iirc
just for the record: latest attempts ( tried just with singel images now for less logspam)
are you sure you're not just uplaoding duplicates? that's what this looks like
yes i even created a new picture with a graphic tool
Yes the constraint violations I don't care about
It were the http errors I found interesting
if i click on the "goto the image" it does not load

uploading/syncing picture with the android client app works....
Most likely those assets broke from the network error you posted
I'd delete one (make sure you also delete them from the crash) and then upload them again without whatever you had going on in your network earlier
wait, how can show me the broken assets?
thanks btw for your superb support here! this was by far one of the fastest response to an issue ever 😄
What you're looking at right now is a high res thumbnail so either it failed generating a thumb because the original file is corrupt, in which case you should see errors in the logs, or the thumbnail simply hasn't been generated yet
For (2) you should check the job queue in the admin settings
could it be that the google takeout service generates broken images somehow?
Very unlikely
I gave you two things to check, please check those
i need to continue troubleshooting on this tomorrow for now unfortunatly. but will report back!
Thank you again for your help (donation incomming!)
That does not impact the support we provide but it's definitely appreciated :)
I deleted the broken asset permanently in the webgui. uploading of new pictures (without proxies) still fails.
Can i check the jobview also from the container?
I am not sure what exactly fixed it, but for now the same pictures that failed are uploading now flawless, with proxies in between....i used firefox instead of chromium...
Those aren't "fails". Those are just assets that could not be added because they already exist for that uesr
still not understand....if i tried uploading new images never in touch with the server there cant be duplicates of these....the first asset was always shown with a green arrow, but the upload of that asset was always corrupted. after that every other asset failed with a duplicate warning on total new files. I understand now why you guessed that my network environment could have been the culprit for that error but my guess is the root cause for this happening is not local home network related 😉
So i removed/deleted that broken asset and tried again to upload some other pictures, with the same outcome...... today i tried my luck again from a different browser and suddenly the error disapeard
but how? these files were uploaded for the first time
i validated that yesterday with creating some random png files with draw.io
anyways i mark this now as solved since my tries to recreate went unsuccessful... that error simply vanished. I usually prefer to pinpoint what happend 😄
This thread has been closed. To re-open, use the button below.