{"record":{"id":"2967eb018b39ceda","repo":"paperclipai/paperclip","slug":"paperclip-adapters-must-be-valid-json-err-as-e","errorCode":null,"errorMessage":"PAPERCLIP_ADAPTERS must be valid JSON: ${(err as Error).message}","messagePattern":"PAPERCLIP_ADAPTERS must be valid JSON: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/src/services/adapter-registry-bootstrap.ts","lineNumber":51,"sourceCode":"\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(\"; \")}`,\n    );\n  }\n  return result.data;\n}\n\n/**\n * Reconcile availability: every known server adapter NOT enabled in the declared\n * registry is disabled; declared+enabled ones are enabled. Throws if a declared\n * adapterType has no installed adapter (cannot offer a harness with no\n * implementation). No-op when `registry` is null.","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/server/src/services/adapter-registry-bootstrap.ts#L33-L69","documentation":"Env-bootstrap failure in parseAdapterRegistryEnv: the raw text from PAPERCLIP_ADAPTERS (or the file) is not valid JSON. JSON.parse's message is embedded so the operator can find the syntax error before the registry schema is even applied.","triggerScenarios":"Thrown at server/src/services/adapter-registry-bootstrap.ts:51 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix PAPERCLIP_ADAPTERS to contain valid JSON."],"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-14T05:17:10.506Z"}