Error from most of the containers when starting compose stack with config file
Using docker compose, traefik, remote linux/ubuntu jammy 22.04. I'll paste the compose as a comment along w the
.env
21 Replies
compose:
.env
:
# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables
# The location where your uploaded files are stored
UPLOAD_LOCATION=/mnt/unionfs/Media/Photos
# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=release
# Connection secrets for postgres and typesense. You should change these to random passwords
TYPESENSE_API_KEY=REDACTED_LIKE_A_MF
DB_PASSWORD=postgres
# Config dir. Name config as you please, and place in this dir
IMMICH_CONFIG_FILE=immich.config
# The values below this line do not need to be changed
###################################################################################
DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_DATABASE_NAME=immich
REDIS_HOSTNAME=immich_redis
# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables
# The location where your uploaded files are stored
UPLOAD_LOCATION=/mnt/unionfs/Media/Photos
# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=release
# Connection secrets for postgres and typesense. You should change these to random passwords
TYPESENSE_API_KEY=REDACTED_LIKE_A_MF
DB_PASSWORD=postgres
# Config dir. Name config as you please, and place in this dir
IMMICH_CONFIG_FILE=immich.config
# The values below this line do not need to be changed
###################################################################################
DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_DATABASE_NAME=immich
REDIS_HOSTNAME=immich_redis
Can you also post your (redacted) config file and the error logs?
sure just a sec.
immich.config:
I don't have the errors all in one place, been checking with
{
"ffmpeg": {
"crf": 23,
"threads": 0,
"preset": "ultrafast",
"targetVideoCodec": "h264",
"targetAudioCodec": "aac",
"targetResolution": "720",
"maxBitrate": "0",
"bframes": -1,
"refs": 0,
"gopSize": 0,
"npl": 0,
"temporalAQ": false,
"cqMode": "auto",
"twoPass": false,
"transcode": "required",
"tonemap": "hable",
"accel": "qsv"
},
"job": {
"backgroundTask": {
"concurrency": 5
},
"clipEncoding": {
"concurrency": 2
},
"metadataExtraction": {
"concurrency": 5
},
"objectTagging": {
"concurrency": 2
},
"recognizeFaces": {
"concurrency": 2
},
"search": {
"concurrency": 5
},
"sidecar": {
"concurrency": 5
},
"library": {
"concurrency": 5
},
"storageTemplateMigration": {
"concurrency": 5
},
"migration": {
"concurrency": 5
},
"thumbnailGeneration": {
"concurrency": 5
},
"videoConversion": {
"concurrency": 1
}
},
"machineLearning": {
"enabled": true,
"url": "http://immich-machine-learning:3003",
"classification": {
"enabled": true,
"modelName": "microsoft/resnet-50",
"minScore": 0.9
},
"clip": {
"enabled": true,
"modelName": "ViT-B-32::openai"
},
"facialRecognition": {
"enabled": true,
"modelName": "buffalo_l",
"minScore": 0.7,
"maxDistance": 0.6,
"minFaces": 1
}
},
"map": {
"enabled": true,
"tileUrl": "https://tile.openstreetmap.org/{z}/{x}/{y}.png"
},
"reverseGeocoding": {
"enabled": true,
"citiesFileOverride": "cities500"
},
"oauth": {
"enabled": false,
"issuerUrl": "",
"clientId": "",
"clientSecret": "",
"mobileOverrideEnabled": false,
"mobileRedirectUri": "",
"scope": "openid email profile",
"storageLabelClaim": "preferred_username",
"buttonText": "Login with OAuth",
"autoRegister": true,
"autoLaunch": false
},
"passwordLogin": {
"enabled": true
},
"storageTemplate": {
"template": "{{y}}/{{y}}-{{MM}}-{{dd}}/{{filename}}"
},
"thumbnail": {
"webpSize": 250,
"jpegSize": 1440,
"quality": 80,
"colorspace": "p3"
},
"newVersionCheck": {
"enabled": true
},
"trash": {
"enabled": true,
"days": 30
},
"theme": {
"customCss": ""
}
}
{
"ffmpeg": {
"crf": 23,
"threads": 0,
"preset": "ultrafast",
"targetVideoCodec": "h264",
"targetAudioCodec": "aac",
"targetResolution": "720",
"maxBitrate": "0",
"bframes": -1,
"refs": 0,
"gopSize": 0,
"npl": 0,
"temporalAQ": false,
"cqMode": "auto",
"twoPass": false,
"transcode": "required",
"tonemap": "hable",
"accel": "qsv"
},
"job": {
"backgroundTask": {
"concurrency": 5
},
"clipEncoding": {
"concurrency": 2
},
"metadataExtraction": {
"concurrency": 5
},
"objectTagging": {
"concurrency": 2
},
"recognizeFaces": {
"concurrency": 2
},
"search": {
"concurrency": 5
},
"sidecar": {
"concurrency": 5
},
"library": {
"concurrency": 5
},
"storageTemplateMigration": {
"concurrency": 5
},
"migration": {
"concurrency": 5
},
"thumbnailGeneration": {
"concurrency": 5
},
"videoConversion": {
"concurrency": 1
}
},
"machineLearning": {
"enabled": true,
"url": "http://immich-machine-learning:3003",
"classification": {
"enabled": true,
"modelName": "microsoft/resnet-50",
"minScore": 0.9
},
"clip": {
"enabled": true,
"modelName": "ViT-B-32::openai"
},
"facialRecognition": {
"enabled": true,
"modelName": "buffalo_l",
"minScore": 0.7,
"maxDistance": 0.6,
"minFaces": 1
}
},
"map": {
"enabled": true,
"tileUrl": "https://tile.openstreetmap.org/{z}/{x}/{y}.png"
},
"reverseGeocoding": {
"enabled": true,
"citiesFileOverride": "cities500"
},
"oauth": {
"enabled": false,
"issuerUrl": "",
"clientId": "",
"clientSecret": "",
"mobileOverrideEnabled": false,
"mobileRedirectUri": "",
"scope": "openid email profile",
"storageLabelClaim": "preferred_username",
"buttonText": "Login with OAuth",
"autoRegister": true,
"autoLaunch": false
},
"passwordLogin": {
"enabled": true
},
"storageTemplate": {
"template": "{{y}}/{{y}}-{{MM}}-{{dd}}/{{filename}}"
},
"thumbnail": {
"webpSize": 250,
"jpegSize": 1440,
"quality": 80,
"colorspace": "p3"
},
"newVersionCheck": {
"enabled": true
},
"trash": {
"enabled": true,
"days": 30
},
"theme": {
"customCss": ""
}
}
docker compose logs -f
after spinning things up.
immich_microservices | [Nest] 7 - 10/31/2023, 9:43:38 AM ERROR [SystemConfigCore] Unable to load configuration file: immich.config due to Error: ENOENT: no such file or directory, open 'immich.config'
immich_microservices | Error: ENOENT: no such file or directory, open 'immich.config'
immich_microservices | [Nest] 7 - 10/31/2023, 9:43:38 AM ERROR [ExceptionHandler] Invalid configuration file
immich_microservices | Error: Invalid configuration file
immich_microservices | at SystemConfigCore.loadFromFile (/usr/src/app/dist/domain/system-config/system-config.core.js:312:23)
immich_microservices | at async SystemConfigCore.getConfig (/usr/src/app/dist/domain/system-config/system-config.core.js:234:44)
immich_microservices | at async SystemConfigService.getConfig (/usr/src/app/dist/domain/system-config/system-config.service.js:37:24)
immich_microservices | at async Injector.instantiateClass (/usr/src/app/node_modules/@nestjs/core/injector/injector.js:369:37)
immich_microservices | at async callback (/usr/src/app/node_modules/@nestjs/core/injector/injector.js:65:34)
immich_microservices | at async Injector.resolveConstructorParams (/usr/src/app/node_modules/@nestjs/core/injector/injector.js:144:24)
immich_microservices | at async Injector.loadInstance (/usr/src/app/node_modules/@nestjs/core/injector/injector.js:70:13)
immich_microservices | at async Injector.loadProvider (/usr/src/app/node_modules/@nestjs/core/injector/injector.js:97:9)
immich_microservices | at async /usr/src/app/node_modules/@nestjs/core/injector/instance-loader.js:56:13
immich_microservices | at async Promise.all (index 23)
immich_microservices exited with code 1
immich_microservices | [Nest] 7 - 10/31/2023, 9:43:38 AM ERROR [SystemConfigCore] Unable to load configuration file: immich.config due to Error: ENOENT: no such file or directory, open 'immich.config'
immich_microservices | Error: ENOENT: no such file or directory, open 'immich.config'
immich_microservices | [Nest] 7 - 10/31/2023, 9:43:38 AM ERROR [ExceptionHandler] Invalid configuration file
immich_microservices | Error: Invalid configuration file
immich_microservices | at SystemConfigCore.loadFromFile (/usr/src/app/dist/domain/system-config/system-config.core.js:312:23)
immich_microservices | at async SystemConfigCore.getConfig (/usr/src/app/dist/domain/system-config/system-config.core.js:234:44)
immich_microservices | at async SystemConfigService.getConfig (/usr/src/app/dist/domain/system-config/system-config.service.js:37:24)
immich_microservices | at async Injector.instantiateClass (/usr/src/app/node_modules/@nestjs/core/injector/injector.js:369:37)
immich_microservices | at async callback (/usr/src/app/node_modules/@nestjs/core/injector/injector.js:65:34)
immich_microservices | at async Injector.resolveConstructorParams (/usr/src/app/node_modules/@nestjs/core/injector/injector.js:144:24)
immich_microservices | at async Injector.loadInstance (/usr/src/app/node_modules/@nestjs/core/injector/injector.js:70:13)
immich_microservices | at async Injector.loadProvider (/usr/src/app/node_modules/@nestjs/core/injector/injector.js:97:9)
immich_microservices | at async /usr/src/app/node_modules/@nestjs/core/injector/instance-loader.js:56:13
immich_microservices | at async Promise.all (index 23)
immich_microservices exited with code 1
ENOENT: no such file or directory, open 'immich.config'You probably want to use an absolute path
IMMICH_CONFIG_FILE=/immich.config
legitimately didn't think of that. idk why. fwiw it worked fine like this before. the compose has the config mapped to immich server just as a test. I figured I'd ask here first.
ill give it a whirl just a sec
no good
Well the error is from immich_microservices, which you haven't mounted the config file to
immich_server | [Nest] 7 - 10/31/2023, 9:59:27 AM LOG [NestFactory] Starting Nest application...
immich_server | [Nest] 7 - 10/31/2023, 9:59:27 AM LOG [InstanceLoader] TypeOrmModule dependencies initialized +25ms
immich_server | [Nest] 7 - 10/31/2023, 9:59:27 AM LOG [InstanceLoader] BullModule dependencies initialized +0ms
immich_server | [Nest] 7 - 10/31/2023, 9:59:27 AM LOG [InstanceLoader] ConfigHostModule dependencies initialized +0ms
immich_server | [Nest] 7 - 10/31/2023, 9:59:27 AM LOG [InstanceLoader] DiscoveryModule dependencies initialized +0ms
immich_server | [Nest] 7 - 10/31/2023, 9:59:27 AM LOG [InstanceLoader] ConfigModule dependencies initialized +5ms
immich_server | [Nest] 7 - 10/31/2023, 9:59:27 AM LOG [InstanceLoader] ScheduleModule dependencies initialized +0ms
immich_server | [Nest] 7 - 10/31/2023, 9:59:27 AM LOG [InstanceLoader] BullModule dependencies initialized +0ms
immich_server | [Nest] 7 - 10/31/2023, 9:59:27 AM LOG [InstanceLoader] BullModule dependencies initialized +0ms
immich_microservices exited with code 1
immich_server | [Nest] 7 - 10/31/2023, 9:59:27 AM LOG [InstanceLoader] TypeOrmCoreModule dependencies initialized +160ms
immich_server | [Nest] 7 - 10/31/2023, 9:59:27 AM LOG [InstanceLoader] TypeOrmModule dependencies initialized +0ms
immich_server | [Nest] 7 - 10/31/2023, 9:59:27 AM LOG [InstanceLoader] TypeOrmModule dependencies initialized +0ms
immich_server | [Nest] 7 - 10/31/2023, 9:59:27 AM LOG [InstanceLoader] InfraModule dependencies initialized +2ms
immich_server | [Nest] 7 - 10/31/2023, 9:59:27 AM LOG [InstanceLoader] AppModule dependencies initialized +3ms
immich_server | [Nest] 7 - 10/31/2023, 9:59:27 AM ERROR [SystemConfigCore] Unable to load configuration file: /opt/immich/immich.config due to Error: ENOENT: no such file or directory, open '/opt/immich/immich.config'
immich_server | Error: ENOENT: no such file or directory, open '/opt/immich/immich.config'
immich_server | [Nest] 7 - 10/31/2023, 9:59:27 AM ERROR [ExceptionHandler] Invalid configuration file
immich_server | Error: Invalid configuration file
immich_server | at SystemConfigCore.loadFromFile (/usr/src/app/dist/domain/system-config/system-config.core.js:312:23)
immich_server | at async SystemConfigCore.getConfig (/usr/src/app/dist/domain/system-config/system-config.core.js:234:44)
immich_server | at async SystemConfigService.getConfig (/usr/src/app/dist/domain/system-config/system-config.service.js:37:24)
immich_server | at async Injector.instantiateClass (/usr/src/app/node_modules/@nestjs/core/injector/injector.js:369:37)
immich_server | at async callback (/usr/src/app/node_modules/@nestjs/core/injector/injector.js:65:34)
immich_server | at async Injector.resolveConstructorParams (/usr/src/app/node_modules/@nestjs/core/injector/injector.js:144:24)
immich_server | at async Injector.loadInstance (/usr/src/app/node_modules/@nestjs/core/injector/injector.js:70:13)
immich_server | at async Injector.loadProvider (/usr/src/app/node_modules/@nestjs/core/injector/injector.js:97:9)
immich_server | at async /usr/src/app/node_modules/@nestjs/core/injector/instance-loader.js:56:13
immich_server | at async Promise.all (index 23)
immich_server exited with code 1
immich_server | [Nest] 7 - 10/31/2023, 9:59:27 AM LOG [NestFactory] Starting Nest application...
immich_server | [Nest] 7 - 10/31/2023, 9:59:27 AM LOG [InstanceLoader] TypeOrmModule dependencies initialized +25ms
immich_server | [Nest] 7 - 10/31/2023, 9:59:27 AM LOG [InstanceLoader] BullModule dependencies initialized +0ms
immich_server | [Nest] 7 - 10/31/2023, 9:59:27 AM LOG [InstanceLoader] ConfigHostModule dependencies initialized +0ms
immich_server | [Nest] 7 - 10/31/2023, 9:59:27 AM LOG [InstanceLoader] DiscoveryModule dependencies initialized +0ms
immich_server | [Nest] 7 - 10/31/2023, 9:59:27 AM LOG [InstanceLoader] ConfigModule dependencies initialized +5ms
immich_server | [Nest] 7 - 10/31/2023, 9:59:27 AM LOG [InstanceLoader] ScheduleModule dependencies initialized +0ms
immich_server | [Nest] 7 - 10/31/2023, 9:59:27 AM LOG [InstanceLoader] BullModule dependencies initialized +0ms
immich_server | [Nest] 7 - 10/31/2023, 9:59:27 AM LOG [InstanceLoader] BullModule dependencies initialized +0ms
immich_microservices exited with code 1
immich_server | [Nest] 7 - 10/31/2023, 9:59:27 AM LOG [InstanceLoader] TypeOrmCoreModule dependencies initialized +160ms
immich_server | [Nest] 7 - 10/31/2023, 9:59:27 AM LOG [InstanceLoader] TypeOrmModule dependencies initialized +0ms
immich_server | [Nest] 7 - 10/31/2023, 9:59:27 AM LOG [InstanceLoader] TypeOrmModule dependencies initialized +0ms
immich_server | [Nest] 7 - 10/31/2023, 9:59:27 AM LOG [InstanceLoader] InfraModule dependencies initialized +2ms
immich_server | [Nest] 7 - 10/31/2023, 9:59:27 AM LOG [InstanceLoader] AppModule dependencies initialized +3ms
immich_server | [Nest] 7 - 10/31/2023, 9:59:27 AM ERROR [SystemConfigCore] Unable to load configuration file: /opt/immich/immich.config due to Error: ENOENT: no such file or directory, open '/opt/immich/immich.config'
immich_server | Error: ENOENT: no such file or directory, open '/opt/immich/immich.config'
immich_server | [Nest] 7 - 10/31/2023, 9:59:27 AM ERROR [ExceptionHandler] Invalid configuration file
immich_server | Error: Invalid configuration file
immich_server | at SystemConfigCore.loadFromFile (/usr/src/app/dist/domain/system-config/system-config.core.js:312:23)
immich_server | at async SystemConfigCore.getConfig (/usr/src/app/dist/domain/system-config/system-config.core.js:234:44)
immich_server | at async SystemConfigService.getConfig (/usr/src/app/dist/domain/system-config/system-config.service.js:37:24)
immich_server | at async Injector.instantiateClass (/usr/src/app/node_modules/@nestjs/core/injector/injector.js:369:37)
immich_server | at async callback (/usr/src/app/node_modules/@nestjs/core/injector/injector.js:65:34)
immich_server | at async Injector.resolveConstructorParams (/usr/src/app/node_modules/@nestjs/core/injector/injector.js:144:24)
immich_server | at async Injector.loadInstance (/usr/src/app/node_modules/@nestjs/core/injector/injector.js:70:13)
immich_server | at async Injector.loadProvider (/usr/src/app/node_modules/@nestjs/core/injector/injector.js:97:9)
immich_server | at async /usr/src/app/node_modules/@nestjs/core/injector/instance-loader.js:56:13
immich_server | at async Promise.all (index 23)
immich_server exited with code 1
Now it's looking for the file at
/opt/immich/immich.config
, which doesn't exist in the container. (Your mount is /opt/immich/immich.config:/immich.config
)is there a docker env variable for config?
Now it's looking for the file at /opt/immich/immich.config, which doesn't exist in the container. (Your mount is /opt/immich/immich.config:/immich.config)yeah I realized that just now. :p
IMMICH_CONFIG_FILE
is where the application looks for the config file inside of the container. It's on you to mount it to the path you configure thereit should be good now afaik. still getting the same errors.
mount:
- /opt/immich/immich.config:/immich.config
.env: IMMICH_CONFIG_FILE=immich.config
both server and microservices have the mount.
perms shouldn't be an issue as the file is owned by my user and perms are 775
oh I suppose I should mention its non-root.Did you try with the absolute path?
IMMICH_CONFIG_FILE=/immich.config
yes, tried that just now as well.
Can you exec into each of the containers and post the output of
echo $IMMICH_CONFIG_FILE; cat $IMMICH_CONFIG_FILE
sure, gotta start it back up just a sec
not going to be able to as it keeps restarting.
ML is running.
I don't currently have that mounted to the containers though. I removed it at some point. just a sec
got it figured out.
well for ML at least.
docker exec -it immich_microservices /bin/bash
Error response from daemon: Container 4e93d9a6196a3f3fa9f22b2d30e896592cc59c3c8aeffb8c3ef93b8812813e8f is restarting, wait until the container is running
docker exec -it immich_microservices /bin/bash
Error response from daemon: Container 4e93d9a6196a3f3fa9f22b2d30e896592cc59c3c8aeffb8c3ef93b8812813e8f is restarting, wait until the container is running
root@immich_machine_learning:/usr/src/app# echo $IMMICH_CONFIG_FILE; cat $IMMICH_CONFIG_FILE
/opt/immich/immich.config
cat: /opt/immich/immich.config: No such file or directory
root@immich_machine_learning:/usr/src/app# echo $IMMICH_CONFIG_FILE; cat $IMMICH_CONFIG_FILE
/opt/immich/immich.config
cat: /opt/immich/immich.config: No such file or directory
Only server and microservices use the config file, it's not relevant for the other containers
all set. mostly user error. :p tyvm for the help @bo0tzz : )
Also, I think machine learning does too, as the default compose has it in there.
QQ about this error when you have a moment, I'm sure it has something to do with my using cloudflare.
...
immich-machine-learning:
container_name: immich_machine_learning
image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
volumes:
- model-cache:/cache
env_file:
- .env
restart: always
...
...
immich-machine-learning:
container_name: immich_machine_learning
image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
volumes:
- model-cache:/cache
env_file:
- .env
restart: always
...
immich_server | [Nest] 7 - 10/31/2023, 10:20:36 AM ERROR [ExpressAdapter] Premature close
immich_server | Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close
immich_server | at new NodeError (node:internal/errors:406:5)
immich_server | at ServerResponse.onclose (node:internal/streams/end-of-stream:159:30)
immich_server | at ServerResponse.emit (node:events:526:35)
immich_server | at emitCloseNT (node:_http_server:1023:10)
immich_server | at Socket.onServerResponseClose (node:_http_server:278:5)
immich_server | at Socket.emit (node:events:526:35)
immich_server | at TCP.<anonymous> (node:net:337:12)
immich_server | [Nest] 7 - 10/31/2023, 10:20:38 AM LOG [CommunicationRepository] Websocket Connect: OzpSvQXr7YsDrve8AAAF
immich_server | [Nest] 7 - 10/31/2023, 10:20:36 AM ERROR [ExpressAdapter] Premature close
immich_server | Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close
immich_server | at new NodeError (node:internal/errors:406:5)
immich_server | at ServerResponse.onclose (node:internal/streams/end-of-stream:159:30)
immich_server | at ServerResponse.emit (node:events:526:35)
immich_server | at emitCloseNT (node:_http_server:1023:10)
immich_server | at Socket.onServerResponseClose (node:_http_server:278:5)
immich_server | at Socket.emit (node:events:526:35)
immich_server | at TCP.<anonymous> (node:net:337:12)
immich_server | [Nest] 7 - 10/31/2023, 10:20:38 AM LOG [CommunicationRepository] Websocket Connect: OzpSvQXr7YsDrve8AAAF
You can ignore
Premature close
error, it happens when you hover on a videoOh fantastic, thank you : )