{"record":{"id":"4bfa4646fae8c7da","repo":"badges/shields","slug":"bucket-bucket-not-found","errorCode":null,"errorMessage":"bucket \"${bucket}\" not found","messagePattern":"bucket \"(.+?)\" not found","errorType":"exception","errorClass":"NotFound","httpStatus":null,"severity":"error","filePath":"services/scoop/scoop-base.js","lineNumber":55,"sourceCode":"        const url = new URL(decodeURIComponent(bucket))\n\n        // Throw errors to go to jump to catch statement\n        // The error messages here are purely for code readability, and will never reach the user.\n        if (url.hostname !== 'github.com') {\n          throw new Error('Not a GitHub URL')\n        }\n        const path = url.pathname.split('/').filter(value => value !== '')\n\n        if (path.length !== 2) {\n          throw new Error('Not a valid GitHub Repo')\n        }\n\n        const [user, repo] = path\n\n        // Reconstructing the url here ensures that the url will match the regex\n        bucketUrl = `https://github.com/${user}/${repo}`\n      } catch (e) {\n        throw new NotFound({ prettyMessage: `bucket \"${bucket}\" not found` })\n      }\n    }\n    const {\n      groups: { user, repo },\n    } = gitHubRepoRegExp.exec(bucketUrl)\n    try {\n      return await fetchJsonFromRepo(this, {\n        schema,\n        user,\n        repo,\n        branch: 'master',\n        filename: `bucket/${app}.json`,\n      })\n    } catch (error) {\n      if (error instanceof NotFound) {\n        throw new NotFound({\n          prettyMessage: `${app} not found in bucket \"${bucket}\"`,\n        })","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/badges/shields/blob/766fd8bc89a90b8534dc573ab72dec30215ab1ec/services/scoop/scoop-base.js#L37-L73","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Use the owner/repo form for the bucket (e.g. `ScoopInstaller/Extras`) instead of a local alias","Check the bucket name against the official Scoop buckets directory","Verify the bucket's GitHub repository still exists and is public","Escape/encode the bucket parameter correctly in the badge URL"],"exampleFix":"// before\nhttps://img.shields.io/scoop/v/7zip/mybucket\n// after\nhttps://img.shields.io/scoop/v/7zip/ScoopInstaller/Extras","handlingStrategy":"validation","validationCode":"// Only pass buckets resolvable to a public GitHub repo\nfunction isValidScoopBucket(bucket) {\n  if (/^[\\w.-]+\\/[\\w.-]+$/.test(bucket)) return true // owner/repo form\n  const official = ['main','extras','versions','nirsoft','php','nerd-fonts','nonportable','java','games']\n  return official.includes(bucket.toLowerCase())\n}","typeGuard":null,"tryCatchPattern":"try {\n  const badge = await fetchBadgeUrl(scoopBadgeUrl)\n} catch (e) {\n  if (/bucket .* not found/.test(e.message)) {\n    console.warn('Unknown bucket: use owner/repo form or an official bucket name')\n  } else throw e\n}","preventionTips":["Prefer the owner/repo form for custom buckets instead of local aliases","Keep a list of official bucket names and validate against it","Verify the bucket's GitHub repo is public and exists before embedding the badge","Watch for bucket renames/deletions upstream"],"tags":["scoop","github","not-found","badge","configuration"],"backgroundTag":"resource-not-found","analyzedSha":"766fd8bc89a90b8534dc573ab72dec30215ab1ec","analyzedAt":"2026-08-30T01:40:27.499Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}