{"record":{"id":"ae86a806ad36fcdb","repo":"immich-app/immich","slug":"failed-to-read-resourcepaths-lockfile","errorCode":null,"errorMessage":"Failed to read ${resourcePaths.lockFile}","messagePattern":"Failed to read (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"server/src/repositories/server-info.repository.ts","lineNumber":105,"sourceCode":"    command: string,\n    commandTransform?: (output: string) => string,\n    version?: string,\n  ): Promise<string> {\n    if (!version) {\n      const output = await maybeFirstLine(command);\n      version = commandTransform ? commandTransform(output) : output;\n    }\n    return version;\n  }\n\n  async getBuildVersions(): Promise<ServerBuildVersions> {\n    if (!this.buildVersions) {\n      const { nodeVersion, resourcePaths } = this.configRepository.getEnv();\n\n      const lockfile: BuildLockfile | undefined = await readFile(resourcePaths.lockFile)\n        .then((buffer) => JSON.parse(buffer.toString()))\n\n        .catch(() => this.logger.warn(`Failed to read ${resourcePaths.lockFile}`));\n\n      const [nodejsVersion, ffmpegVersion, magickVersion, exiftoolVersion] = await Promise.all([\n        this.retrieveVersionFallback('node --version', undefined, nodeVersion),\n        this.retrieveVersionFallback(\n          'ffmpeg -version',\n          (output) => output.replaceAll('ffmpeg version ', ''),\n          getLockfileVersion('ffmpeg', lockfile),\n        ),\n        this.retrieveVersionFallback(\n          'magick --version',\n          (output) => output.replaceAll('Version: ImageMagick ', ''),\n          getLockfileVersion('imagemagick', lockfile),\n        ),\n        exiftool.version(),\n      ]);\n\n      // eslint-disable-next-line import-x/no-named-as-default-member\n      const libvipsVersion = getLockfileVersion('libvips', lockfile) || sharp.versions.vips;","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/immich-app/immich/blob/e55ac299a4ec7cb372e35dbf2c6c05ee9ce77f6c/server/src/repositories/server-info.repository.ts#L87-L123","documentation":"getBuildVersions reads a build lockfile (JSON) to report bundled tool versions (node, ffmpeg, imagemagick, exiftool). If the lockfile cannot be read or parsed, the read promise rejects and this warning is logged; version fields fall back to runtime commands or undefined. It is non-fatal — build/version metadata is simply incomplete.","triggerScenarios":"readFile(resourcePaths.lockFile) rejects (file missing/unreadable) or JSON.parse throws, inside getBuildVersions when this.buildVersions is not yet cached.","commonSituations":"Running from source without the packaged build-lockfile; Docker image built without the lock file; custom deployment layout where resourcePaths differ; permission problem on the resources directory.","solutions":["Verify the lockfile exists at the path shown in the warning (check resourcePaths / storage layout).","If running from source, this is expected — rely on the fallback version retrieval commands.","Reinstall/re-pull the official Docker image so the lockfile ships with the deployment.","Fix filesystem permissions on the resources directory if the file exists but is unreadable."],"exampleFix":"// before\n.catch(() => this.logger.warn(`Failed to read ${resourcePaths.lockFile}`));\n// after\n.catch((error: unknown) => {\n  this.logger.warn(`Failed to read ${resourcePaths.lockFile}: ${error}`);\n  return undefined;\n});","handlingStrategy":"fallback","validationCode":"import { existsSync } from 'node:fs';\nconst hasLockfile = existsSync(resourcePaths.lockFile);","typeGuard":"const isBuildLockfile = (v: unknown): v is BuildLockfile =>\n  typeof v === 'object' && v !== null && 'ffmpegVersion' in v;","tryCatchPattern":"let lockfile: BuildLockfile | undefined;\ntry {\n  lockfile = JSON.parse(await readFile(path, 'utf8'));\n} catch (e) {\n  logger.warn(`No build lockfile at ${path}; using runtime version fallback`, e);\n  lockfile = undefined;\n}","preventionTips":["Verify lockfile presence in deployment/CI before shipping images.","Check file permissions on the resources directory after container upgrades.","Remember source runs legitimately lack the lockfile — treat warning as benign."],"tags":["filesystem","json","versioning"],"backgroundTag":"file-read-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"}