{"record":{"id":"23ae84f5e5407cc8","repo":"badges/shields","slug":"arch-not-found-23ae84","errorCode":null,"errorMessage":"arch not found","messagePattern":"arch not found","errorType":"exception","errorClass":"NotFound","httpStatus":null,"severity":"warning","filePath":"services/snapcraft/snapcraft-version.service.js","lineNumber":68,"sourceCode":"          }),\n        ],\n      },\n    },\n  }\n\n  static defaultBadgeData = { label: 'snapcraft' }\n\n  static render({ version }) {\n    return renderVersionBadge({ version })\n  }\n\n  static transform(apiData, track, risk, arch) {\n    const channelMap = apiData['channel-map']\n    let filteredChannelMap = channelMap.filter(\n      ({ channel }) => channel.architecture === arch,\n    )\n    if (filteredChannelMap.length === 0) {\n      throw new NotFound({ prettyMessage: 'arch not found' })\n    }\n    filteredChannelMap = filteredChannelMap.filter(\n      ({ channel }) => channel.track === track,\n    )\n    if (filteredChannelMap.length === 0) {\n      throw new NotFound({ prettyMessage: 'track not found' })\n    }\n    filteredChannelMap = filteredChannelMap.filter(\n      ({ channel }) => channel.risk === risk,\n    )\n    if (filteredChannelMap.length === 0) {\n      throw new NotFound({ prettyMessage: 'risk not found' })\n    }\n\n    return filteredChannelMap[0]\n  }\n\n  async handle({ package: packageName, track, risk }, { arch = 'amd64' }) {","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/badges/shields/blob/766fd8bc89a90b8534dc573ab72dec30215ab1ec/services/snapcraft/snapcraft-version.service.js#L50-L86","documentation":"The Snapcraft version badge's `transform` filters the Snap Store channel-map by architecture, track, then risk. This NotFound is thrown when no channel in the store's channel-map matches the requested `arch` (default amd64 in `handle`). It means the snap has no published release for that CPU architecture.","triggerScenarios":"Calling the /snapcraft-version badge endpoint with an `arch` query param (e.g. arm64, armhf, ppc64el) that the snap does not publish any channel for.","commonSituations":"Requesting an arch badge for a snap that only supports amd64; typo in arch name (e.g. 'arm' instead of 'armhf'); snap recently published to a new architecture and the requester assumed it exists.","solutions":["Check the snap's store listing (or run `snap info <name>`) to see which architectures it actually supports","Use the default arch (omit the arch param, defaults to amd64) or pick a supported one like arm64/armhf","Fix typos in the arch query parameter, using Snap Store naming (amd64, arm64, armhf, i386, ppc64el, s390x)","If the arch should exist, publish the snap for it (snapcraft --target-arch) and retry"],"exampleFix":"// before\n/badge/snapcraft-version/my-snap?arch=arm\n// after\n/badge/snapcraft-version/my-snap?arch=arm64","handlingStrategy":"try-catch","validationCode":"const SUPPORTED_ARCHS = ['amd64','arm64','armhf','i386','ppc64el','s390x'];\nif (arch && !SUPPORTED_ARCHS.includes(arch)) throw new Error(`unknown arch: ${arch}`);","typeGuard":"const isSupportedArch = (a) => typeof a === 'string' && ['amd64','arm64','armhf','i386','ppc64el','s390x'].includes(a);","tryCatchPattern":"try {\n  const badge = await getSnapcraftVersion({ package: name, track, risk, arch });\n} catch (err) {\n  if (err prettyMessage === 'arch not found') {\n    // fall back to default arch=amd64 or render 'unsupported arch' badge\n  } else throw err;\n}","preventionTips":["Look up the snap's supported architectures with `snap info <name>` before choosing the arch param","Omit arch to accept the amd64 default","Use exact Snap Store arch names (amd64, arm64, armhf, i386, ppc64el, s390x)"],"tags":["snapcraft","not-found","architecture","query-param"],"backgroundTag":"resource-not-found","analyzedSha":"766fd8bc89a90b8534dc573ab72dec30215ab1ec","analyzedAt":"2026-08-30T01:40:27.499Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}