ERROR [TypeOrmModule] Unable to connect to the database.

I'm running into an issue where Immich won't start and is just spitting a bunch of these errors:
immich_server | Error: connect ETIMEDOUT
immich_server | at Socket.<anonymous> (/usr/src/app/node_modules/ioredis/built/Redis.js:170:41)
immich_server | at Object.onceWrapper (node:events:628:28)
immich_server | at Socket.emit (node:events:514:28)
immich_server | at Socket._onTimeout (node:net:589:8)
immich_server | at listOnTimeout (node:internal/timers:573:17)
immich_server | at process.processTimers (node:internal/timers:514:7) {
immich_server | Error: connect ETIMEDOUT
immich_server | at Socket.<anonymous> (/usr/src/app/node_modules/ioredis/built/Redis.js:170:41)
immich_server | at Object.onceWrapper (node:events:628:28)
immich_server | at Socket.emit (node:events:514:28)
immich_server | at Socket._onTimeout (node:net:589:8)
immich_server | at listOnTimeout (node:internal/timers:573:17)
immich_server | at process.processTimers (node:internal/timers:514:7) {
. This is a totally fresh install so not sure what could be causing this. Thanks in advance!
10 Replies
Orbital
OrbitalOP2y ago
Looks like the issue is that none of the containers have access to either the LAN or the internet which is still something I haven't been able to figure out how to fix so if anyone has any ideas feel free to let me know
Allram
Allram2y ago
Can you post your Docker compose? And what OS is this running on?
Orbital
OrbitalOP2y ago
It’s running on Ubuntu and this is essentially just the default compose file The issue with none of my containers is an issue with all the non immich containers running on this host as well
Daniel
Daniel2y ago
This shouldn't necessarily be an issue. Do you have custom docker networks?
Orbital
OrbitalOP2y ago
Nope I’m trying to move to a new host so this is a totally fresh install of both Ubuntu and Docker Also don’t the containers need lan to connect to each other or connect to the db
Daniel
Daniel2y ago
Docker internally has a default bridge network. Most of the time that is something like 172.16.0.0/24 afaik. This is used for internal container communication I think it would still be helpful to have your docker compose and .env file. And a little more log; what does immich_redis say for instance?
Orbital
OrbitalOP2y ago
Sure I can’t grab those now unfortunately but I’ll send those as soon as I can
Orbital
OrbitalOP2y ago
Orbital
OrbitalOP2y ago
compose
Orbital
OrbitalOP2y ago
redis logs
WARN[0000] The "ZJbAV6eKAU" variable is not set. Defaulting to a blank string.
WARN[0000] The "ZJbAV6eKAU" variable is not set. Defaulting to a blank string.
WARN[0000] The "ZJbAV6eKAU" variable is not set. Defaulting to a blank string.
WARN[0000] The "ZJbAV6eKAU" variable is not set. Defaulting to a blank string.
WARN[0000] The "ZJbAV6eKAU" variable is not set. Defaulting to a blank string.
WARN[0000] The "ZJbAV6eKAU" variable is not set. Defaulting to a blank string.
WARN[0000] The "ZJbAV6eKAU" variable is not set. Defaulting to a blank string.
WARN[0000] The "ZJbAV6eKAU" variable is not set. Defaulting to a blank string.
WARN[0000] The "ZJbAV6eKAU" variable is not set. Defaulting to a blank string.
immich_redis | 1:C 08 Oct 2023 16:33:40.119 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
immich_redis | 1:C 08 Oct 2023 16:33:40.119 # Redis version=6.2.12, bits=64, commit=00000000, modified=0, pid=1, just startedimmich_redis | 1:C 08 Oct 2023 16:33:40.119 # 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 08 Oct 2023 16:33:40.119 * monotonic clock: POSIX clock_gettime
immich_redis | 1:M 08 Oct 2023 16:33:40.119 * Running mode=standalone, port=6379.
immich_redis | 1:M 08 Oct 2023 16:33:40.119 # Server initialized
immich_redis | 1:M 08 Oct 2023 16:33:40.119 # 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 08 Oct 2023 16:33:40.119 * Ready to accept connections
WARN[0000] The "ZJbAV6eKAU" variable is not set. Defaulting to a blank string.
WARN[0000] The "ZJbAV6eKAU" variable is not set. Defaulting to a blank string.
WARN[0000] The "ZJbAV6eKAU" variable is not set. Defaulting to a blank string.
WARN[0000] The "ZJbAV6eKAU" variable is not set. Defaulting to a blank string.
WARN[0000] The "ZJbAV6eKAU" variable is not set. Defaulting to a blank string.
WARN[0000] The "ZJbAV6eKAU" variable is not set. Defaulting to a blank string.
WARN[0000] The "ZJbAV6eKAU" variable is not set. Defaulting to a blank string.
WARN[0000] The "ZJbAV6eKAU" variable is not set. Defaulting to a blank string.
WARN[0000] The "ZJbAV6eKAU" variable is not set. Defaulting to a blank string.
immich_redis | 1:C 08 Oct 2023 16:33:40.119 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
immich_redis | 1:C 08 Oct 2023 16:33:40.119 # Redis version=6.2.12, bits=64, commit=00000000, modified=0, pid=1, just startedimmich_redis | 1:C 08 Oct 2023 16:33:40.119 # 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 08 Oct 2023 16:33:40.119 * monotonic clock: POSIX clock_gettime
immich_redis | 1:M 08 Oct 2023 16:33:40.119 * Running mode=standalone, port=6379.
immich_redis | 1:M 08 Oct 2023 16:33:40.119 # Server initialized
immich_redis | 1:M 08 Oct 2023 16:33:40.119 # 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 08 Oct 2023 16:33:40.119 * Ready to accept connections
Ended up figuring it out Essentially the mail server install I had going borked with the network configs when installing which removed all of the containers' abilities to have any connection to the internet or the lan which I guess messed up Immich's ability to contact the db and other needed services

Did you find this page helpful?