{"record":{"id":"8e1ef93468f5af98","repo":"Morganamilo/paru","slug":"config-file-does-not-exist","errorCode":null,"errorMessage":"config file '{}' does not exist","messagePattern":"config file '(.+?)' does not exist","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/config.rs","lineNumber":633,"sourceCode":"            cache_dir,\n            state_dir,\n            devel_path,\n            ..Self::default()\n        };\n\n        if let Some(old) = old {\n            if let Ok(devel) = OpenOptions::new().read(true).open(old) {\n                if let Ok(devel) = serde_json::from_reader(devel) {\n                    save_devel_info(&config, &devel)?;\n                    let _ = remove_file(&old_devel_path);\n                    let _ = remove_file(&old_old_devel_path);\n                }\n            }\n        }\n\n        if let Ok(conf) = var(\"PARU_CONF\") {\n            let path = PathBuf::from(conf);\n            ensure!(\n                path.exists(),\n                tr!(\"config file '{}' does not exist\", path.display())\n            );\n            config.config_path = Some(path);\n        } else if config_path.exists() {\n            config.config_path = Some(config_path);\n        } else {\n            let config_path = PathBuf::from(\"/etc/paru.conf\");\n\n            if config_path.exists() {\n                config.config_path = Some(config_path);\n            }\n        }\n\n        Ok(config)\n    }\n\n    pub fn set_op_args_globals(&mut self, op: Op) {","sourceCodeStart":615,"sourceCodeEnd":651,"githubUrl":"https://github.com/Morganamilo/paru/blob/9ac3578807a87858651e81a02586ceb947686e7c/src/config.rs#L615-L651","documentation":"During config load, if the PARU_CONF environment variable is set, paru requires the path it points to to exist; otherwise it errors with this message including the path. This lets users override the config location explicitly, but a stale or misspelled PARU_CONF is a hard failure.","triggerScenarios":"Running paru with PARU_CONF set to a path that does not exist on disk (typo, deleted file, path from another machine/container).","commonSituations":"Shell profile exporting PARU_CONF to an old config location; container images copying config to a different path than the env var says; test scripts pointing PARU_CONF at temp files that were cleaned up.","solutions":["Check `echo $PARU_CONF` and `ls` the path; correct or unset the variable (`unset PARU_CONF`).","Create the config file at the referenced path or move the existing paru.conf there.","Update any shell profile / service unit that exports a stale PARU_CONF."],"exampleFix":"# before\nPARU_CONF=/old/location/paru.conf paru -Syu   # does not exist\n# after\nunset PARU_CONF\n# or\nexport PARU_CONF=$HOME/.config/paru/paru.conf","handlingStrategy":"validation","validationCode":"if let Ok(conf) = std::env::var(\"PARU_CONF\") {\n    let p = std::path::PathBuf::from(&conf);\n    if !p.exists() {\n        eprintln!(\"PARU_CONF points to missing file: {}; unsetting\", conf);\n        std::env::remove_var(\"PARU_CONF\");\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only set PARU_CONF in shell profiles you control and keep the target file in sync.","Guard container entrypoints: verify the PARU_CONF path exists before exec.","Clean up temp-config scripts that export PARU_CONF."],"tags":["config","environment","file"],"backgroundTag":"config-file-not-found","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"}