{"record":{"id":"fdf38180483d82ef","repo":"badges/shields","slug":"architecture-not-found","errorCode":null,"errorMessage":"architecture not found","messagePattern":"architecture not found","errorType":"exception","errorClass":"NotFound","httpStatus":404,"severity":"warning","filePath":"services/docker/docker-size.service.js","lineNumber":76,"sourceCode":"  {\n    name: 'arch',\n    example: 'amd64',\n    schema: { type: 'string', enum: archEnum },\n  },\n)\n\n// If user provided the arch parameter,\n// check if any of the returned images has an architecture matching the arch parameter provided.\n// If yes, return the size of the image with this arch.\n// If not, throw the `NotFound` error.\n// For details see: https://github.com/badges/shields/issues/8238\nfunction getImageSizeForArch(images, arch) {\n  const imgWithArch = Object.values(images).find(\n    img => img.architecture === arch,\n  )\n\n  if (!imgWithArch) {\n    throw new NotFound({ prettyMessage: 'architecture not found' })\n  }\n  return imgWithArch.size\n}\n\nexport default class DockerSize extends BaseJsonService {\n  static category = 'size'\n  static route = { ...buildDockerUrl('image-size', true), queryParamSchema }\n\n  static auth = {\n    userKey: 'dockerhub_username',\n    passKey: 'dockerhub_pat',\n    authorizedOrigins: [\n      'https://hub.docker.com',\n      'https://registry.hub.docker.com',\n    ],\n    isRequired: false,\n  }\n","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/badges/shields/blob/766fd8bc89a90b8534dc573ab72dec30215ab1ec/services/docker/docker-size.service.js#L58-L94","documentation":"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.","triggerScenarios":"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'.","commonSituations":"Single-architecture images queried with a different arch; arch naming mismatches (amd64 vs x86_64, arm64 vs aarch64); new manifests that dropped an architecture.","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"],"exampleFix":"// before\n/badge/docker/image-size/myuser/myimage/latest?arch=aarch64 -> architecture not found\n// after\n/badge/docker/image-size/myuser/myimage/latest?arch=arm64","handlingStrategy":"validation","validationCode":"async function imageHasArch(user, repo, tag, arch) {\n  const res = await fetch(`https://hub.docker.com/v2/repositories/${user}/${repo}/tags/${tag}`)\n  if (!res.ok) return false\n  const data = await res.json()\n  return (data.images ?? []).some(i => i.architecture === arch)\n}","typeGuard":"function hasArchitecture(images, arch) {\n  return Array.isArray(images) && images.some(i => i?.architecture === arch)\n}","tryCatchPattern":"try {\n  const size = await getDockerSizeBadge(user, repo, { tag, arch })\n} catch (err) {\n  if (err.prettyMessage === 'architecture not found') {\n    size = null // fall back to default arch or 'n/a'\n  } else throw err\n}","preventionTips":["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"],"tags":["docker","architecture","not-found","multi-arch"],"backgroundTag":"architecture-not-supported","analyzedSha":"766fd8bc89a90b8534dc573ab72dec30215ab1ec","analyzedAt":"2026-08-30T01:40:27.499Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}