Error: Input file contains unsupported image format
HI. I have Immich installed on Unraid, I was having server crashes using the template install, so I transfered to the Docker Compose method using the official documentation. I am on version. V1.129.0.
I have a large quantity of photos exported from Apple Photos and then imported via Immich-Go, other photos have been imported directly from the Immich IOS app.
Docker-compose and .env file are attached.
I am getting 1000's of errors in the immich-server container such as this:
[31m[Nest] 7 - [39m03/30/2025, 12:01:06 AM [31m ERROR[39m [33m[Microservices:{"id":"3aae52cd-0e08-47de-a540-3642fd7c120a"}][39m [31mUnable to run job handler (thumbnailGeneration/generate-thumbnails): Error: Input file contains unsupported image format[39m
Eventually the server locks up with high IOWAIT and I have to restart the docker service to recover.
How can I troubleshoot this issue please?15 Replies
:wave: Hey @Keith Ellis,
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. :ballot_box_with_check: verified I'm on the latest release(note that mobile app releases may take some time).
2. :ballot_box_with_check: read applicable release notes.
3. :ballot_box_with_check: reviewed the FAQs for known issues.
4. :ballot_box_with_check: reviewed Github for known issues.
5. :ballot_box_with_check: tried accessing Immich via local ip (without a custom reverse proxy).
6. :ballot_box_with_check: uploaded the relevant information (see below).
7. :ballot_box_with_check: 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.I've upgraded to v1.130.3, I ran the Generate thumbnails job and got the same errors.
[Nest] 7 - 03/30/2025, 9:19:15 PM ERROR [Microservices:{"id":"1d8f4464-9154-4bfa-858b-dba0cd72166a"}] Unable to run job handler (thumbnailGeneration/generate-thumbnails): Error: Input file contains unsupported image format
Error: Input file contains unsupported image format
at Sharp.toBuffer (/usr/src/app/node_modules/sharp/lib/output.js:163:17)
at MediaRepository.decodeImage (/usr/src/app/dist/repositories/media.repository.js:54:68)
at MediaService.generateImageThumbnails (/usr/src/app/dist/services/media.service.js:164:63)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async MediaService.handleGenerateThumbnails (/usr/src/app/dist/services/media.service.js:114:25)
at async JobService.onJobStart (/usr/src/app/dist/services/job.service.js:156:28)
at async EventRepository.onEvent (/usr/src/app/dist/repositories/event.repository.js:126:13)
at async Worker.processJob (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:394:28)
at async Worker.retryIfFailed (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:581:24)
It seems likely you have disk / data corruption
Given the corrupt input files and high IO wait
Server crashes also indicates a major issue, as this is not something a docker container is able to cause
In the log, I assume the id:xxxx references a source file. How can I find what image files are being referenced?
You can search in the database for
select a.id, a."originalPath" from assets a where a.id = '1d8f4464-9154-4bfa-858b-dba0cd72166a';
Yes, the photo appears to be corrupted. I have 1000's of these corrupted files, is there anyway I can find out what the original file name was?
Is there a way I can detect these currupted files and remove them from Immich?
You should first start by taking a full backup of immich including a database dump, and everything else on the drive, and investigate why your storage is failing.
The original file names should be stored in the immich database
It can be added as
a.”originalFileName”
in the sql query you haveThanks, I've found the original file name, I'm now searching for this in the original source files to see if it was corrupted prior to the import.
The files appear to be duplicates, but the files are prefixed with ._
i.e. .DSCF1805.JPG and DSCF1805.JPG
Any idea why this may be? Is there an easy way to search for files prefixed with . and delete them. (I have a database dump and full backup.)
That’s probably a small file created by your operating system — likely Mac OS
You shouldn’t have uploaded them. Might be a thumbnail or metadata
Yes, I'm on a Mac, I suspect you are correct. Can I do a wildcard search inside Immich App and just delete them all?
It would be better to start over and upload only the good files
I wouldn’t expect a search to be terribly successful
You could query the DB for a list of files then delete using the API I guess
An underscore is a wildcard character in Postgres so the search will not work as expected within immich
ok, yes starting from scratch might be the best idea. I've been using Immich for a few months, so I'll have to see if my recent photos that have been importing direct from my phone are still available.
Thanks for your help.
This search seems to work, I think I'm going to try and delete them.
I’m pretty sure that will cover a lot more files than you want, also you can’t manually delete from the DB as there will be hanging references in other tables
The search, seemed to return just those files starting with ._
But if I can't delete them without causing DB issues then I'll leave it for now.
The patten will grab anything starting with .
And no, you can’t delete with the DB