badges/shields · error · NotFound
repository not found
Error message
repository not found
What it means
This NotFound error is thrown in the handle method of the Docker version service when the user requested a date-sorted version (no tag, sort=date) and the Docker Hub API reports data.count === 0, i.e. the repository listing is empty. In practice this means the user/repo combination does not exist (or is private/inaccessible), so Docker Hub returns no results rather than a 404 at fetch time.
Source
Thrown at services/docker/docker-version.service.js:170
}
const image = version.images.find(i => i.architecture === arch)
if (!image) {
throw new InvalidResponse({
prettyMessage: 'digest not found for given tag',
})
}
const { digest } = image
return { version: getDigestSemVerMatches({ data, digest }) }
}
}
async handle({ user, repo, tag }, { sort, arch }) {
let data, pagedData
if (!tag && sort === 'date') {
data = await this.fetch({ user, repo })
if (data.count === 0) {
throw new NotFound({ prettyMessage: 'repository not found' })
}
if (data.results[0].name === 'latest') {
pagedData = await getMultiPageData({
user,
repo,
fetch: this.fetch.bind(this),
})
}
} else {
data = await getMultiPageData({
user,
repo,
fetch: this.fetch.bind(this),
})
}
const { version } = this.transform({
tag,View on GitHub (pinned to 766fd8bc89)
Solutions
- Verify the user/repo path in the badge URL matches the exact Docker Hub repository path.
- Check the repository exists at https://hub.docker.com/r/<user>/<repo>.
- If the image is official, prefix with library/ (e.g. /docker/v/_/library/nginx).
- Check repository visibility; private repos need accessible credentials on the badge server.
Example fix
// before /badge/docker/v/_/myrepo?sort=date // repo actually at otheruser/myrepo // after /badge/docker/v/_/otheruser/myrepo?sort=date
Defensive patterns
Strategy: validation
Validate before calling
const res = await fetch(`https://hub.docker.com/v2/repositories/${user}/${repo}/`);
if (res.status === 404) throw new Error(`repository ${user}/${repo} does not exist on Docker Hub`); Try / catch
try {
const { version } = await dockerVersionService.handle({ user, repo }, { sort: 'date' });
} catch (err) {
if (err.message === 'repository not found') {
// render placeholder badge / verify repo path
} else {
throw err;
}
} Prevention
- Verify the exact Docker Hub path (hub.docker.com/r/user/repo) before building the badge URL.
- Remember official images live under the library/ namespace.
- Watch for repository renames/deletions when a badge suddenly breaks.
When it happens
Trigger: Calling the docker version badge with sort=date and no tag where fetch() succeeds but returns count: 0 — a nonexistent repository name, wrong namespace/user, or a private repository the badge server cannot see.
Common situations: Typo in user or repo path segment; repository deleted or renamed; private repo without credentials; badge URL built from a moved project (e.g. Docker 'official image' lives under library/ namespace).
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
AI-assisted analysis of badges/shields@766fd8bc89 (2026-08-30).
Data as JSON: /api/errors/f41a0350d2193131.
Report an issue: GitHub.