{"record":{"id":"f6c7ffb9b93de7f0","repo":"Jguer/yay","slug":"package-not-found-in-repos","errorCode":null,"errorMessage":"package not found in repos","messagePattern":"package not found in repos","errorType":"exception","errorClass":"ErrABSPackageNotFound","httpStatus":null,"severity":"error","filePath":"pkg/download/abs.go","lineNumber":23,"sourceCode":"\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"regexp\"\n\n\t\"github.com/leonelquinteros/gotext\"\n\n\t\"github.com/Jguer/yay/v13/pkg/settings/exe\"\n)\n\nconst (\n\tMaxConcurrentFetch = 20\n\tabsPackageURL      = \"https://gitlab.archlinux.org/archlinux/packaging/packages\"\n)\n\nvar (\n\tErrInvalidRepository  = errors.New(gotext.Get(\"invalid repository\"))\n\tErrABSPackageNotFound = errors.New(gotext.Get(\"package not found in repos\"))\n)\n\ntype regexReplace struct {\n\trepl  string\n\tmatch *regexp.Regexp\n}\n\n// regex replacements for Gitlab URLs\n// info: https://gitlab.archlinux.org/archlinux/devtools/-/blob/6ce666a1669235749c17d5c44d8a24dea4a135da/src/lib/api/gitlab.sh#L84\nvar gitlabRepl = []regexReplace{\n\t{repl: `$1-$2`, match: regexp.MustCompile(`([a-zA-Z0-9]+)\\+([a-zA-Z]+)`)},\n\t{repl: `plus`, match: regexp.MustCompile(`\\+`)},\n\t{repl: `-`, match: regexp.MustCompile(`[^a-zA-Z0-9_\\-.]`)},\n\t{repl: `-`, match: regexp.MustCompile(`[_\\-]{2,}`)},\n\t{repl: `unix-tree`, match: regexp.MustCompile(`^tree$`)},\n}\n\n// Return format for pkgbuild","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/Jguer/yay/blob/328f4b4939fb35f38c2f7c7ce3b8638a839bafa5/pkg/download/abs.go#L5-L41","documentation":"Sentinel error ErrABSPackageNotFound from pkg/download/abs.go signals that the Arch Build System (ABS) fetch found no package at the given URL. ABSPKGBUILD builds a gitlab.archlinux.org URL for the package and checks the HTTP response; any non-200 status (most importantly 404) is converted to this error. It means the requested package does not exist in the configured repositories, not that the network failed.","triggerScenarios":"Calling ABSPKGBUILD with a pkgname that has no package in the ABS repository, or with a repo value that does not host it; the GitLab request returns 404 (or another non-200) and abs.go:71 maps it to this sentinel.","commonSituations":"Typo in a package name when building from source; AUR-only or renamed/removed packages that no longer exist in the official repos; stale local repo metadata listing a package that was deleted upstream; transient GitLab 5xx also surfaces as this error.","solutions":["Verify the package name is spelled correctly and exists in an official repo (pacman -Si <name> or the Arch package search).","Check whether the package only exists in the AUR — if so, fetch the PKGBUILD from the AUR instead of ABS.","Refresh local sync databases (pacman -Sy) and retry, since stale metadata can reference removed packages.","Retry after a short delay if GitLab was returning a transient non-200 (5xx)."],"exampleFix":"// before\npkgbuild, err := download.ABSPKGBUILD(ctx, \"brltty-nonexistent\")\n// after\nif _, err := exec.Command(\"pacman\", \"-Si\", pkgname).Run(); err != nil {\n    // fall back to AUR or abort before calling ABSPKGBUILD\n    return fmt.Errorf(\"%s not found in official repos; trying AUR\", pkgname)\n}\npkgbuild, err := download.ABSPKGBUILD(ctx, pkgname)","handlingStrategy":"validation","validationCode":"// Pre-check package existence before calling ABSPKGBUILD\nfunc pkgInRepos(pkg string) bool {\n    return exec.Command(\"pacman\", \"-Si\", pkg).Run() == nil\n}\nif !pkgInRepos(pkgname) {\n    // route to AUR or abort\n}","typeGuard":"func isABSPackageNotFound(err error) bool {\n    return errors.Is(err, download.ErrABSPackageNotFound)\n}","tryCatchPattern":"pkgbuild, err := download.ABSPKGBUILD(ctx, pkgname)\nif err != nil {\n    if errors.Is(err, download.ErrABSPackageNotFound) {\n        return fmt.Errorf(\"package %q not found in repos; check spelling or use AUR\", pkgname)\n    }\n    return err // network or other failure\n}","preventionTips":["Verify package names against official repo listings before fetching PKGBUILDs","Handle AUR-only packages through a separate code path","Refresh sync databases before lookups","Treat transient GitLab 5xx with a bounded retry before concluding the package is absent"],"tags":["network","http","package-not-found","arch-linux"],"backgroundTag":"resource-not-found","analyzedSha":"328f4b4939fb35f38c2f7c7ce3b8638a839bafa5","analyzedAt":"2026-09-07T16:45:12.608Z","contentChangedAt":"2026-09-07T16:45:12.608Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}