{"record":{"id":"8b6fd6b7b8e14ac4","repo":"badges/shields","slug":"arch-not-found","errorCode":null,"errorMessage":"arch not found","messagePattern":"arch not found","errorType":"exception","errorClass":"NotFound","httpStatus":null,"severity":"error","filePath":"services/snapcraft/snapcraft-last-update.service.js","lineNumber":64,"sourceCode":"            name: 'arch',\n            example: 'amd64',\n            description:\n              'Architecture, when not specified, this will default to `amd64`.',\n          }),\n        ],\n      },\n    },\n  }\n\n  static defaultBadgeData = { label: 'last updated' }\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":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/badges/shields/blob/766fd8bc89a90b8534dc573ab72dec30215ab1ec/services/snapcraft/snapcraft-last-update.service.js#L46-L82","documentation":"Thrown by the Snapcraft last-update badge's static transform when no entries in the snap's channel-map match the requested architecture. The channel-map from the Snap Store is filtered by channel.architecture first; an empty result means the requested arch is not published for this snap.","triggerScenarios":"Requesting a last-update badge with an `arch` query parameter (default amd64) that the snap does not publish — e.g. arch=arm64 for a snap built only for amd64, or a misspelled architecture string.","commonSituations":"Snap published only for selected architectures; user assumes an arch exists because their device runs it locally; typo like 'x64'/'arm' instead of valid architecture names (amd64, arm64, armhf, i386, ppc64el, s390x).","solutions":["Check the snap's published architectures on its Snap Store page and request one of those (e.g. arch=amd64)","Use the default badge URL (omit arch) if you don't need an architecture-specific update time","Fix the architecture spelling to a valid Store architecture name","Ask the snap maintainer to build for your architecture if it's genuinely missing"],"exampleFix":"// before\nhttps://img.shields.io/snapcraft/v/core/arm?arch=mips\n// after (arch actually published)\nhttps://img.shields.io/snapcraft/v/core?arch=arm64","handlingStrategy":"validation","validationCode":"// Check the snap's published architectures before requesting an arch-specific badge\nconst VALID_ARCHS = ['amd64','arm64','armhf','i386','ppc64el','s390x']\nasync function archPublished(snap, arch) {\n  if (!VALID_ARCHS.includes(arch)) return false\n  const res = await fetch(`https://api.snapcraft.io/v2/snaps/info/${snap}`, { headers: { 'Snap-Device-Series': '16' } })\n  const info = await res.json()\n  return (info['channel-map'] || []).some(c => c.channel.architecture === arch)\n}\nif (!(await archPublished('core', 'arm64'))) throw new Error('arch not published')","typeGuard":"function isValidArch(arch) {\n  return ['amd64','arm64','armhf','i386','ppc64el','s390x'].includes(arch)\n}","tryCatchPattern":"try {\n  const badge = await fetchBadgeUrl(snapcraftBadgeUrl)\n} catch (e) {\n  if (/arch not found/.test(e.message)) {\n    console.warn('Snap is not published for that architecture; use a published arch or omit arch')\n  } else throw e\n}","preventionTips":["Validate arch against the Store's supported architecture names (amd64, arm64, armhf, i386, ppc64el, s390x)","Check the snap's Store page for published architectures before using an arch parameter","Omit the arch parameter (defaults to amd64) unless you need architecture-specific info","Confirm the maintainer actually builds the snap for your target architecture"],"tags":["snapcraft","not-found","architecture","badge","configuration"],"backgroundTag":"resource-not-found","analyzedSha":"766fd8bc89a90b8534dc573ab72dec30215ab1ec","analyzedAt":"2026-08-30T01:40:27.499Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}