I
Immich•3w ago
remarkable

Immich-server crashes sometimes and fails to restart

I have been loving immich so far, however, I often have issues where immich will go down and I cannot easily get i back up. When I run docker compose ps, I see that immich-server is "starting", and when I run docker compose logs -f immich-server, I get a spam of logs that look like this, except they move so fast it is hard to read: immich_server | Error: connect ETIMEDOUT immich_server | at Socket.<anonymous> (/usr/src/app/server/node_modules/ioredis/built/Redis.js:170:41) immich_server | at Object.onceWrapper (node:events:632:28) immich_server | at Socket.emit (node:events:518:28) immich_server | at Socket._onTimeout (node:net:604:8) immich_server | at listOnTimeout (node:internal/timers:588:17) immich_server | at process.processTimers (node:internal/timers:523:7) { immich_server | errorno: 'ETIMEDOUT', immich_server | code: 'ETIMEDOUT', immich_server | syscall: 'connect' immich_server | } Any suggestions? I am happy to remove and rebuild all of immich if there is a way to do it without messing up my data, or has anyone seen this before? Happy to provide any further info! Thank you!
25 Replies
Immich
Immich•3w ago
:wave: Hey @remarkable, 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.
schuhbacca
schuhbacca•3w ago
Seems like the server is struggling to connect to redis. Should check that it's running well
remarkable
remarkableOP•3w ago
redis seems to be restarting a lot: immich_redis | 1:M 14 Aug 2025 13:21:12.967 * Loading RDB produced by version 6.2.17 immich_redis | 1:M 14 Aug 2025 13:21:12.967 * RDB age 0 seconds immich_redis | 1:M 14 Aug 2025 13:21:12.967 * RDB memory usage when created 1.77 Mb immich_redis | 1:M 14 Aug 2025 13:21:12.969 # Done loading RDB, keys loaded: 37, keys expired: 0. immich_redis | 1:M 14 Aug 2025 13:21:12.969 * DB loaded from disk: 0.002 seconds immich_redis | 1:M 14 Aug 2025 13:21:12.969 * Ready to accept connections immich_redis | 1:signal-handler (1755178038) Received SIGTERM scheduling shutdown... immich_redis | 1:M 14 Aug 2025 13:27:18.633 # User requested shutdown... immich_redis | 1:M 14 Aug 2025 13:27:18.634 * Saving the final RDB snapshot before exiting. immich_redis | 1:M 14 Aug 2025 13:27:18.638 * DB saved on disk immich_redis | 1:M 14 Aug 2025 13:27:18.638 # Redis is now ready to exit, bye bye... immich_redis | 1:C 14 Aug 2025 13:27:18.850 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo immich_redis | 1:C 14 Aug 2025 13:27:18.850 # Redis version=6.2.17, bits=64, commit=00000000, modified=0, pid=1, just started immich_redis | 1:C 14 Aug 2025 13:27:18.850 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf immich_redis | 1:M 14 Aug 2025 13:27:18.851 * Increased maximum number of open files to 10032 (it was originally set to 1024). immich_redis | 1:M 14 Aug 2025 13:27:18.851 * monotonic clock: POSIX clock_gettime immich_redis | 1:M 14 Aug 2025 13:27:18.851 * Running mode=standalone, port=6379. immich_redis | 1:M 14 Aug 2025 13:27:18.851 # Server initialized immich_redis | 1:M 14 Aug 2025 13:27:18.851 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect. immich_redis | 1:M 14 Aug 2025 13:27:18.852 * Loading RDB produced by version 6.2.17 immich_redis | 1:M 14 Aug 2025 13:27:18.852 * RDB age 0 seconds immich_redis | 1:M 14 Aug 2025 13:27:18.852 * RDB memory usage when created 1.77 Mb immich_redis | 1:M 14 Aug 2025 13:27:18.854 # Done loading RDB, keys loaded: 37, keys expired: 0. immich_redis | 1:M 14 Aug 2025 13:27:18.854 * DB loaded from disk: 0.002 seconds immich_redis | 1:M 14 Aug 2025 13:27:18.854 * Ready to accept connections immich_redis | 1:signal-handler (1755178191) Received SIGTERM scheduling shutdown... immich_redis | 1:M 14 Aug 2025 13:29:51.268 # User requested shutdown... immich_redis | 1:M 14 Aug 2025 13:29:51.268 * Saving the final RDB snapshot before exiting. immich_redis | 1:M 14 Aug 2025 13:29:51.279 * DB saved on disk immich_redis | 1:M 14 Aug 2025 13:29:51.279 # Redis is now ready to exit, bye bye... immich_redis | 1:C 14 Aug 2025 13:29:51.498 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo immich_redis | 1:C 14 Aug 2025 13:29:51.498 # Redis version=6.2.17, bits=64, commit=00000000, modified=0, pid=1, just started immich_redis | 1:C 14 Aug 2025 13:29:51.498 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf immich_redis | 1:M 14 Aug 2025 13:29:51.498 * Increased maximum number of open files to 10032 (it was originally set to 1024). immich_redis | 1:M 14 Aug 2025 13:29:51.498 * monotonic clock: POSIX clock_gettime immich_redis | 1:M 14 Aug 2025 13:29:51.499 * Running mode=standalone, port=6379. immich_redis | 1:M 14 Aug 2025 13:29:51.499 # Server initialized immich_redis | 1:M 14 Aug 2025 13:29:51.500 * Loading RDB produced by version 6.2.17 immich_redis | 1:M 14 Aug 2025 13:29:51.500 * RDB age 0 seconds immich_redis | 1:M 14 Aug 2025 13:29:51.500 * RDB memory usage when created 1.77 Mb immich_redis | 1:M 14 Aug 2025 13:29:51.502 # Done loading RDB, keys loaded: 37, keys expired: 0. immich_redis | 1:M 14 Aug 2025 13:29:51.502 * DB loaded from disk: 0.002 seconds immich_redis | 1:M 14 Aug 2025 13:29:51.502 * Ready to accept connections Or is that just the shutdown because immich-server is constantly restarting as well
Immich
Immich•3w ago
[Issue] vm.max_map_count growing steadily when vm.overcommit_memory is 2 (jemalloc/jemalloc#1328)
remarkable
remarkableOP•3w ago
I get a huge spam of this error: immich_server | Error: connect ETIMEDOUT immich_server | at Socket.<anonymous> (/usr/src/app/server/node_modules/ioredis/built/Redis.js:170:41) immich_server | at Object.onceWrapper (node:events:632:28) immich_server | at Socket.emit (node:events:518:28) immich_server | at Socket._onTimeout (node:net:604:8) immich_server | at listOnTimeout (node:internal/timers:588:17) immich_server | at process.processTimers (node:internal/timers:523:7) { immich_server | errorno: 'ETIMEDOUT', immich_server | code: 'ETIMEDOUT', immich_server | syscall: 'connect' immich_server | } Then after a while of the spam: immich_server | Error: write CONNECT_TIMEOUT database:5432 immich_server | at connectTimedOut (/usr/src/app/server/node_modules/postgres/cjs/src/connection.js:257:20) immich_server | at Timeout.done [as _onTimeout] (/usr/src/app/server/node_modules/postgres/cjs/src/connection.js:1039:8) immich_server | at listOnTimeout (node:internal/timers:590:11) immich_server | at process.processTimers (node:internal/timers:523:7) { immich_server | code: 'CONNECT_TIMEOUT', immich_server | errno: 'CONNECT_TIMEOUT', immich_server | address: 'database', immich_server | port: 5432 immich_server | } immich_server | microservices worker error: Error: write CONNECT_TIMEOUT database:5432, stack: Error: write CONNECT_TIMEOUT database:5432 immich_server | at connectTimedOut (/usr/src/app/server/node_modules/postgres/cjs/src/connection.js:257:20) immich_server | at Timeout.done [as _onTimeout] (/usr/src/app/server/node_modules/postgres/cjs/src/connection.js:1039:8) immich_server | at listOnTimeout (node:internal/timers:590:11) immich_server | at process.processTimers (node:internal/timers:523:7) immich_server | microservices worker exited with code 1 immich_server | Killing api process immich_server | Initializing Immich v1.137.3 immich_server | Detected CPU Cores: 8 immich_server | Starting api worker immich_server | Starting microservices worker immich_server | [Nest] 7 - 08/13/2025, 11:07:50 PM LOG [Microservices:EventRepository] Initialized websocket server immich_server | [Nest] 18 - 08/13/2025, 11:07:50 PM LOG [Api:EventRepository] Initialized websocket server And then the whole thing repeats again
schuhbacca
schuhbacca•3w ago
It's also failing to connect to the db. How are you running all this? Linux? WIndows? Please post yoru compose and env
remarkable
remarkableOP•3w ago
Everything is running on ubuntu
schuhbacca
schuhbacca•3w ago
Please edit use backticks for code formatting
remarkable
remarkableOP•3w ago
schuhbacca
schuhbacca•3w ago
Any logs from the postgres container?
remarkable
remarkableOP•3w ago
just a bunch of this: immich_postgres | immich_postgres | PostgreSQL Database directory appears to contain a database; Skipping initialization immich_postgres | immich_postgres | 2025-08-06 04:19:03.526 UTC [1] LOG: redirecting log output to logging collector process immich_postgres | 2025-08-06 04:19:03.526 UTC [1] HINT: Future log output will appear in directory "log". immich_postgres | immich_postgres | PostgreSQL Database directory appears to contain a database; Skipping initialization immich_postgres | immich_postgres | 2025-08-13 17:55:03.017 UTC [1] LOG: redirecting log output to logging collector process immich_postgres | 2025-08-13 17:55:03.017 UTC [1] HINT: Future log output will appear in directory "log". immich_postgres | immich_postgres | PostgreSQL Database directory appears to contain a database; Skipping initialization immich_postgres | immich_postgres | 2025-08-13 18:38:02.802 UTC [1] LOG: redirecting log output to logging collector process immich_postgres | 2025-08-13 18:38:02.802 UTC [1] HINT: Future log output will appear in directory "log". immich_postgres | immich_postgres | PostgreSQL Database directory appears to contain a database; Skipping initialization immich_postgres | immich_postgres | 2025-08-14 13:16:36.567 UTC [1] LOG: redirecting log output to logging collector process immich_postgres | 2025-08-14 13:16:36.567 UTC [1] HINT: Future log output will appear in directory "log".
Mraedis
Mraedis•3w ago
What version is this? 👀 it seems pretty old
remarkable
remarkableOP•3w ago
Not sure where to find that, but I just did a docker compose pull to get the latest image before I submitted this request
Mraedis
Mraedis•3w ago
You did not apply the breaking changes from 133/136/137 then
remarkable
remarkableOP•3w ago
I just applied the 133 breaking changes, and I dont think the others apply to me I still have the same issue New database logs: docker compose logs database immich_postgres | Using SSD storage immich_postgres | immich_postgres | PostgreSQL Database directory appears to contain a database; Skipping initialization immich_postgres | immich_postgres | 2025-08-14 14:33:10.797 GMT [1] LOG: skipping missing configuration file "/var/lib/postgresql/data/postgresql.override.conf" immich_postgres | 2025-08-14 14:33:10.798 GMT [1] LOG: skipping missing configuration file "/var/lib/postgresql/data/postgresql.override.conf" immich_postgres | 2025-08-14 14:33:12.751 UTC [1] LOG: starting PostgreSQL 14.18 (Debian 14.18-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit immich_postgres | 2025-08-14 14:33:12.751 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 immich_postgres | 2025-08-14 14:33:12.751 UTC [1] LOG: listening on IPv6 address "::", port 5432 immich_postgres | 2025-08-14 14:33:12.753 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" immich_postgres | 2025-08-14 14:33:12.759 UTC [31] LOG: database system was shut down at 2025-08-14 14:32:35 UTC immich_postgres | [2025-08-14T14:33:12Z INFO service::utils::clean] Find directory "pg_vectors/indexes/17332". immich_postgres | [2025-08-14T14:33:12Z INFO service::utils::clean] Find directory "pg_vectors/indexes/17576". immich_postgres | [2025-08-14T14:33:12Z INFO service::utils::clean] Find directory "pg_vectors/indexes/17576/segments/6778e0bf-0070-45ee-8c3c-eb6ca3daee67". immich_postgres | [2025-08-14T14:33:12Z INFO service::utils::clean] Find directory "pg_vectors/indexes/17332/segments/440b9ea2-9fa9-4dc4-8648-8db23132a046". immich_postgres | 2025-08-14 14:33:12.772 UTC [1] LOG: database system is ready to accept connections I am assuming something is messed up/ corrupted in the database stuff somewhere. How do I delete everything from immich (docker images, database, etc, and Ill just spin up a new version and re-import my photos)
schuhbacca
schuhbacca•3w ago
If you want to start over I would basically just create new folders for postgres and the UPLOAD_LOCATION. Bring down the stack, change the UPLOAD_LOCATION and postgres lcoation to the new folders. Bring stack back up.
remarkable
remarkableOP•3w ago
ok, even doing that somehow still produces the same error
schuhbacca
schuhbacca•3w ago
What's the error with a new install? Also what's the output of df -T?
remarkable
remarkableOP•3w ago
its just more of this, immich-server is stick on starting and never makes it df -T Filesystem Type 1K-blocks Used Available Use% Mounted on tmpfs tmpfs 3277012 5836 3271176 1% /run /dev/sdb2 ext4 1967882248 346431396 1531656880 19% / tmpfs tmpfs 16385040 19720 16365320 1% /dev/shm tmpfs tmpfs 5120 24 5096 1% /run/lock tmpfs tmpfs 3277008 2688 3274320 1% /run/user/1000 Plenty of disk space I think
schuhbacca
schuhbacca•3w ago
Sure you brought down the stack, and moved all the references? Not sure why an initial install would fail
remarkable
remarkableOP•3w ago
In the .env, I changed the database and upload locations to new folders and tried to bring it up could it be some sort of permission issue? I ran the docker compose as sudo to so if that would help but no luck I was able to get it up and running in a completely new folder. Is there a way to give immich folder permissions so I dont have to run it as sudo? I get the error again when I do not run as sudo
remarkable
remarkableOP•3w ago
Thanks for the help and links

Did you find this page helpful?