Docker image is missing dist directory, so migrations cant not run #6587

Closed
opened 2026-02-05 12:23:41 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @halkeye on GitHub (Jul 26, 2025).

I have searched the existing issues, both open and closed, to make sure this is not a duplicate report.

  • Yes

The bug

Docker image can not run migrations:run as dist directory does not exist
it looks like its in server/dist
but npm run migrations:run doesn't work in server

The OS that Immich Server is running on

Docker

Version of Immich Server

v1.136.0

Version of Immich Mobile App

n/a

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

N/a

Your .env content

N/a

Reproduction steps

  1. docker run -it --rm --entrypoint bash ghcr.io/immich-app/immich-server:v1.136.0 -c "npm run migrations:run"

...

Relevant log output

> immich@1.136.0 migrations:run
> node ./dist/bin/migrations.js run

node:internal/modules/cjs/loader:1404
  throw err;
  ^

Error: Cannot find module '/usr/src/app/dist/bin/migrations.js'
    at Function._resolveFilename (node:internal/modules/cjs/loader:1401:15)
    at defaultResolveImpl (node:internal/modules/cjs/loader:1057:19)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1062:22)
    at Function._load (node:internal/modules/cjs/loader:1211:37)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:171:5)
    at node:internal/main/run_main_module:36:49 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v22.17.0

Additional information

No response

Originally created by @halkeye on GitHub (Jul 26, 2025). ### I have searched the existing issues, both open and closed, to make sure this is not a duplicate report. - [x] Yes ### The bug Docker image can not run migrations:run as dist directory does not exist it looks like its in server/dist but npm run migrations:run doesn't work in server ### The OS that Immich Server is running on Docker ### Version of Immich Server v1.136.0 ### Version of Immich Mobile App n/a ### Platform with the issue - [x] Server - [ ] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML N/a ``` ### Your .env content ```Shell N/a ``` ### Reproduction steps 1. docker run -it --rm --entrypoint bash ghcr.io/immich-app/immich-server:v1.136.0 -c "npm run migrations:run" 2. 3. ... ### Relevant log output ```shell > immich@1.136.0 migrations:run > node ./dist/bin/migrations.js run node:internal/modules/cjs/loader:1404 throw err; ^ Error: Cannot find module '/usr/src/app/dist/bin/migrations.js' at Function._resolveFilename (node:internal/modules/cjs/loader:1401:15) at defaultResolveImpl (node:internal/modules/cjs/loader:1057:19) at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1062:22) at Function._load (node:internal/modules/cjs/loader:1211:37) at TracingChannel.traceSync (node:diagnostics_channel:322:14) at wrapModuleLoad (node:internal/modules/cjs/loader:235:24) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:171:5) at node:internal/main/run_main_module:36:49 { code: 'MODULE_NOT_FOUND', requireStack: [] } Node.js v22.17.0 ``` ### Additional information _No response_
Author
Owner

@bo0tzz commented on GitHub (Jul 26, 2025):

Why are you running the migrations like this instead of just letting the server handle it?

@bo0tzz commented on GitHub (Jul 26, 2025): Why are you running the migrations like this instead of just letting the server handle it?
Author
Owner

@halkeye commented on GitHub (Jul 26, 2025):

I have a single job that runs migrations once instead of possibly multiple pods colliding and running them at the same time.

@halkeye commented on GitHub (Jul 26, 2025): I have a single job that runs migrations once instead of possibly multiple pods colliding and running them at the same time.
Author
Owner

@bo0tzz commented on GitHub (Jul 26, 2025):

That's all handled already, they will take a lock and attempt to run the migrations in turn (with most of them skipping them since they've already been run).

@bo0tzz commented on GitHub (Jul 26, 2025): That's all handled already, they will take a lock and attempt to run the migrations in turn (with most of them skipping them since they've already been run).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#6587