{"record":{"id":"5c716c04c84e1c1e","repo":"neondatabase/neon","slug":"could-not-open-config-file-at-path","errorCode":null,"errorMessage":"could not open config file at path: {}","messagePattern":"could not open config file at path: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"compute_tools/src/configurator.rs","lineNumber":89,"sourceCode":"                    info!(\n                        \"reloading config.json from path: {}\",\n                        config_path.to_string_lossy()\n                    );\n                    let path = Path::new(config_path);\n                    if let Ok(file) = File::open(path) {\n                        match serde_json::from_reader::<File, ComputeConfig>(file) {\n                            Ok(config) => Ok(config),\n                            Err(e) => {\n                                error!(\"could not parse config file: {}\", e);\n                                Err(anyhow::anyhow!(\"could not parse config file: {}\", e))\n                            }\n                        }\n                    } else {\n                        error!(\n                            \"could not open config file at path: {:?}\",\n                            config_path.to_string_lossy()\n                        );\n                        Err(anyhow::anyhow!(\n                            \"could not open config file at path: {}\",\n                            config_path.to_string_lossy()\n                        ))\n                    }\n                } else if let Some(control_plane_uri) = &compute.params.control_plane_uri {\n                    get_config_from_control_plane(control_plane_uri, &compute.params.compute_id)\n                } else {\n                    Err(anyhow::anyhow!(\"config_path_test_only is not set\"))\n                };\n\n            // Parse any received ComputeSpec and transpose the result into a Result<Option<ParsedSpec>>.\n            let parsed_spec_result: Result<Option<ParsedSpec>> =\n                get_config_result.and_then(|config| {\n                    if let Some(spec) = config.spec {\n                        if let Ok(pspec) = ParsedSpec::try_from(spec) {\n                            Ok(Some(pspec))\n                        } else {\n                            Err(anyhow::anyhow!(\"could not parse spec\"))","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/neondatabase/neon/blob/8f60b04da47ffefe0e52bda2440134b42874eb75/compute_tools/src/configurator.rs#L71-L107","documentation":"The test-only config loader could not even open the file at params.config_path_test_only: File::open failed (usually ENOENT - no such file, or EACCES - permission denied inside the container). Distinguished from error 13, which is opened-but-unparseable. Only reachable when config_path_test_only is set; production fetches config from the control plane.","triggerScenarios":"compute_ctl started with a config path that does not exist in the container (wrong volume mount, relative path resolved against an unexpected cwd), or a file with permissions the runtime user cannot read.","commonSituations":"Docker/K8s volume not mounted at the expected path; typo in the --config-path-test-only value; path from a host build leaked into the container; file owned by root with 0600 while compute_ctl runs as non-root; CI checkout layout changed.","solutions":["Verify the exact path exists from inside the same container/user: ls -l <path>","Use an absolute path; check volume mounts and their subPaths if running in K8s","chmod/chown the file so the runtime user can read it","Confirm you actually meant the test path; in production you want control_plane_uri instead"],"exampleFix":"# before: relative or wrong path -> could not open config file\n--config-path-test-only config.json\n# after\n--config-path-test-only /etc/neon/config.json   # mounted, readable, absolute","handlingStrategy":"validation","validationCode":"// Pre-flight the test config path before startup\nlet p = std::path::Path::new(&config_path);\nif !p.is_file() { anyhow::bail!(\"config file {p:?} does not exist\"); }\nif !p.metadata()?.permissions().readonly() { /* at least readable check */ }","typeGuard":"fn config_file_readable(path: &Path) -> bool {\n    path.is_file() && std::fs::File::open(path).is_ok()\n}","tryCatchPattern":null,"preventionTips":["Always pass absolute paths for --config-path-test-only","Smoke-test container mounts: assert the file exists in the entrypoint before exec'ing compute_ctl","Run compute_ctl as the same user that owns the config file, or chmod 0644"],"tags":["rust","compute-ctl","config","file-io","path","test-only"],"backgroundTag":"file-not-found","analyzedSha":"8f60b04da47ffefe0e52bda2440134b42874eb75","analyzedAt":"2026-08-16T23:39:28.135Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}