badges/shields · error · NotFound

arch not found

Error message

arch not found

What it means

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.

Source

Thrown at services/snapcraft/snapcraft-last-update.service.js:64

            name: 'arch',
            example: 'amd64',
            description:
              'Architecture, when not specified, this will default to `amd64`.',
          }),
        ],
      },
    },
  }

  static defaultBadgeData = { label: 'last updated' }

  static transform(apiData, track, risk, arch) {
    const channelMap = apiData['channel-map']
    let filteredChannelMap = channelMap.filter(
      ({ channel }) => channel.architecture === arch,
    )
    if (filteredChannelMap.length === 0) {
      throw new NotFound({ prettyMessage: 'arch not found' })
    }
    filteredChannelMap = filteredChannelMap.filter(
      ({ channel }) => channel.track === track,
    )
    if (filteredChannelMap.length === 0) {
      throw new NotFound({ prettyMessage: 'track not found' })
    }
    filteredChannelMap = filteredChannelMap.filter(
      ({ channel }) => channel.risk === risk,
    )
    if (filteredChannelMap.length === 0) {
      throw new NotFound({ prettyMessage: 'risk not found' })
    }

    return filteredChannelMap[0]
  }

  async handle({ package: packageName, track, risk }, { arch = 'amd64' }) {

View on GitHub (pinned to 766fd8bc89)

Solutions

  1. Check the snap's published architectures on its Snap Store page and request one of those (e.g. arch=amd64)
  2. Use the default badge URL (omit arch) if you don't need an architecture-specific update time
  3. Fix the architecture spelling to a valid Store architecture name
  4. Ask the snap maintainer to build for your architecture if it's genuinely missing

Example fix

// before
https://img.shields.io/snapcraft/v/core/arm?arch=mips
// after (arch actually published)
https://img.shields.io/snapcraft/v/core?arch=arm64
Defensive patterns

Strategy: validation

Validate before calling

// Check the snap's published architectures before requesting an arch-specific badge
const VALID_ARCHS = ['amd64','arm64','armhf','i386','ppc64el','s390x']
async function archPublished(snap, arch) {
  if (!VALID_ARCHS.includes(arch)) return false
  const res = await fetch(`https://api.snapcraft.io/v2/snaps/info/${snap}`, { headers: { 'Snap-Device-Series': '16' } })
  const info = await res.json()
  return (info['channel-map'] || []).some(c => c.channel.architecture === arch)
}
if (!(await archPublished('core', 'arm64'))) throw new Error('arch not published')

Type guard

function isValidArch(arch) {
  return ['amd64','arm64','armhf','i386','ppc64el','s390x'].includes(arch)
}

Try / catch

try {
  const badge = await fetchBadgeUrl(snapcraftBadgeUrl)
} catch (e) {
  if (/arch not found/.test(e.message)) {
    console.warn('Snap is not published for that architecture; use a published arch or omit arch')
  } else throw e
}

Prevention

When it happens

Trigger: 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.

Common situations: 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).

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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