[BUG] Improve error message for invalid configuration files #1810

Closed
opened 2026-02-05 03:57:54 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @agross on GitHub (Dec 17, 2023).

The bug

I consider this a bug because the error message is non-actionable.

After upgrading from 1.91.0 to 1.91.2 (a bugfix upgrade!) the server refuses to start because something in the configuration file has changed.

[Nest] 7  - 12/17/2023, 11:10:15 AM   ERROR [ExceptionHandler] Invalid configuration file
Error: Invalid configuration file
    at SystemConfigCore.loadFromFile (/usr/src/app/dist/domain/system-config/system-config.core.js:324:23)
    at async SystemConfigCore.getConfig (/usr/src/app/dist/domain/system-config/system-config.core.js:245:44)
    at async SystemConfigService.getConfig (/usr/src/app/dist/domain/system-config/system-config.service.js:48:24)
    at async Injector.instantiateClass (/usr/src/app/node_modules/@nestjs/core/injector/injector.js:369:37)
    at async callback (/usr/src/app/node_modules/@nestjs/core/injector/injector.js:65:34)
    at async Injector.resolveConstructorParams (/usr/src/app/node_modules/@nestjs/core/injector/injector.js:144:24)
    at async Injector.loadInstance (/usr/src/app/node_modules/@nestjs/core/injector/injector.js:70:13)
    at async Injector.loadProvider (/usr/src/app/node_modules/@nestjs/core/injector/injector.js:97:9)
    at async /usr/src/app/node_modules/@nestjs/core/injector/instance-loader.js:56:13
    at async Promise.all (index 25)

The OS that Immich Server is running on

doesn't matter

Version of Immich Server

1.91.2

Version of Immich Mobile App

doesn't matter

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

doesn't matter

Your .env content

doesn't matter

Reproduction steps

1. Mount a configuration file with keys that are not supported.

Additional information

Unsupported configuration keys could be ignored by the system.

If the JSON file is invalid for formatting reasons, this should be reported as an error.

Originally created by @agross on GitHub (Dec 17, 2023). ### The bug I consider this a bug because the error message is non-actionable. After upgrading from 1.91.0 to 1.91.2 (a bugfix upgrade!) the server refuses to start because something in the configuration file has changed. ``` [Nest] 7 - 12/17/2023, 11:10:15 AM ERROR [ExceptionHandler] Invalid configuration file Error: Invalid configuration file at SystemConfigCore.loadFromFile (/usr/src/app/dist/domain/system-config/system-config.core.js:324:23) at async SystemConfigCore.getConfig (/usr/src/app/dist/domain/system-config/system-config.core.js:245:44) at async SystemConfigService.getConfig (/usr/src/app/dist/domain/system-config/system-config.service.js:48:24) at async Injector.instantiateClass (/usr/src/app/node_modules/@nestjs/core/injector/injector.js:369:37) at async callback (/usr/src/app/node_modules/@nestjs/core/injector/injector.js:65:34) at async Injector.resolveConstructorParams (/usr/src/app/node_modules/@nestjs/core/injector/injector.js:144:24) at async Injector.loadInstance (/usr/src/app/node_modules/@nestjs/core/injector/injector.js:70:13) at async Injector.loadProvider (/usr/src/app/node_modules/@nestjs/core/injector/injector.js:97:9) at async /usr/src/app/node_modules/@nestjs/core/injector/instance-loader.js:56:13 at async Promise.all (index 25) ``` ### The OS that Immich Server is running on doesn't matter ### Version of Immich Server 1.91.2 ### Version of Immich Mobile App doesn't matter ### Platform with the issue - [X] Server - [ ] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML doesn't matter ``` ### Your .env content ```Shell doesn't matter ``` ### Reproduction steps ```bash 1. Mount a configuration file with keys that are not supported. ``` ### Additional information Unsupported configuration keys could be ignored by the system. If the JSON file is invalid for formatting reasons, this should be reported as an error.
Author
Owner

@agross commented on GitHub (Dec 17, 2023):

FYI, this was the breaking change:

diff --git a/roles/immich/templates/immich-config.json.j2 b/roles/immich/templates/immich-config.json.j2
index b16121c..84940db 100644
--- a/roles/immich/templates/immich-config.json.j2
+++ b/roles/immich/templates/immich-config.json.j2
@@ -22,7 +22,7 @@
     "backgroundTask": {
       "concurrency": 5
     },
-    "clipEncoding": {
+    "smartSearch": {
       "concurrency": 2
     },
     "library": {
@agross commented on GitHub (Dec 17, 2023): FYI, this was the breaking change: ```diff diff --git a/roles/immich/templates/immich-config.json.j2 b/roles/immich/templates/immich-config.json.j2 index b16121c..84940db 100644 --- a/roles/immich/templates/immich-config.json.j2 +++ b/roles/immich/templates/immich-config.json.j2 @@ -22,7 +22,7 @@ "backgroundTask": { "concurrency": 5 }, - "clipEncoding": { + "smartSearch": { "concurrency": 2 }, "library": { ```
Author
Owner

@boopzz commented on GitHub (Dec 22, 2023):

I had the same error and the fix was the same, thanks for posting 👍

I went from 1.89.0 straight to 1.91.4

@boopzz commented on GitHub (Dec 22, 2023): I had the same error and the fix was the same, thanks for posting 👍 I went from `1.89.0` straight to `1.91.4`
Author
Owner

@LoveU3th commented on GitHub (Jan 4, 2024):

Hello, I also encountered this problem, So how to fix it, wait for the fix?

@LoveU3th commented on GitHub (Jan 4, 2024): Hello, I also encountered this problem, So how to fix it, wait for the fix?
Author
Owner

@jrasm91 commented on GitHub (Jan 13, 2024):

The server now logs a warning when unknown values and continues.

@jrasm91 commented on GitHub (Jan 13, 2024): The server now logs a warning when unknown values and continues.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#1810