{"record":{"id":"d2247ebadd19ee62","repo":"paperclipai/paperclip","slug":"paperclip-adapters-file-could-not-be-read-at-fi","errorCode":null,"errorMessage":"PAPERCLIP_ADAPTERS_FILE could not be read at \"${filePath}\": ${(err as Error).message}","messagePattern":"PAPERCLIP_ADAPTERS_FILE could not be read at \"(.+?)\": (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/src/services/adapter-registry-bootstrap.ts","lineNumber":41,"sourceCode":"/**\n * Parse the declarative registry from env. Returns null when unconfigured\n * (built-in defaults; local/OSS unchanged). Throws on malformed/invalid input.\n */\nexport function parseAdapterRegistryEnv(\n  env: AdapterRegistryEnv = process.env,\n): AdapterRegistryEntryParsed[] | null {\n  const inline = env.PAPERCLIP_ADAPTERS?.trim();\n  const filePath = env.PAPERCLIP_ADAPTERS_FILE?.trim();\n  if (!inline && !filePath) return null;\n\n  let rawText: string;\n  if (inline) {\n    rawText = inline;\n  } else {\n    try {\n      rawText = fs.readFileSync(filePath as string, \"utf-8\");\n    } catch (err) {\n      throw new Error(\n        `PAPERCLIP_ADAPTERS_FILE could not be read at \"${filePath}\": ${(err as Error).message}`,\n      );\n    }\n  }\n\n  let parsed: unknown;\n  try {\n    parsed = JSON.parse(rawText);\n  } catch (err) {\n    throw new Error(`PAPERCLIP_ADAPTERS must be valid JSON: ${(err as Error).message}`);\n  }\n\n  const result = adapterRegistrySchema.safeParse(parsed);\n  if (!result.success) {\n    throw new Error(\n      `PAPERCLIP_ADAPTERS failed validation: ${result.error.issues\n        .map((i) => `${i.path.join(\".\")}: ${i.message}`)\n        .join(\"; \")}`,","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/server/src/services/adapter-registry-bootstrap.ts#L23-L59","documentation":"Env-bootstrap failure in parseAdapterRegistryEnv: PAPERCLIP_ADAPTERS_FILE points at a file path, but fs.readFileSync failed (missing file, permissions, etc.). Startup aborts with the underlying OS error message so the operator can fix the path or file mode.","triggerScenarios":"Thrown at server/src/services/adapter-registry-bootstrap.ts:41 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that the file at PAPERCLIP_ADAPTERS_FILE exists and is readable; fix the reported read error."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}