{"record":{"id":"511780ee9115bf6d","repo":"badges/shields","slug":"repository-not-found-511780","errorCode":null,"errorMessage":"repository not found","messagePattern":"repository not found","errorType":"exception","errorClass":"NotFound","httpStatus":404,"severity":"error","filePath":"services/docker/docker-size.service.js","lineNumber":142,"sourceCode":"\n  static defaultBadgeData = { label: 'image size', color: 'blue' }\n\n  async fetch({ user, repo, tag, page }) {\n    page = page ? `&page=${page}` : ''\n    return await fetch(this, {\n      schema: tag ? buildSchema : pagedSchema,\n      url: `https://registry.hub.docker.com/v2/repositories/${getDockerHubUser(\n        user,\n      )}/${repo}/tags${\n        tag ? `/${tag}` : '?page_size=100&ordering=last_updated'\n      }${page}`,\n      httpErrors: { 404: 'repository or tag not found' },\n    })\n  }\n\n  getSizeFromImageByLatestDate(data, arch) {\n    if (data.count === 0) {\n      throw new NotFound({ prettyMessage: 'repository not found' })\n    } else {\n      const latestEntry = data.results[0]\n\n      if (arch) {\n        return { size: getImageSizeForArch(latestEntry.images, arch) }\n      } else {\n        return { size: latestEntry.full_size }\n      }\n    }\n  }\n\n  getSizeFromImageByLatestSemver(data, arch) {\n    // If no tag is specified, and sorting is by semver, first filter out the entry containing the latest semver from the response with Docker images.\n    // If no architecture is supplied by the user, return `full_size` from this entry.\n    // If the architecture is supplied by the user, check if any of the returned images for this entry has an architecture matching the arch parameter supplied by the user.\n    // If yes, return the size of the image with this arch.\n    // If not, throw the `NotFound` error.\n","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/badges/shields/blob/766fd8bc89a90b8534dc573ab72dec30215ab1ec/services/docker/docker-size.service.js#L124-L160","documentation":"DockerSize.getSizeFromImageByLatestDate throws NotFound with prettyMessage 'repository not found' when the tags-by-date API response has data.count === 0, meaning Docker Hub listed zero tags for the requested repository. No tags means no latest image whose size could be reported.","triggerScenarios":"Requesting a size badge (date-based path) for a user/repo whose tags listing returns count 0 - nonexistent namespace, deleted repo, private repo, or repo with zero pushes.","commonSituations":"Typos in namespace/repo; repos removed from Docker Hub; private images; newly created repos with no pushed tags.","solutions":["Verify the repository and at least one tag exist on Docker Hub","Correct the user/repo spelling in the badge URL","Make sure the repo is public or push a tag if you own it","Check that the repo wasn't renamed/deleted; use the new namespace"],"exampleFix":"// before\n/badge/docker/image-size/myuser/deleted-repo -> repository not found\n// after\n/badge/docker/image-size/myuser/existing-repo","handlingStrategy":"validation","validationCode":"async function dockerRepoExists(user, repo) {\n  const res = await fetch(`https://hub.docker.com/v2/repositories/${user}/${repo}/tags?page_size=1`)\n  if (!res.ok) return false\n  const data = await res.json()\n  return (data.count ?? 0) > 0\n}","typeGuard":"function repoHasImages(data) {\n  return typeof data?.count === 'number' && data.count > 0\n}","tryCatchPattern":"try {\n  const size = await getDockerSizeBadge(user, repo)\n} catch (err) {\n  if (err.prettyMessage === 'repository not found') {\n    size = null\n  } else throw err\n}","preventionTips":["Confirm the repository is public and has tags before adding size badges","Check namespace/repo spelling carefully","Private or deleted repos will fail - keep badge targets up to date","Push at least one image so count > 0"],"tags":["docker","docker-hub","not-found","upstream-api"],"backgroundTag":"docker-repository-not-found","analyzedSha":"766fd8bc89a90b8534dc573ab72dec30215ab1ec","analyzedAt":"2026-08-30T01:40:27.499Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}