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

  1. Check the exact architecture strings the image publishes (Docker Hub uses amd64, arm64, arm/v7 etc.) and match ?arch= to one of them
  2. Omit the arch parameter to get the default image size
  3. Try a different tag of the image that includes your architecture
  4. 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

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


AI-assisted analysis of badges/shields@766fd8bc89 (2026-08-30). Data as JSON: /api/errors/fdf38180483d82ef. Report an issue: GitHub.