{"record":{"id":"2fb61269df14dc94","repo":"linera-io/linera-protocol","slug":"fail-to-read-server-config","errorCode":null,"errorMessage":"Fail to read server config","messagePattern":"Fail to read server config","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"linera-service/src/proxy/main.rs","lineNumber":619,"sourceCode":"\n        if let Some(threads) = options.tokio_threads {\n            builder.worker_threads(threads);\n        }\n\n        builder\n    };\n\n    if let Some(blocking_threads) = options.tokio_blocking_threads {\n        runtime.max_blocking_threads(blocking_threads);\n    }\n\n    runtime.enable_all().build()?.block_on(options.run())\n}\n\nimpl ProxyOptions {\n    async fn run(&self) -> Result<()> {\n        let server_config: ValidatorServerConfig =\n            util::read_json(&self.config_path).expect(\"Fail to read server config\");\n        let public_key = &server_config.validator.public_key;\n        linera_service::tracing::opentelemetry::init(\n            &format!(\"validator-{public_key}-proxy\"),\n            self.otlp_exporter_endpoint.as_deref(),\n        );\n\n        let store_config = self\n            .storage_config\n            .add_common_storage_options(&self.common_storage_options)?;\n        let cache_sizes = self.common_storage_options.storage_cache_config();\n        // Proxies are part of validator infrastructure and should not output contract logs.\n        let allow_application_logs = false;\n        store_config\n            .run_with_storage(\n                None,\n                allow_application_logs,\n                cache_sizes,\n                ProxyContext::from_options(self)?,","sourceCodeStart":601,"sourceCodeEnd":637,"githubUrl":"https://github.com/linera-io/linera-protocol/blob/6c226ddcb332ef55118dc8d0aafbd093d5420899/linera-service/src/proxy/main.rs#L601-L637","documentation":"The validator proxy's run() loads its ValidatorServerConfig with util::read_json(&self.config_path).expect(\"Fail to read server config\"). The panic fires when the config file cannot be opened or its JSON cannot be deserialized into ValidatorServerConfig, before the proxy starts serving.","triggerScenarios":"Launching linera-proxy with a --config path that does not exist, is not readable, contains invalid JSON, or has a ValidatorServerConfig schema mismatch (missing validator section, wrong key names for the installed version).","commonSituations":"First-time proxy deployment where the config was never generated; path typos or running from a different working directory with a relative path; config written for an older/newer Linera version after upgrade; file ownership issues under systemd/container users.","solutions":["Confirm the file exists and is readable at the exact path passed to the proxy (use absolute paths in systemd units)","Validate the JSON (jq . config.json) and diff its structure against a freshly generated ValidatorServerConfig for your version","Regenerate the server config with the proxy's generate/setup flow for the current version rather than hand-editing an old file","Check file permissions/ownership for the service user running the proxy"],"exampleFix":"# before\nlinera-proxy --config config.json   # relative path, wrong cwd\n\n# after\njq . /etc/linera/proxy/server.json   # valid JSON + schema\nlinera-proxy --config /etc/linera/proxy/server.json","handlingStrategy":"validation","validationCode":"# Systemd-style pre-flight for the proxy config.\nExecStartPre=/bin/sh -c 'test -r /etc/linera/proxy/server.json && jq -e .validator.public_key /etc/linera/proxy/server.json > /dev/null'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use absolute config paths in unit files and container commands","Generate configs with the current version's tooling; do not hand-merge old JSON","Add a pre-start validation step so failures produce actionable logs instead of a Rust panic","Mount configs read-only and verify ownership for the service user"],"tags":["linera","proxy","validator","config-file","json","startup"],"backgroundTag":"config-file-invalid","analyzedSha":"6c226ddcb332ef55118dc8d0aafbd093d5420899","analyzedAt":"2026-08-22T22:49:09.787Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}