Bad upload, how do I clean database?

I was fiddling with file permissions, and I uploaded a photo that Immich couldn't properly save. It saved the photo to the filesystem and the hash to the database, but it could not save the thumbnail or preview. I fixed the permissions, but now Immich won't let me upload the photo. It's says "duplicate detected", but the first upload didn't work. So now the hash is in the database but the photo is not in the filesystem. How do I clean this up so I can upload the photo?

  • The offending photo is stored as library/2025/2025-06-19/2025-06-19.22.03.38 2025-06-19 19.03.38-1.jpg
  • There is no preview or thumbnail file, therefore it doesn't show up in the UI
  • The file's hash is in the database because it rejects re-uploading it as a 'duplicate'
  • I have no way to determine what the UUID for this image in the database is
Was this page helpful?