paperclipai/paperclip · error · Error

CLI auth challenge was cancelled.

Error message

CLI auth challenge was cancelled.

What it means

Thrown by loginBoardCli() when the polled challenge status is `cancelled`. The CLI created a cli-auth challenge, printed/approval-opened the URL, and while polling /api/cli-auth/{id}/status the server reported status === "cancelled" — meaning a board operator explicitly rejected the CLI login request, or it was cancelled server-side. This is an intentional terminal state, not a bug.

Source

Thrown at cli/src/client/board-auth.ts:278

            authorization: `Bearer ${challenge.boardApiToken}`,
          },
        },
      );
      setStoredBoardCredential({
        apiBase,
        token: challenge.boardApiToken,
        userId: me.userId ?? me.user?.id ?? null,
        storePath: params.storePath,
      });
      return {
        token: challenge.boardApiToken,
        approvalUrl,
        userId: me.userId ?? me.user?.id ?? null,
      };
    }

    if (status.status === "cancelled") {
      throw new Error("CLI auth challenge was cancelled.");
    }
    if (status.status === "expired") {
      throw new Error("CLI auth challenge expired before approval.");
    }

    await sleep(pollMs);
  }

  throw new Error("CLI auth challenge expired before approval.");
}

export async function revokeStoredBoardCredential(params: {
  apiBase: string;
  token: string;
}): Promise<void> {
  const apiBase = normalizeApiBase(params.apiBase);
  await requestJson<{ revoked: boolean }>(`${apiBase}/api/cli-auth/revoke-current`, {
    method: "POST",

View on GitHub (pinned to 67001ec6eb)

Solutions

  1. Re-run `paperclipai login` to start a fresh challenge and approve it this time.
  2. Confirm the approving board user actually has the permissions to approve CLI access for the requested company/instance.
  3. If cancellations are unexpected, check server logs for who issued the cancel on the challenge id.
Defensive patterns

Strategy: try-catch

Try / catch

try {
  await loginBoardCli(params);
} catch (err) {
  if (err instanceof Error && err.message === 'CLI auth challenge was cancelled.') {
    console.error('Login denied in the board UI. Re-run and approve to continue.');
    return;
  }
  throw err;
}

Prevention

When it happens

Trigger: A board user clicked "Cancel" / "Deny" on the approval page while the CLI was polling. Also possible if another session or an admin force-cancels the challenge by id. Distinguished from expiry ([2]/[3]) by the explicit cancelled status.

Common situations: User started `paperclipai login`, changed their mind, and denied it in the board UI. Multiple CLI sessions racing on the same approval page. A board admin revoking a pending login.

Related errors


AI-assisted analysis of paperclipai/paperclip@67001ec6eb (2026-08-12). Data as JSON: /api/errors/045fb9c23f7e5f9c. Report an issue: GitHub.