{"record":{"id":"4c27f6f56422783f","repo":"Morganamilo/paru","slug":"section-can-not-be-called","errorCode":null,"errorMessage":"section can not be called {}","messagePattern":"section can not be called (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/config.rs","lineNumber":564,"sourceCode":"    pub assume_installed: Vec<String>,\n\n    #[default(PkgbuildRepos::new(aur_fetch::Fetch::with_cache_dir(\"repo\")))]\n    pub pkgbuild_repos: PkgbuildRepos,\n}\n\nimpl Ini for Config {\n    type Err = Error;\n\n    fn callback(&mut self, cb: Callback) -> Result<(), Self::Err> {\n        let err = match cb.kind {\n            CallbackKind::Section(section) => {\n                self.section = Some(section.to_string());\n                if !matches!(section, \"options\" | \"bin\" | \"env\")\n                    && self.pkgbuild_repos.repo(section).is_none()\n                {\n                    if matches!(section, \"local\" | \"aur\" | \"pkg\" | \"base\") || section.contains('.')\n                    {\n                        bail!(tr!(\"section can not be called {}\", section));\n                    }\n                    self.pkgbuild_repos.add_repo(section.to_string());\n                }\n                Ok(())\n            }\n            CallbackKind::Directive(_, key, value) => self.parse_directive(key, value),\n        };\n\n        let filename = cb.filename.unwrap_or(\"paru.conf\");\n        err.map_err(|e| anyhow!(\"{}:{}: {}\", filename, cb.line_number, e))\n    }\n}\n\nimpl Config {\n    pub fn new() -> Result<Self> {\n        let cache =\n            dirs::cache_dir().ok_or_else(|| anyhow!(tr!(\"failed to find cache directory\")))?;\n        let cache = cache.join(\"paru\");","sourceCodeStart":546,"sourceCodeEnd":582,"githubUrl":"https://github.com/Morganamilo/paru/blob/9ac3578807a87858651e81a02586ceb947686e7c/src/config.rs#L546-L582","documentation":"When parsing a pacman.conf-style section, a section name that is not one of `options`, `bin`, `env`, an existing pkgbuild repo, and either collides with a reserved name (`local`, `aur`, `pkg`, `base`) or contains a dot is rejected with 'section can not be called {}'. Reserved/malformed names cannot become pkgbuild repos.","triggerScenarios":"Defining a section like `[base]`, `[local]`, `[aur]`, `[pkg]`, or dotted names like `[my.repo]` in the config file, where the name isn't `options`/`bin`/`env` and isn't already a registered pkgbuild repo.","commonSituations":"Users adding a repo section named like a built-in; using dots in repo names (conflicts with repo.name addressing); typos when creating custom pkgbuild repo sections.","solutions":["Rename the section to avoid reserved names (local, aur, pkg, base) and remove dots, e.g. `[myrepo]` instead of `[my.repo]` or `[base]`","Register the repo first if it already exists and you intended to reference it","Use one of the built-in sections `options`, `bin`, or `env` for non-repo configuration"],"exampleFix":"// before\n[my.repo]\nServer = https://example.com/\n// after\n[myrepo]\nServer = https://example.com/","handlingStrategy":"validation","validationCode":"const RESERVED = new Set(['local', 'aur', 'pkg', 'base', 'options', 'bin', 'env']);\nfunction validate_section(name: string): string | null {\n  if (RESERVED.has(name)) return `section '${name}' is reserved`;\n  if (name.includes('.')) return `section name '${name}' must not contain dots`;\n  return null;\n}","typeGuard":null,"tryCatchPattern":"match parse_config(text) {\n    Err(e) if e.to_string().contains(\"section can not be called\") => {\n        eprintln!(\"{} — rename the section (avoid reserved names and dots)\", e);\n        std::process::exit(1);\n    }\n    Err(e) => return Err(e),\n    Ok(cfg) => apply(cfg),\n}","preventionTips":["Name custom pkgbuild repo sections with simple alphanumeric identifiers","Never reuse built-in names (local, aur, pkg, base) for repos","Keep dots out of section names — they collide with repo.name addressing"],"tags":["config","pacman-conf","section-name","validation"],"backgroundTag":"invalid-config-value","analyzedSha":"9ac3578807a87858651e81a02586ceb947686e7c","analyzedAt":"2026-09-12T04:57:59.861Z","contentChangedAt":"2026-09-12T04:57:59.861Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}