badges/shields · error · NotFound

repo not found: ${repoName}

Error message

repo not found: ${repoName}

What it means

This NotFound error is thrown by the ROS version service when the requested repository name does not exist in the distribution.yml file fetched from the rosdistro repository. The service validates the distro file, then looks up repositories[repoName]; a miss means the user asked for a repo that is not registered in that ROS distribution. It is an intentional 'resource not found' badge error, not a bug.

Source

Thrown at services/ros/ros-version.service.js:157

    return { ...renderVersionBadge({ version }), label: `ros | ${distro}` }
  }

  static _parseReleaseVersionFromDistro(distroYaml, repoName) {
    let distro
    try {
      distro = yaml.load(distroYaml)
    } catch (err) {
      throw new InvalidResponse({
        prettyMessage: 'unparseable distribution.yml',
        underlyingError: err,
      })
    }

    const validatedDistro = this._validate(distro, distroSchema, {
      prettyErrorMessage: 'invalid distribution.yml',
    })
    if (!validatedDistro.repositories[repoName]) {
      throw new NotFound({ prettyMessage: `repo not found: ${repoName}` })
    }

    const repoInfo = this._validate(
      validatedDistro.repositories[repoName],
      repoSchema,
      {
        prettyErrorMessage: `invalid section for ${repoName} in distribution.yml`,
      },
    )

    // Strip off "release inc" suffix
    return repoInfo.release.version.replace(/-\d+$/, '')
  }
}

View on GitHub (pinned to 766fd8bc89)

Solutions

  1. Verify the exact repo key exists in the distribution.yml of the requested ROS distro at github.com/ros/rosdistro (check the `repositories:` section)
  2. Confirm the distro name in the badge URL matches a supported ROS release (e.g. noetic, humble)
  3. Remember the repo key may differ from the package name; if the service supports package lookup, use the package name instead
  4. If the repo was recently added, re-check later — the distro file may not have been released/synced yet

Example fix

// before
https://img.shields.io/ros/v/noetic/mypackage_ros
// after (use correct repo/package key as listed in rosdistro)
https://img.shields.io/ros/v/noetic/mypackage
Defensive patterns

Strategy: validation

Validate before calling

// Pre-check the repo key in the distro file before building the badge URL
async function repoExistsInDistro(distro, repoName) {
  const res = await fetch(`https://raw.githubusercontent.com/ros/rosdistro/master/${distro}/distribution.yaml`)
  const text = await res.text()
  return text.includes(`${repoName}:`) // or parse the YAML properly
}
if (!(await repoExistsInDistro('noetic', 'mypackage'))) throw new Error('repo not in noetic distro')

Type guard

function hasRepo(distro, repoName) {
  return Boolean(distro && distro.repositories && distro.repositories[repoName])
}

Try / catch

try {
  const badge = await fetchBadgeUrl(rosBadgeUrl)
} catch (e) {
  if (/repo not found/.test(e.message)) {
    console.warn(`ROS repo not in distro: check distribution.yaml repositories section`)
  } else throw e
}

Prevention

When it happens

Trigger: Requesting a badge with a `repo` query parameter (or package name mapped to a repo) that is not a key in the target distro's repositories map — e.g. typos in the repo name, a repo that exists only in a different ROS distro (melodic vs noetic), or a repo that was renamed/removed upstream.

Common situations: Developers copy a badge URL from another distro's README; a package was migrated out of rosdistro; hyphen/underscore mistakes between package name and repo name (ROS package names often differ from the repo key); querying an EOL distro whose file no longer lists the repo.

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/871a63403a116420. Report an issue: GitHub.