{"record":{"id":"88a26a9e4d732eae","repo":"badges/shields","slug":"profile-not-found","errorCode":null,"errorMessage":"profile not found","messagePattern":"profile not found","errorType":"exception","errorClass":"NotFound","httpStatus":404,"severity":"error","filePath":"services/keybase/keybase-profile.js","lineNumber":28,"sourceCode":"  async fetch({ schema, options }) {\n    const apiVersion = this.constructor.apiVersion\n    // See https://keybase.io/docs/api/1.0/call/user/lookup.\n    const url = `https://keybase.io/_/api/${apiVersion}/user/lookup.json`\n\n    return this._requestJson({\n      url,\n      schema,\n      options,\n    })\n  }\n\n  transform({ data }) {\n    if (data.status.code !== 0) {\n      throw new NotFound({ prettyMessage: 'invalid username' })\n    }\n\n    if (data.them.length === 0 || !data.them[0]) {\n      throw new NotFound({ prettyMessage: 'profile not found' })\n    }\n\n    return { user: data.them[0] }\n  }\n}\n","sourceCodeStart":10,"sourceCodeEnd":34,"githubUrl":"https://github.com/badges/shields/blob/766fd8bc89a90b8534dc573ab72dec30215ab1ec/services/keybase/keybase-profile.js#L10-L34","documentation":"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.","triggerScenarios":"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.","commonSituations":"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).","solutions":["Retry the badge later — the API may return the profile once consistent.","Verify the account still exists and has a public profile on keybase.io.","If the account is gone, remove or replace the badge."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"const res = await fetch(`https://keybase.io/_/api/1.0/user/lookup.json?username=${encodeURIComponent(username)}`);\nconst data = await res.json();\nif (data.status.code === 0 && (!Array.isArray(data.them) || !data.them[0])) {\n  console.warn(`Keybase returned no profile for ${username}; retry later`);\n}","typeGuard":"function hasKeybaseProfile(data) {\n  return Array.isArray(data?.them) && Boolean(data.them[0]);\n}","tryCatchPattern":"try {\n  profile = await getKeybaseProfileBadge(username);\n} catch (e) {\n  if (e.name === 'NotFound') {\n    profile = await retryWithBackoff(() => getKeybaseProfileBadge(username), 2)\n      .catch(() => renderFallback('profile unavailable'));\n  } else throw e;\n}","preventionTips":["Treat status-0-but-empty responses as transient and retry","Verify the account still exists and is active on keybase.io","Cache last-known-good profile data as a fallback"],"tags":["keybase","not-found","empty-response","profile"],"backgroundTag":"empty-upstream-dataset","analyzedSha":"766fd8bc89a90b8534dc573ab72dec30215ab1ec","analyzedAt":"2026-08-30T01:40:27.499Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}