badges/shields · error · NotFound
track not found
Error message
track not found
What it means
Thrown when the channel-map filtered by architecture contains no entries for the requested track. The Snap channel name is <track>/<risk>/<branch>; a missing track means the requested channel track (e.g. '4.0/stable') is not published for that snap and architecture.
Source
Thrown at services/snapcraft/snapcraft-last-update.service.js:70
},
},
}
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' }) {
const parsedData = await this.fetch(lastUpdateSchema, { packageName })
// filter results by track, risk and arch
const { channel } = this.constructor.transform(
parsedData,
track,View on GitHub (pinned to 766fd8bc89)
Solutions
- List the available tracks on the snap's Snap Store page (Channels tab) and use one of those
- Use track=latest (or omit the track) for the default channel
- Re-check the arch parameter — the track may exist only on a different architecture
- If the track was retired upstream, switch the badge to a still-published track
Example fix
// before https://img.shields.io/snapcraft/v/core/stable?track=9.9 // after https://img.shields.io/snapcraft/v/core/stable?track=latest
Defensive patterns
Strategy: validation
Validate before calling
// Verify the track exists in the snap's channel map before requesting the badge
async function trackPublished(snap, track, arch = 'amd64') {
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.track === track && c.channel.architecture === arch)
}
if (!(await trackPublished('core', 'latest'))) throw new Error('track not published') Type guard
function trackExists(channelMap, track) {
return (channelMap || []).some(c => c.channel && c.channel.track === track)
} Try / catch
try {
const badge = await fetchBadgeUrl(snapcraftBadgeUrl)
} catch (e) {
if (/track not found/.test(e.message)) {
console.warn('Track not published for this snap/arch; list tracks on the Store page')
} else throw e
} Prevention
- List tracks on the snap's Store Channels tab before choosing a track parameter
- Default to track=latest when unsure
- Remember tracks are per-architecture; a track may exist only for some arches
- Update badges when a track is retired upstream
When it happens
Trigger: Requesting a last-update badge with a `track` parameter that the snap does not publish — e.g. track=4.0 when only tracks 'latest', '3.2' exist, or omitting/misspelling a track that exists only under a different arch.
Common situations: Track removed after the snap dropped support for that major version; copy-paste of a track from another snap; requesting a track that only exists on architectures not requested.
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
- risk not found
- arch not found
- repo not found: ${repoName}
- bucket "${bucket}" not found
- ${app} not found in bucket "${bucket}"
AI-assisted analysis of badges/shields@766fd8bc89 (2026-08-30).
Data as JSON: /api/errors/ac77457aa6fc655e.
Report an issue: GitHub.