badges/shields · error · NotFound

profile not found

Error message

profile not found

What it means

The Keybase profile service throws NotFound with 'profile not found' when the API reports success (status.code === 0) but the `them` array is empty or its first element is falsy. Keybase accepted the query yet returned no profile payload, so the service cannot build the badge. This is a distinct, subtler case from the non-zero status code path.

Source

Thrown at services/keybase/keybase-profile.js:28

  async fetch({ schema, options }) {
    const apiVersion = this.constructor.apiVersion
    // See https://keybase.io/docs/api/1.0/call/user/lookup.
    const url = `https://keybase.io/_/api/${apiVersion}/user/lookup.json`

    return this._requestJson({
      url,
      schema,
      options,
    })
  }

  transform({ data }) {
    if (data.status.code !== 0) {
      throw new NotFound({ prettyMessage: 'invalid username' })
    }

    if (data.them.length === 0 || !data.them[0]) {
      throw new NotFound({ prettyMessage: 'profile not found' })
    }

    return { user: data.them[0] }
  }
}

View on GitHub (pinned to 766fd8bc89)

Solutions

  1. Retry the badge later — the API may return the profile once consistent.
  2. Verify the account still exists and has a public profile on keybase.io.
  3. If the account is gone, remove or replace the badge.
Defensive patterns

Strategy: retry

Validate before calling

const res = await fetch(`https://keybase.io/_/api/1.0/user/lookup.json?username=${encodeURIComponent(username)}`);
const data = await res.json();
if (data.status.code === 0 && (!Array.isArray(data.them) || !data.them[0])) {
  console.warn(`Keybase returned no profile for ${username}; retry later`);
}

Type guard

function hasKeybaseProfile(data) {
  return Array.isArray(data?.them) && Boolean(data.them[0]);
}

Try / catch

try {
  profile = await getKeybaseProfileBadge(username);
} catch (e) {
  if (e.name === 'NotFound') {
    profile = await retryWithBackoff(() => getKeybaseProfileBadge(username), 2)
      .catch(() => renderFallback('profile unavailable'));
  } else throw e;
}

Prevention

When it happens

Trigger: Querying /keybase/profile/<username> where data.status.code is 0 but data.them is [] or them[0] is null/undefined — an acknowledged request with no user object attached.

Common situations: Recently deleted or deactivated Keybase account still passing a status check; transient Keybase API inconsistency; usernames that resolve only partially (e.g. placeholder accounts without public profiles).

Related errors


AI-assisted analysis of badges/shields@766fd8bc89 (2026-08-30). Data as JSON: /api/errors/88a26a9e4d732eae. Report an issue: GitHub.