badges/shields · error · NotFound

bucket "${bucket}" not found

Error message

bucket "${bucket}" not found

What it means

Thrown by the Scoop badge base when the requested bucket cannot be resolved to a GitHub repository. The service attempts to extract user/repo from the bucket (either the bucket name maps via the Scoop directory, or the URL is parsed with a GitHub regex); when that reconstruction fails it raises NotFound, meaning the bucket is unknown.

Source

Thrown at services/scoop/scoop-base.js:55

        const url = new URL(decodeURIComponent(bucket))

        // Throw errors to go to jump to catch statement
        // The error messages here are purely for code readability, and will never reach the user.
        if (url.hostname !== 'github.com') {
          throw new Error('Not a GitHub URL')
        }
        const path = url.pathname.split('/').filter(value => value !== '')

        if (path.length !== 2) {
          throw new Error('Not a valid GitHub Repo')
        }

        const [user, repo] = path

        // Reconstructing the url here ensures that the url will match the regex
        bucketUrl = `https://github.com/${user}/${repo}`
      } catch (e) {
        throw new NotFound({ prettyMessage: `bucket "${bucket}" not found` })
      }
    }
    const {
      groups: { user, repo },
    } = gitHubRepoRegExp.exec(bucketUrl)
    try {
      return await fetchJsonFromRepo(this, {
        schema,
        user,
        repo,
        branch: 'master',
        filename: `bucket/${app}.json`,
      })
    } catch (error) {
      if (error instanceof NotFound) {
        throw new NotFound({
          prettyMessage: `${app} not found in bucket "${bucket}"`,
        })

View on GitHub (pinned to 766fd8bc89)

Solutions

  1. Use the owner/repo form for the bucket (e.g. `ScoopInstaller/Extras`) instead of a local alias
  2. Check the bucket name against the official Scoop buckets directory
  3. Verify the bucket's GitHub repository still exists and is public
  4. Escape/encode the bucket parameter correctly in the badge URL

Example fix

// before
https://img.shields.io/scoop/v/7zip/mybucket
// after
https://img.shields.io/scoop/v/7zip/ScoopInstaller/Extras
Defensive patterns

Strategy: validation

Validate before calling

// Only pass buckets resolvable to a public GitHub repo
function isValidScoopBucket(bucket) {
  if (/^[\w.-]+\/[\w.-]+$/.test(bucket)) return true // owner/repo form
  const official = ['main','extras','versions','nirsoft','php','nerd-fonts','nonportable','java','games']
  return official.includes(bucket.toLowerCase())
}

Try / catch

try {
  const badge = await fetchBadgeUrl(scoopBadgeUrl)
} catch (e) {
  if (/bucket .* not found/.test(e.message)) {
    console.warn('Unknown bucket: use owner/repo form or an official bucket name')
  } else throw e
}

Prevention

When it happens

Trigger: Passing a `bucket` query parameter that is not an official Scoop bucket name and not a parseable github.com/user/repo path — e.g. a custom bucket registered locally on the user's machine (`scoop bucket add mybucket ...`) that the badge service cannot know about, or a bucket name with a typo.

Common situations: Badge URL copied for a privately-added bucket; bucket was renamed or deleted on GitHub; using just the local bucket alias instead of the owner/repo form; GitLab or non-GitHub bucket URLs not matching the GitHub regex.

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/4bfa4646fae8c7da. Report an issue: GitHub.