{"record":{"id":"90778c9ce6b5b7d5","repo":"hcengineering/platform","slug":"personnotfound","errorCode":"PersonNotFound","errorMessage":"PersonNotFound","messagePattern":"PersonNotFound","errorType":"exception","errorClass":"PlatformError","httpStatus":null,"severity":"error","filePath":"server/account/src/serviceOperations.ts","lineNumber":597,"sourceCode":"export async function getPersonInfo (\n  ctx: MeasureContext,\n  db: AccountDB,\n  branding: Branding | null,\n  token: string,\n  params: { account: PersonUuid }\n): Promise<PersonInfo> {\n  const { account } = params\n  const { extra } = decodeTokenVerbose(ctx, token)\n  verifyAllowedServices(['workspace', 'tool', 'gmail', 'huly-mail', 'export'], extra)\n\n  if (account == null || account === '') {\n    throw new PlatformError(new Status(Severity.ERROR, platform.status.BadRequest, {}))\n  }\n\n  const person = await db.person.findOne({ uuid: account })\n\n  if (person == null) {\n    throw new PlatformError(new Status(Severity.ERROR, platform.status.PersonNotFound, { person: account }))\n  }\n\n  const verifiedSocialIds = await db.socialId.find({ personUuid: account, verifiedOn: { $gt: 0 } })\n\n  return {\n    personUuid: account,\n    name: getPersonName(person),\n    socialIds: verifiedSocialIds\n  }\n}\n\nexport async function addSocialIdToPerson (\n  ctx: MeasureContext,\n  db: AccountDB,\n  branding: Branding | null,\n  token: string,\n  params: { person: PersonUuid, type: SocialIdType, value: string, confirmed: boolean, displayValue?: string }\n): Promise<PersonId> {","sourceCodeStart":579,"sourceCodeEnd":615,"githubUrl":"https://github.com/hcengineering/platform/blob/63e28dc96483967b2fc21c881b3f1023c1de7718/server/account/src/serviceOperations.ts#L579-L615","documentation":"getPersonInfo queries db.person for a document with uuid === account; when no person document matches it throws PersonNotFound with the requested uuid in the status data. The account parameter was well-formed but no such person exists (or existed) in the database.","triggerScenarios":"Looking up a person UUID that was deleted, belongs to another deployment/instance, or was synthesized locally (e.g. a placeholder UUID) rather than obtained from the account service.","commonSituations":"Member lists caching UUIDs of users who later deleted their accounts; cross-environment UUID reuse (staging data in prod client); integrations storing person references without handling account deletion.","solutions":["Confirm the UUID exists via the account service or a direct person collection query.","Purge or resolve stale references: when you get PersonNotFound, remove the dangling member entry from your local cache/list.","Verify you are querying the same environment/instance the UUID belongs to.","If the person should exist, investigate whether account deletion or a migration removed them unexpectedly."],"exampleFix":"// before\nconst info = await getPersonInfo(ctx, token, { account: cachedUuid })\nrenderProfile(info)\n// after\ntry {\n  renderProfile(await getPersonInfo(ctx, token, { account: cachedUuid }))\n} catch (err) {\n  if (isPlatformError(err, platform.status.PersonNotFound)) removeStaleMember(cachedUuid)\n  else throw err\n}","handlingStrategy":"try-catch","validationCode":"const exists = await db.person.findOne({ uuid: account })\nif (exists == null) throw new Error(`Person ${account} does not exist`)","typeGuard":"function personExists(p: { uuid: string } | null): p is { uuid: string } {\n  return p != null && typeof p.uuid === 'string'\n}","tryCatchPattern":"try {\n  info = await client.getPersonInfo(ctx, token, { account })\n} catch (err) {\n  if (isPlatformError(err, platform.status.PersonNotFound)) {\n    info = null // purge stale reference from cache/list\n  } else throw err\n}","preventionTips":["Remove cached person references when you receive PersonNotFound","Handle account-deletion events to clean up member lists","Never fabricate person UUIDs client-side","Verify UUIDs come from the same environment"],"tags":["person","not-found","account"],"backgroundTag":"resource-not-found","analyzedSha":"63e28dc96483967b2fc21c881b3f1023c1de7718","analyzedAt":"2026-08-29T15:21:27.377Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}