Skip to main content Immich Server wont start : r/immich

Immich Server wont start

I'm running it on Portainer , all db is up and running immich machine learining aswell but immich server fails
Starting microservices worker [Nest] 7 - 03/28/2025, 1:28:02 PM LOG [Microservices:EventRepository] Initialized websocket server [Nest] 17 - 03/28/2025, 1:28:02 PM LOG [Api:EventRepository] Initialized websocket server /usr/src/app/node_modules/postgres/cjs/src/connection.js:389 stack: { value: err.stack + query.origin.replace(/.*\n/, '\n'), enumerable: options.debug }, ^ TypeError: Cannot read properties of undefined (reading 'replace') at queryError (/usr/src/app/node_modules/postgres/cjs/src/connection.js:389:48) at errored (/usr/src/app/node_modules/postgres/cjs/src/connection.js:384:17) at Socket.error (/usr/src/app/node_modules/postgres/cjs/src/connection.js:376:5) at Socket.emit (node:events:518:28) at emitErrorNT (node:internal/streams/destroy:170:8) at emitErrorCloseNT (node:internal/streams/destroy:129:3) at process.processTicksAndRejections (node:internal/process/task_queues:90:21) Node.js v22.14.0 microservices worker error: TypeError: Cannot read properties of undefined (reading 'replace'), stack: TypeError: Cannot read properties of undefined (reading 'replace') at queryError (/usr/src/app/node_modules/postgres/cjs/src/connection.js:389:48) at errored (/usr/src/app/node_modules/postgres/cjs/src/connection.js:384:17) at Socket.error (/usr/src/app/node_modules/postgres/cjs/src/connection.js:376:5) at Socket.emit (node:events:518:28) at emitErrorNT (node:internal/streams/destroy:170:8) at emitErrorCloseNT (node:internal/streams/destroy:129:3) at process.processTicksAndRejections (node:internal/process/task_queues:90:21) api worker exited with code 1 Initializing Immich v1.130.3 Detected CPU Cores: 6 Starting api worker Starting microservices worker

[Nest] 7 - 03/28/2025, 1:28:02 PM LOG [Microservices:EventRepository] Initialized websocket server [Nest] 17 - 03/28/2025, 1:28:02 PM LOG [Api:EventRepository] Initialized websocket server /usr/src/app/node_modules/postgres/cjs/src/connection.js:389 stack: { value: err.stack + query.origin.replace(/.*\n/, '\n'), enumerable: options.debug }, ^ TypeError: Cannot read properties of undefined (reading 'replace') at queryError (/usr/src/app/node_modules/postgres/cjs/src/connection.js:389:48) at errored (/usr/src/app/node_modules/postgres/cjs/src/connection.js:384:17) at Socket.error (/usr/src/app/node_modules/postgres/cjs/src/connection.js:376:5) at Socket.emit (node:events:518:28) at emitErrorNT (node:internal/streams/destroy:170:8) at emitErrorCloseNT (node:internal/streams/destroy:129:3) at process.processTicksAndRejections (node:internal/process/task_queues:90:21) Node.js v22.14.0 microservices worker error: TypeError: Cannot read properties of undefined (reading 'replace'), stack: TypeError: Cannot read properties of undefined (reading 'replace') at queryError (/usr/src/app/node_modules/postgres/cjs/src/connection.js:389:48) at errored (/usr/src/app/node_modules/postgres/cjs/src/connection.js:384:17) at Socket.error (/usr/src/app/node_modules/postgres/cjs/src/connection.js:376:5) at Socket.emit (node:events:518:28) at emitErrorNT (node:internal/streams/destroy:170:8) at emitErrorCloseNT (node:internal/streams/destroy:129:3) at process.processTicksAndRejections (node:internal/process/task_queues:90:21) api worker exited with code 1 Initializing Immich v1.130.3 Detected CPU Cores: 6 Starting api worker Starting microservices worker

thanks for the effort 🙏

I have same error - did you manage to fix this?

Nope :(

I finally managed to get this running. Maybe this can help. I found that once the install was borked in portainer, there was no bringing it back when you are using stack...something is always remembered it seems, so here are a couple of things i discovered.

  1. If install goes sideways, in portainer remove the 4 containers, go to volumes and delete any unused and then you also SSH in and go to /data where you should see a "compose" folder. Inside that will be numbered folder(s), how many will depend on how many times you tried to install it I think (I had 4 or 5). Use rm -r /data/compose - that will wipe out all traces.

  2. in portainer, build a new stack with a different name, or at the very least stop the stack - this seems to be a necessary step - then redeploy stack.

  3. I left everything the way the instructions said, but didn't want to use the default storage location, so instead of changing the UPLOAD_LOCATION variable from ./library (which is in /data/compose/##) I created a symbolic link from library to a share on my NAS after using mv to rename library to library_backup (use ln -s /mnt/<your share name> /data/compose/##/library. Doing this allowed me to keep everything exactly as the docs indicate, but use my own location for storage.

Hope something here helps you.

More replies
More replies
More replies