{"record":{"id":"bb40b111da1cdb1b","repo":"badges/shields","slug":"no-tags-found","errorCode":null,"errorMessage":"no tags found","messagePattern":"no tags found","errorType":"exception","errorClass":"NotFound","httpStatus":404,"severity":"warning","filePath":"services/docker/docker-last-updated.service.js","lineNumber":88,"sourceCode":"\n  async fetch({ user, repo, tag }) {\n    return await fetch(this, {\n      schema: tag ? tagSchema : newestSchema,\n      url: `https://registry.hub.docker.com/v2/repositories/${getDockerHubUser(\n        user,\n      )}/${repo}/tags${tag ? `/${tag}` : '?page_size=1&ordering=last_updated'}`,\n      httpErrors: { 404: 'repository or tag not found' },\n    })\n  }\n\n  transform({ tag, data }) {\n    if (tag) {\n      return { date: data.last_updated }\n    }\n    // 404 from the Hub API already maps to \"repository or tag not found\".\n    // An empty results list is a 200 for a repo that exists but has no tags yet.\n    if (data.count === 0 || data.results.length === 0) {\n      throw new NotFound({ prettyMessage: 'no tags found' })\n    }\n    return { date: data.results[0].last_updated }\n  }\n\n  async handle({ user, repo, tag }) {\n    const data = await this.fetch({ user, repo, tag })\n    const { date } = this.transform({ tag, data })\n    return this.constructor.render({ date })\n  }\n}\n","sourceCodeStart":70,"sourceCodeEnd":99,"githubUrl":"https://github.com/badges/shields/blob/766fd8bc89a90b8534dc573ab72dec30215ab1ec/services/docker/docker-last-updated.service.js#L70-L99","documentation":"DockerLastUpdated.transform throws NotFound with prettyMessage 'no tags found' when the Docker Hub tags response succeeds (HTTP 200) but data.count is 0 or data.results is empty. Per the source comment, a Hub 404 already maps to 'repository or tag not found'; this error covers the distinct case of a repo that exists but has no tags yet.","triggerScenarios":"Requesting a last-updated badge for a Docker Hub repository that returns a 200 with an empty tags list - a repo created but never pushed to, or all tags deleted.","commonSituations":"Freshly created Docker Hub repositories with no pushes; repos whose tags were pruned; requesting with a tag filter where no results match.","solutions":["Verify the repository has at least one tag on Docker Hub","Push an image to the repository so tags exist","Check the user/repo spelling - you may be hitting an empty repo instead of the intended one","Use a different, populated repository for the badge"],"exampleFix":"// before\n/badge/docker/last-update/myuser/empty-repo -> no tags found\n// after\n# push first\ndocker push myuser/empty-repo:latest","handlingStrategy":"try-catch","validationCode":"async function dockerRepoHasAnyTag(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 && data.results?.length > 0\n}","typeGuard":"function hasTags(data) {\n  return data?.count > 0 && Array.isArray(data.results) && data.results.length > 0\n}","tryCatchPattern":"try {\n  const badge = await getDockerLastUpdatedBadge(user, repo)\n} catch (err) {\n  if (err.prettyMessage === 'no tags found') {\n    badge = 'no tags'\n  } else throw err\n}","preventionTips":["Push at least one tag before adding last-update badges for a repo","Distinguish 'no tags found' (200, empty list) from 'repository or tag not found' (404) when debugging","Verify the tag filter matches existing tags","Remove badges for repos whose tags were deleted"],"tags":["docker","docker-hub","no-tags","not-found"],"backgroundTag":"docker-repository-not-found","analyzedSha":"766fd8bc89a90b8534dc573ab72dec30215ab1ec","analyzedAt":"2026-08-30T01:40:27.499Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}