hcengineering/platform · error

Global person not found for social-id ${socialId}

Error message

Global person not found for social-id ${socialId}

What it means

getClient in pod-events-processor builds an account client for the notification author. When a socialId is given (and is not System), it calls findPersonBySocialId on the account service; undefined means no global person exists for that social identity, so it throws 'Global person not found for social-id <id>'. This reports exactly which social id failed, unlike the mail variant of the same check.

Source

Thrown at services/notification/pod-events-processor/src/client.ts:55

  socialId?: PersonId,
  serviceTag: string = config.ServiceId
): Promise<ClientBundle> {
  const cached = getCachedClient(workspaceUuid, socialId, serviceTag)
  if (cached !== undefined) return cached

  const cacheKey = getCacheKey(workspaceUuid, socialId, serviceTag)
  const inFlight = getInFlightClientCreation(cacheKey)
  if (inFlight !== undefined) return await inFlight

  const creation = (async () => {
    const token = generateToken(systemAccountUuid, workspaceUuid, { service: serviceTag })
    let accountClient = getAccountClient(config.AccountsUrl, token)

    // If we want the notification author to be a specific user, we can obtain a workspace token for that person.
    if (socialId !== undefined && socialId !== core.account.System) {
      const personUuid = await accountClient.findPersonBySocialId(socialId, true)
      if (personUuid === undefined) {
        throw new Error(`Global person not found for social-id ${socialId}`)
      }
      const token = generateToken(personUuid, workspaceUuid, { service: serviceTag })
      accountClient = getAccountClient(config.AccountsUrl, token)
    }

    const wsInfo = await accountClient.getLoginInfoByToken()
    if (wsInfo == null || !('endpoint' in wsInfo)) {
      throw new Error('Invalid login info')
    }
    const transactorUrl = wsInfo.endpoint.replace('ws://', 'http://').replace('wss://', 'https://')
    const client = await createRestTxOperations(transactorUrl, wsInfo.workspace, wsInfo.token)
    const bundle = { client, accountClient }
    setCachedClient(workspaceUuid, socialId, serviceTag, bundle)
    return bundle
  })()

  setInFlightClientCreation(cacheKey, creation)
  try {

View on GitHub (pinned to 63e28dc964)

Solutions

  1. Log and verify the failing socialId against the account service (findPersonBySocialId) to see if it exists at all
  2. Correct the socialId format/platform prefix at the producing service
  3. Re-register the author account or skip the notification for deleted users
  4. Fall back to the System account when the author cannot be resolved

Example fix

// before
const client = await getClient(ctx, socialId, workspaceUuid)
// after
const client = await getClient(ctx, socialId, workspaceUuid).catch(() => getClient(ctx, core.account.System, workspaceUuid))
Defensive patterns

Strategy: try-catch

Validate before calling

const uuid = await accountClient.findPersonBySocialId(socialId, true)
if (uuid === undefined) {
  console.warn(`socialId ${socialId} unresolvable; will use system account`)
}

Type guard

async function isKnownSocialId(accountClient: AccountClient, socialId: string): Promise<boolean> {
  return (await accountClient.findPersonBySocialId(socialId, true)) !== undefined
}

Try / catch

try {
  client = await getClient(ctx, socialId, workspaceUuid)
} catch (e) {
  if (e.message.startsWith('Global person not found for social-id')) {
    client = await getClient(ctx, core.account.System, workspaceUuid)
  } else throw e
}

Prevention

When it happens

Trigger: An event/notification carries an author socialId that the account service cannot resolve: unregistered sender, deleted account, or malformed socialId (wrong platform/prefix) passed into getClient via bundle.

Common situations: Processing queued events created before the author's account was deleted; social id format drift between services; cross-region account replication lag; upstream service passing its own user id instead of a platform social id.

Related errors


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