{"record":{"id":"5b6fe78b0adba08c","repo":"immich-app/immich","slug":"invalid-system-config-path-issue-message","errorCode":null,"errorMessage":"Invalid system config: \n  - [${path}] ${issue.message}","messagePattern":"Invalid system config: \n  - \\[(.+?)\\] (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"server/src/utils/config.ts","lineNumber":110,"sourceCode":"  const unknownKeys = cloneDeep(rawConfig);\n  for (const property of getKeysDeep(defaults)) {\n    unsetDeep(unknownKeys, property);\n  }\n\n  if (!isEmpty(unknownKeys)) {\n    logger.warn(`Unknown keys found: ${JSON.stringify(unknownKeys, null, 2)}`);\n  }\n\n  // validate with Zod schema\n  const result = AdminConfigDto.schema.safeParse(rawConfig);\n  if (!result.success) {\n    const messages = ['Invalid system config: '];\n    for (const issue of result.error.issues) {\n      const path = issue.path.join('.');\n      messages.push(`  - [${path}] ${issue.message}`);\n    }\n    if (configFile) {\n      throw new Error(messages.join('\\n'));\n    }\n    logger.error('Validation error', messages);\n  }\n\n  const config = (result.success ? result.data : rawConfig) as SystemConfig;\n\n  if (config.server.externalDomain.length > 0) {\n    const domain = new URL(config.server.externalDomain);\n\n    const externalDomain =\n      domain.password && domain.username\n        ? `${domain.protocol}//${domain.username}:${domain.password}@${domain.host}`\n        : domain.origin;\n\n    config.server.externalDomain = externalDomain;\n  }\n\n  if (!config.ffmpeg.acceptedVideoCodecs.includes(config.ffmpeg.targetVideoCodec)) {","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/immich-app/immich/blob/e55ac299a4ec7cb372e35dbf2c6c05ee9ce77f6c/server/src/utils/config.ts#L92-L128","documentation":"buildConfig validates the raw system config against a Zod schema. If validation fails and a config file was the source, it throws with the list of zod issues (path + message). This is Immich's fail-fast guard against a corrupted or hand-edited immich config file.","triggerScenarios":"Editing immich-config.json (or env-provided config) with unknown keys, wrong types, out-of-range values, or malformed JSON structure that fails the SystemConfig zod schema.","commonSituations":"Hand-editing the config after a version upgrade removed/renamed options; pasting config from an older Immich version; typos in enum values like transcode policies or ffmpeg settings.","solutions":["Fix each listed [path] issue in the config file per the message","Revert to a known-good config file or regenerate defaults from the admin UI (Administration > Settings)","Compare your config against the current version's SystemConfig schema for renamed/removed keys","Set the config via the web UI instead of manual file edits to guarantee schema validity"],"exampleFix":"// before (config file)\n{ \"ffmpeg\": { \"crf\": \"23\", \"transcode\": \"auto\" } }\n// after\n{ \"ffmpeg\": { \"crf\": 23, \"transcode\": \"auto\" } }","handlingStrategy":"validation","validationCode":"import { z } from 'zod';\nconst parsed = SystemConfigSchema.safeParse(rawConfig);\nif (!parsed.success) {\n  for (const issue of parsed.error.issues) console.error(`[${issue.path.join('.')}] ${issue.message}`);\n  throw new Error('Fix immich config before starting');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await startServer();\n} catch (e) {\n  if (/Invalid system config/.test(e.message)) {\n    // log e.message fully: it enumerates each bad [path] and reason\n    // restore defaults or fix listed keys, then restart\n  }\n}","preventionTips":["Edit config via the admin UI instead of hand-editing the file","After upgrading Immich, diff your config against the new schema","Keep a backup of the last known-good immich-config.json"],"tags":["config","validation","zod"],"backgroundTag":"schema-validation-failed","analyzedSha":"e55ac299a4ec7cb372e35dbf2c6c05ee9ce77f6c","analyzedAt":"2026-09-15T07:20:19.675Z","contentChangedAt":"2026-09-15T07:20:19.675Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}