{"record":{"id":"2beb6b1a8f548bab","repo":"paperclipai/paperclip","slug":"failed-to-parse-config-at-configpath-err-ins","errorCode":null,"errorMessage":"Failed to parse config at ${configPath}: ${err instanceof Error ? err.message : String(err)}","messagePattern":"Failed to parse config at (.+?): (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/db/src/runtime-config.ts","lineNumber":149,"sourceCode":"\n  config.database = database;\n  return config as PartialConfig;\n}\n\nfunction asPositiveInt(value: unknown): number | null {\n  if (typeof value !== \"number\" || !Number.isFinite(value)) return null;\n  const rounded = Math.trunc(value);\n  return rounded > 0 ? rounded : null;\n}\n\nfunction readConfig(configPath: string): PartialConfig | null {\n  if (!existsSync(configPath)) return null;\n\n  let parsed: unknown;\n  try {\n    parsed = JSON.parse(readFileSync(configPath, \"utf8\"));\n  } catch (err) {\n    throw new Error(\n      `Failed to parse config at ${configPath}: ${err instanceof Error ? err.message : String(err)}`,\n    );\n  }\n\n  const migrated = migrateLegacyConfig(parsed);\n  if (migrated === null || typeof migrated !== \"object\" || Array.isArray(migrated)) {\n    throw new Error(`Invalid config at ${configPath}: expected a JSON object`);\n  }\n\n  const database =\n    typeof migrated.database === \"object\" &&\n    migrated.database !== null &&\n    !Array.isArray(migrated.database)\n      ? migrated.database\n      : undefined;\n\n  return {\n    database: database","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/packages/db/src/runtime-config.ts#L131-L167","documentation":"Error \"Failed to parse config at ${configPath}: ${err instanceof Error ? err.message : String(err)}\" thrown in paperclipai/paperclip.","triggerScenarios":"Thrown at packages/db/src/runtime-config.ts:149 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the JSON syntax error in the config file at the reported path.","Delete the config file to regenerate defaults if it is corrupted."],"exampleFix":null,"handlingStrategy":null,"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"}