{"record":{"id":"5c569324cb8df7ff","repo":"badges/shields","slug":"distribution-yaml-not-found-distro-prettyref","errorCode":null,"errorMessage":"distribution.yaml not found: ${distro}@${prettyRef}","messagePattern":"distribution\\.yaml not found: (.+?)@(.+?)","errorType":"exception","errorClass":"NotFound","httpStatus":null,"severity":"error","filePath":"services/ros/ros-version.service.js","lineNumber":130,"sourceCode":"      query: gql`\n        query ($expression: String!) {\n          repository(owner: \"ros\", name: \"rosdistro\") {\n            object(expression: $expression) {\n              ... on Blob {\n                text\n              }\n            }\n          }\n        }\n      `,\n      variables: {\n        expression: `${ref}:${distro}/distribution.yaml`,\n      },\n      schema: contentSchema,\n    })\n\n    if (!contentJson.data.repository.object) {\n      throw new NotFound({\n        prettyMessage: `distribution.yaml not found: ${distro}@${prettyRef}`,\n      })\n    }\n    const version = this.constructor._parseReleaseVersionFromDistro(\n      contentJson.data.repository.object.text,\n      repoName,\n    )\n\n    return { ...renderVersionBadge({ version }), label: `ros | ${distro}` }\n  }\n\n  static _parseReleaseVersionFromDistro(distroYaml, repoName) {\n    let distro\n    try {\n      distro = yaml.load(distroYaml)\n    } catch (err) {\n      throw new InvalidResponse({\n        prettyMessage: 'unparseable distribution.yml',","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/badges/shields/blob/766fd8bc89a90b8534dc573ab72dec30215ab1ec/services/ros/ros-version.service.js#L112-L148","documentation":"The ROS version badge throws NotFound 'distribution.yaml not found: <distro>@<ref>' when the GitHub content query succeeds but the response has no data.repository.object — i.e. the distribution.yaml file for that ROS distro and git ref does not exist in ros/rosdistro. The requested distro/ref combination is invalid for the repository.","triggerScenarios":"Requesting a badge with a distro name not present in rosdistro for the given ref (e.g. 'melodic' after EOL removal, or a future distro), or a ref (branch/tag) where the file path `<ref>:<distro>/distribution.yaml` doesn't resolve.","commonSituations":"ROS distros removed from the master rosdistro branch after EOL; typos in the distro name; pinning an old commit ref where the distro file hadn't been added yet.","solutions":["Use a currently supported ROS distro name that exists in ros/rosdistro (check rosdistro repo for <distro>/distribution.yaml)","Verify the git ref (branch/tag) used contains the distro's distribution.yaml","Correct the typo in the distro parameter of the badge URL"],"exampleFix":"// before\n/badge/ros/v/mypkg/melodic   (removed distro)\n// after\n/badge/ros/v/mypkg/noetic","handlingStrategy":"validation","validationCode":"const res = await fetch(`https://raw.githubusercontent.com/ros/rosdistro/${ref}/${distro}/distribution.yaml`)\nif (!res.ok) throw new Error(`distribution.yaml not found for ${distro}@${ref}`)","typeGuard":"function hasDistroObject(contentJson) {\n  return contentJson?.data?.repository?.object != null &&\n    typeof contentJson.data.repository.object.text === 'string'\n}","tryCatchPattern":"try {\n  const badge = await service.handle({ distro: 'noetic', repoName: 'mypkg' })\n} catch (err) {\n  if (err instanceof NotFound && err.prettyMessage.startsWith('distribution.yaml not found')) {\n    return renderBadge({ label: 'ros', message: 'n/a' })\n  }\n  throw err\n}","preventionTips":["Check ros/rosdistro for the distro's distribution.yaml before using the badge","Avoid EOL distros that have been removed from the rosdistro master branch","Pin a ref known to contain the distro file if you must pin"],"tags":["badge","ros","github","not-found"],"backgroundTag":"resource-not-found-in-upstream","analyzedSha":"766fd8bc89a90b8534dc573ab72dec30215ab1ec","analyzedAt":"2026-08-30T01:40:27.499Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}