{"record":{"id":"ac77457aa6fc655e","repo":"badges/shields","slug":"track-not-found","errorCode":null,"errorMessage":"track not found","messagePattern":"track not found","errorType":"exception","errorClass":"NotFound","httpStatus":null,"severity":"error","filePath":"services/snapcraft/snapcraft-last-update.service.js","lineNumber":70,"sourceCode":"      },\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' }) {\n    const parsedData = await this.fetch(lastUpdateSchema, { packageName })\n\n    // filter results by track, risk and arch\n    const { channel } = this.constructor.transform(\n      parsedData,\n      track,","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/badges/shields/blob/766fd8bc89a90b8534dc573ab72dec30215ab1ec/services/snapcraft/snapcraft-last-update.service.js#L52-L88","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nhttps://img.shields.io/snapcraft/v/core/stable?track=9.9\n// after\nhttps://img.shields.io/snapcraft/v/core/stable?track=latest","handlingStrategy":"validation","validationCode":"// Verify the track exists in the snap's channel map before requesting the badge\nasync function trackPublished(snap, track, arch = 'amd64') {\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.track === track && c.channel.architecture === arch)\n}\nif (!(await trackPublished('core', 'latest'))) throw new Error('track not published')","typeGuard":"function trackExists(channelMap, track) {\n  return (channelMap || []).some(c => c.channel && c.channel.track === track)\n}","tryCatchPattern":"try {\n  const badge = await fetchBadgeUrl(snapcraftBadgeUrl)\n} catch (e) {\n  if (/track not found/.test(e.message)) {\n    console.warn('Track not published for this snap/arch; list tracks on the Store page')\n  } else throw e\n}","preventionTips":["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"],"tags":["snapcraft","not-found","channel","badge","configuration"],"backgroundTag":"resource-not-found","analyzedSha":"766fd8bc89a90b8534dc573ab72dec30215ab1ec","analyzedAt":"2026-08-30T01:40:27.499Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}