badges/shields · warning · NotFound
architecture not found
Error message
architecture not found
What it means
getImageSizeForArch in docker-size.service.js throws NotFound with prettyMessage 'architecture not found' when none of the images in the provided images object have an `architecture` matching the requested arch. The size badge supports an architecture query (e.g. ?arch=arm64) and this fires when no image entry matches it.
Source
Thrown at services/docker/docker-size.service.js:76
{
name: 'arch',
example: 'amd64',
schema: { type: 'string', enum: archEnum },
},
)
// If user provided the arch parameter,
// check if any of the returned images has an architecture matching the arch parameter provided.
// If yes, return the size of the image with this arch.
// If not, throw the `NotFound` error.
// For details see: https://github.com/badges/shields/issues/8238
function getImageSizeForArch(images, arch) {
const imgWithArch = Object.values(images).find(
img => img.architecture === arch,
)
if (!imgWithArch) {
throw new NotFound({ prettyMessage: 'architecture not found' })
}
return imgWithArch.size
}
export default class DockerSize extends BaseJsonService {
static category = 'size'
static route = { ...buildDockerUrl('image-size', true), queryParamSchema }
static auth = {
userKey: 'dockerhub_username',
passKey: 'dockerhub_pat',
authorizedOrigins: [
'https://hub.docker.com',
'https://registry.hub.docker.com',
],
isRequired: false,
}
View on GitHub (pinned to 766fd8bc89)
Solutions
- Check the exact architecture strings the image publishes (Docker Hub uses amd64, arm64, arm/v7 etc.) and match ?arch= to one of them
- Omit the arch parameter to get the default image size
- Try a different tag of the image that includes your architecture
- If you maintain the image, publish a manifest list including the requested architecture
Example fix
// before /badge/docker/image-size/myuser/myimage/latest?arch=aarch64 -> architecture not found // after /badge/docker/image-size/myuser/myimage/latest?arch=arm64
Defensive patterns
Strategy: validation
Validate before calling
async function imageHasArch(user, repo, tag, arch) {
const res = await fetch(`https://hub.docker.com/v2/repositories/${user}/${repo}/tags/${tag}`)
if (!res.ok) return false
const data = await res.json()
return (data.images ?? []).some(i => i.architecture === arch)
} Type guard
function hasArchitecture(images, arch) {
return Array.isArray(images) && images.some(i => i?.architecture === arch)
} Try / catch
try {
const size = await getDockerSizeBadge(user, repo, { tag, arch })
} catch (err) {
if (err.prettyMessage === 'architecture not found') {
size = null // fall back to default arch or 'n/a'
} else throw err
} Prevention
- Use Docker Hub's architecture strings exactly (amd64, arm64, arm/v7 style for variants)
- Omit ?arch= when unsure to get the default image size
- Check the tag's page for supported architectures before embedding an arch-specific badge
- For your own images, publish manifest lists covering the architectures you badge
When it happens
Trigger: Requesting a Docker size badge with ?arch=<value> where the latest tag/manifest has no image for that architecture - e.g. arch=arm64 on an image published only for amd64, or a misspelled arch value like 'aarch64' vs 'arm64'.
Common situations: Single-architecture images queried with a different arch; arch naming mismatches (amd64 vs x86_64, arm64 vs aarch64); new manifests that dropped an architecture.
Related errors
- repository not found
- no tags found
- repository not found
- digest not found for latest tag
- no images found for arch ${arch}
AI-assisted analysis of badges/shields@766fd8bc89 (2026-08-30).
Data as JSON: /api/errors/fdf38180483d82ef.
Report an issue: GitHub.