paperclipai/paperclip · error · Error

Decision signing secrets directory at ${directoryPath} must

Error message

Decision signing secrets directory at ${directoryPath} must be a directory

What it means

Filetype guard in enforceSecretsDirectoryPermissions: lstat shows the secrets directory path is not actually a directory. The directory that must hold the decision-signing key (and other secrets) cannot enforce its protection model on a non-directory.

Source

Thrown at server/src/services/decision-signing.ts:47

  const mode = stats.mode & 0o777;
  if ((mode & 0o077) !== 0) {
    chmodSync(keyPath, 0o600);
    stats = lstatSync(keyPath);
    if (!stats.isFile()) {
      throw new Error(`Decision signing key at ${keyPath} must be a regular file`);
    }
    assertOwnedByCurrentUser(stats, `Decision signing key at ${keyPath}`);
    if ((stats.mode & 0o077) !== 0) {
      throw new Error(`Decision signing key at ${keyPath} must have permissions 0600`);
    }
  }
}

function enforceSecretsDirectoryPermissions(directoryPath: string) {
  let stats = lstatSync(directoryPath);
  if (!stats.isDirectory()) {
    throw new Error(`Decision signing secrets directory at ${directoryPath} must be a directory`);
  }
  assertOwnedByCurrentUser(stats, `Decision signing secrets directory at ${directoryPath}`);
  if (process.platform === "win32") return;

  const mode = stats.mode & 0o777;
  if ((mode & 0o077) !== 0) {
    chmodSync(directoryPath, 0o700);
    stats = lstatSync(directoryPath);
    if (!stats.isDirectory()) {
      throw new Error(`Decision signing secrets directory at ${directoryPath} must be a directory`);
    }
    assertOwnedByCurrentUser(stats, `Decision signing secrets directory at ${directoryPath}`);
    if ((stats.mode & 0o077) !== 0) {
      throw new Error(`Decision signing secrets directory at ${directoryPath} must have permissions 0700`);
    }
  }
}

View on GitHub (pinned to 120ae5428f)

Solutions

  1. Ensure the decision signing secrets path is a directory; create it or fix the path.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at server/src/services/decision-signing.ts:47 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of paperclipai/paperclip@120ae5428f (2026-08-18). Data as JSON: /api/errors/affbc411731f7f35. Report an issue: GitHub.