{"record":{"id":"80a5fe7ccfdaae7d","repo":"badges/shields","slug":"tag-not-found","errorCode":null,"errorMessage":"tag not found","messagePattern":"tag not found","errorType":"exception","errorClass":"NotFound","httpStatus":404,"severity":"error","filePath":"services/docker/docker-version.service.js","lineNumber":148,"sourceCode":"          prettyMessage: 'digest not found for latest tag',\n        })\n      }\n      const { digest } = imageTag\n      return { version: getDigestSemVerMatches({ data: pagedData, digest }) }\n    } else if (!tag && sort === 'semver') {\n      const matches = data\n        .filter(d => d.images.some(image => image.architecture === arch))\n        .map(d => d.name)\n      if (matches.length === 0) {\n        throw new InvalidResponse({\n          prettyMessage: `no images found for arch ${arch}`,\n        })\n      }\n      return { version: latest(matches) }\n    } else {\n      version = data.find(d => d.name === tag)\n      if (!version) {\n        throw new NotFound({ prettyMessage: 'tag not found' })\n      }\n      if (Object.keys(version.images).length === 0) {\n        return { version: version.name }\n      }\n      const image = version.images.find(i => i.architecture === arch)\n      if (!image) {\n        throw new InvalidResponse({\n          prettyMessage: 'digest not found for given tag',\n        })\n      }\n      const { digest } = image\n      return { version: getDigestSemVerMatches({ data, digest }) }\n    }\n  }\n\n  async handle({ user, repo, tag }, { sort, arch }) {\n    let data, pagedData\n","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/badges/shields/blob/766fd8bc89a90b8534dc573ab72dec30215ab1ec/services/docker/docker-version.service.js#L130-L166","documentation":"This NotFound error is thrown when a specific tag is requested from the Docker Hub version service but no entry in the Docker Hub tag-listing response has that exact name (data.find(d => d.name === tag) returns undefined). It means the repository does not contain a tag matching the requested name exactly. Being a NotFound, the badge renders 'tag not found' instead of a server error.","triggerScenarios":"Requesting /docker/v/<user>/<repo>/<tag> where the tag string does not exactly match any tag name returned by the Docker Hub API for that repository.","commonSituations":"Typo or case mismatch in the tag name; requesting a tag that was deleted or replaced; version changed (e.g. old tag removed on release); omitting a suffix like -alpine or -slim; tag exists only under a different namespace.","solutions":["Verify the exact tag name on Docker Hub (tags are matched by exact string, not prefix).","Check the repository's tags page for the current tag list; the tag may have been deleted.","Use a floating tag (e.g. latest) or omit the tag to resolve versions dynamically.","Update the README/badge URL after version upgrades."],"exampleFix":"// before\n/badge/docker/v/_/library/node/18\n// after (correct exact tag)\n/badge/docker/v/_/library/node/18-alpine","handlingStrategy":"validation","validationCode":"// confirm the tag exists before requesting the badge\nconst res = await fetch(`https://hub.docker.com/v2/repositories/${user}/${repo}/tags/${tag}`);\nif (res.status === 404) throw new Error(`tag ${tag} not found on ${user}/${repo}`);","typeGuard":null,"tryCatchPattern":"try {\n  const version = await dockerVersion({ user, repo, tag });\n} catch (err) {\n  if (err instanceof NotFound || err.message === 'tag not found') {\n    // fall back to 'latest' or render a placeholder badge\n  } else {\n    throw err;\n  }\n}","preventionTips":["Copy tag names exactly from the Docker Hub tags page (exact string match, case-sensitive).","After deleting/upgrading tags, update any badge URLs referencing the old tag.","Prefer omitting the tag (or use latest) in badges for evergreen version display."],"tags":["docker","not-found","tag","docker-hub"],"backgroundTag":"resource-not-found","analyzedSha":"766fd8bc89a90b8534dc573ab72dec30215ab1ec","analyzedAt":"2026-08-30T01:40:27.499Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}