{"record":{"id":"aa35502140023f95","repo":"Jguer/yay","slug":"failed-to-parse-s-s","errorCode":null,"errorMessage":"failed to parse %s: %s","messagePattern":"failed to parse (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/sync/srcinfo/service.go","lineNumber":123,"sourceCode":"\n\treturn nil\n}\n\nfunc ParseSrcinfoFilesByBase(logger *text.Logger, pkgBuildDirs map[string]string, errIsFatal bool) (map[string]*gosrc.Srcinfo, error) {\n\tsrcinfos := make(map[string]*gosrc.Srcinfo)\n\n\tk := 0\n\tfor base, dir := range pkgBuildDirs {\n\t\tlogger.OperationInfoln(gotext.Get(\"(%d/%d) Parsing SRCINFO: %s\", k+1, len(pkgBuildDirs), text.Cyan(base)))\n\n\t\tpkgbuild, err := gosrc.ParseFile(filepath.Join(dir, \".SRCINFO\"))\n\t\tif err != nil {\n\t\t\tif !errIsFatal {\n\t\t\t\tlogger.Warnln(gotext.Get(\"failed to parse %s -- skipping: %s\", base, err))\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\treturn nil, errors.New(gotext.Get(\"failed to parse %s: %s\", base, err))\n\t\t}\n\n\t\tsrcinfos[base] = pkgbuild\n\t\tk++\n\t}\n\n\treturn srcinfos, nil\n}\n","sourceCodeStart":105,"sourceCodeEnd":132,"githubUrl":"https://github.com/Jguer/yay/blob/328f4b4939fb35f38c2f7c7ce3b8638a839bafa5/pkg/sync/srcinfo/service.go#L105-L132","documentation":"ParseSrcinfoFilesByBase parses .SRCINFO files for each pkgbase and, when parsing fails and the error is fatal (errIsFatal), aborts the whole batch with 'failed to parse <base>: <err>'. Non-fatal parse failures are only warned about and skipped. It means a .SRCINFO for the named pkgbase is malformed and the caller asked for strict handling.","triggerScenarios":"NewService or createDevelDB calling ParseSrcinfoFilesByBase over cloned PKGBUILD repos where a generated .SRCINFO violates srcinfo format (bad field, unparsable pkgbuild), with fatal error handling enabled.","commonSituations":"AUR pkgbuild repos with corrupted or hand-edited .SRCINFO; interrupted git merges leaving stale srcinfo files in the devel DB; version changes in the srcinfo parser being stricter than the generator that wrote the file.","solutions":["Inspect the pkgbase directory named in the message and regenerate its .SRCINFO (e.g. 'makepkg --printsrcinfo > .SRCINFO').","Remove the corrupt pkgbuild directory and let yay re-clone it (delete it under the yay build/cache dir, e.g. ~/.cache/yay/<pkgbase>).","Update the package: the maintainer may have pushed a fixed PKGBUILD; re-run the operation to re-sync.","If it only affects devel packages, rebuild the devel DB (remove the devel DB file so createDevelDB regenerates it)."],"exampleFix":"// before\n$ yay -Sua\nfailed to parse linux-mainline: ... \n// after\n$ rm -rf ~/.cache/yay/linux-mainline && yay -Sua","handlingStrategy":"try-catch","validationCode":"// sanity-check .SRCINFO before batch parse\nf, err := os.Open(filepath.Join(dir, \".SRCINFO\"))\nif err != nil || f == nil {\n    return fmt.Errorf(\"missing or unreadable .SRCINFO in %s\", dir)\n}","typeGuard":null,"tryCatchPattern":"svc, err := srcinfo.NewService(db, logger, cmdBuilder, cache)\nif err != nil {\n    if strings.Contains(err.Error(), \"failed to parse\") {\n        // drop the offending pkgbase dir and retry with a fresh clone\n        os.RemoveAll(offendingDir)\n    }\n    return err\n}","preventionTips":["Re-clone pkgbuild dirs whose .SRCINFO fails to parse.","Never hand-edit generated .SRCINFO files.","Regenerate .SRCINFO with makepkg --printsrcinfo after PKGBUILD edits.","Clear the devel DB when devel packages fail parsing."],"tags":["srcinfo","parsing","arch-linux","aur"],"backgroundTag":"schema-validation-failed","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"}