{"record":{"id":"174c22c7563fc0a2","repo":"paperclipai/paperclip","slug":"invalid-decision-signing-key-at-keypath-must-b","errorCode":null,"errorMessage":"Invalid decision signing key at ${keyPath} (must be at least ${MIN_SECRET_LENGTH} characters); remove the file to regenerate it or set PAPERCLIP_DECISION_SIGNING_SECRET","messagePattern":"Invalid decision signing key at (.+?) \\(must be at least (.+?) characters\\); remove the file to regenerate it or set PAPERCLIP_DECISION_SIGNING_SECRET","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/src/services/decision-signing.ts","lineNumber":70,"sourceCode":"  const mode = stats.mode & 0o777;\n  if ((mode & 0o077) !== 0) {\n    chmodSync(directoryPath, 0o700);\n    stats = lstatSync(directoryPath);\n    if (!stats.isDirectory()) {\n      throw new Error(`Decision signing secrets directory at ${directoryPath} must be a directory`);\n    }\n    assertOwnedByCurrentUser(stats, `Decision signing secrets directory at ${directoryPath}`);\n    if ((stats.mode & 0o077) !== 0) {\n      throw new Error(`Decision signing secrets directory at ${directoryPath} must have permissions 0700`);\n    }\n  }\n}\n\nfunction readGeneratedSecret(keyPath: string): string {\n  enforceKeyFilePermissions(keyPath);\n  const existing = readFileSync(keyPath, \"utf8\").trim();\n  if (existing.length < MIN_SECRET_LENGTH) {\n    throw new Error(\n      `Invalid decision signing key at ${keyPath} (must be at least ${MIN_SECRET_LENGTH} characters); remove the file to regenerate it or set PAPERCLIP_DECISION_SIGNING_SECRET`,\n    );\n  }\n  return existing;\n}\n\nfunction isAlreadyExists(error: unknown) {\n  return (error as NodeJS.ErrnoException).code === \"EEXIST\";\n}\n\nfunction isNotFound(error: unknown) {\n  return (error as NodeJS.ErrnoException).code === \"ENOENT\";\n}\n\nfunction loadOrCreateGeneratedSecret(): string {\n  const keyPath = resolveGeneratedSecretFilePath();\n  const secretsDirectoryPath = path.dirname(keyPath);\n  try {","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/server/src/services/decision-signing.ts#L52-L88","documentation":"Error \"Invalid decision signing key at ${keyPath} (must be at least ${MIN_SECRET_LENGTH} characters); remove the file to regenerate it or set PAPERCLIP_DECISION_SIGNING_SECRET\" thrown in paperclipai/paperclip.","triggerScenarios":"Thrown at server/src/services/decision-signing.ts:70 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the invalid key file so a new one is regenerated, or set PAPERCLIP_DECISION_SIGNING_SECRET to a value of at least the minimum length."],"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"}