Kong/insomnia · error

Can't get private key: session is missing keys.

Error message

Can't get private key: session is missing keys.

What it means

Error "Can't get private key: session is missing keys." thrown in Kong/insomnia.

Source

Thrown at packages/insomnia/src/common/account/session.ts:27

  email: string;
  firstName: string;
  lastName: string;
  symmetricKey: JsonWebKey;
  publicKey: JsonWebKey;
  encPrivateKey: AESMessage;
}

export async function getPrivateKey() {
  const sessionData = await getUserSession();

  if (!sessionData) {
    throw new Error("Can't get private key: session is blank.");
  }

  const { symmetricKey, encPrivateKey } = sessionData;

  if (!symmetricKey || !encPrivateKey) {
    throw new Error("Can't get private key: session is missing keys.");
  }

  const privateKeyStr = await getRuntime().crypto.decryptAES(symmetricKey, encPrivateKey);
  return JSON.parse(privateKeyStr) as JsonWebKey;
}

export async function getCurrentSessionId() {
  const { id } = await services.userSession.get();
  return id;
}

export async function getAccountId() {
  return (await getUserSession())?.accountId;
}

/** Check if we (think) we have a session */
export async function isLoggedIn() {
  return Boolean(await getCurrentSessionId());

View on GitHub (pinned to d9bb2b0142)

When it happens

Trigger: Thrown at packages/insomnia/src/common/account/session.ts:27 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Kong/insomnia@d9bb2b0142 (2026-08-26). Data as JSON: /api/errors/4622c1cd2d3884ca. Report an issue: GitHub.