hcengineering/platform · error · PlatformError

platform.status.PersonNotFound

platform.status.PersonNotFound

Error message

PersonNotFound

What it means

After successfully confirming the email (confirmEmail returns a socialId), the handler re-fetches the person record for the account uuid. If it is null the server throws PersonNotFound, meaning the confirmation succeeded but the user profile document is gone or never created.

Source

Thrown at server/account/src/operations.ts:1390

  db: AccountDB,
  branding: Branding | null,
  token: string
): Promise<LoginInfo | WorkspaceLoginInfo> {
  const { account, extra } = decodeTokenVerbose(ctx, token)

  const email = extra?.confirmEmail
  if (email === undefined) {
    ctx.error('Email not provided for confirmation', { account, extra })
    throw new PlatformError(new Status(Severity.ERROR, platform.status.Forbidden, {}))
  }

  const socialId = await confirmEmail(ctx, db, account, email)

  await confirmHulyIds(ctx, db, account)

  const person = await db.person.findOne({ uuid: account })
  if (person == null) {
    throw new PlatformError(new Status(Severity.ERROR, platform.status.PersonNotFound, { person: account }))
  }

  const result: LoginInfo = {
    account,
    name: getPersonName(person),
    socialId,
    token: generateToken(account)
  }

  // If invite info was carried through the confirmation token (signUpJoin flow),
  // finish the workspace join now that the email is verified.
  const inviteId = typeof extra?.inviteId === 'string' ? extra.inviteId : ''
  const workspaceUrl = typeof extra?.workspaceUrl === 'string' ? extra.workspaceUrl : ''
  if (inviteId !== '' || workspaceUrl !== '') {
    try {
      const joinInfo = await getWorkspaceJoinInfo(ctx, db, email, inviteId, workspaceUrl)
      const joinResult = await doJoinByInvite(
        ctx,

View on GitHub (pinned to 63e28dc964)

Solutions

  1. Verify db.person contains a document with uuid equal to the account; recreate it if it was deleted.
  2. Request a new confirmation email and retry with a fresh link if the old person was removed.
  3. Check for cleanup/retention jobs or migrations that delete person records without deleting accounts.
  4. If account is orphaned, remove the account and social ids and have the user sign up again.
Defensive patterns

Strategy: try-catch

Try / catch

try { await confirmEmailAccount(ctx, token) } catch (err) { if (isStatusError(err, platform.status.PersonNotFound)) show('This account no longer exists; please sign up again'); else throw err }

Prevention

When it happens

Trigger: Confirming email for an account whose person record was deleted (or never created) between sending the confirmation link and clicking it — e.g. admin removed the person, DB migration, or account was purged by a cleanup job.

Common situations: Stale confirmation link clicked after the workspace/person was removed; eventual-consistency lag in distributed storage; manual DB cleanup deleted persons but left accounts/social ids.

Understand the failure class

Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.

Related errors


AI-assisted analysis of hcengineering/platform@63e28dc964 (2026-08-29). Data as JSON: /api/errors/667d9749a6abe913. Report an issue: GitHub.