{"record":{"id":"993cbca96d10116a","repo":"neondatabase/neon","slug":"supply-either-config-file-path-or-config-inline","errorCode":null,"errorMessage":"Supply either config file path or --config=inline-config","messagePattern":"Supply either config file path or --config=inline-config","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"endpoint_storage/src/main.rs","lineNumber":61,"sourceCode":"\n#[tokio::main]\nasync fn main() -> anyhow::Result<()> {\n    logging::init(\n        logging::LogFormat::Plain,\n        logging::TracingErrorLayerEnablement::EnableWithRustLogFilter,\n        logging::Output::Stdout,\n    )?;\n\n    let args = Args::parse();\n    let config: Config = if let Some(config_path) = args.config_file {\n        info!(\"Reading config from {config_path}\");\n        let config = std::fs::read_to_string(config_path)?;\n        serde_json::from_str(&config).context(\"parsing config\")?\n    } else if let Some(config) = args.config {\n        info!(\"Reading inline config\");\n        serde_json::from_str(&config).context(\"parsing config\")?\n    } else {\n        anyhow::bail!(\"Supply either config file path or --config=inline-config\");\n    };\n\n    info!(\"Reading pemfile from {}\", config.pemfile.clone());\n    let pemfile = std::fs::read(config.pemfile.clone())?;\n    info!(\"Loading public key from {}\", config.pemfile.clone());\n    let auth = endpoint_storage::JwtAuth::new(&pemfile)?;\n\n    let listener = tokio::net::TcpListener::bind(config.listen).await.unwrap();\n    info!(\"listening on {}\", listener.local_addr().unwrap());\n\n    let storage =\n        remote_storage::GenericRemoteStorage::from_storage_kind(config.storage_kind).await?;\n    let cancel = tokio_util::sync::CancellationToken::new();\n    if !args.no_s3_check_on_startup {\n        app::check_storage_permissions(&storage, cancel.clone()).await?;\n    }\n\n    let proxy = std::sync::Arc::new(endpoint_storage::Storage {","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/neondatabase/neon/blob/8f60b04da47ffefe0e52bda2440134b42874eb75/endpoint_storage/src/main.rs#L43-L79","documentation":"endpoint_storage's main() requires exactly one source of configuration: a positional config file path or --config=<inline JSON>. When neither is supplied, it bails with this message before binding its listener. The chosen string is parsed as JSON into Config (parsing failures surface as a separate 'parsing config' context error).","triggerScenarios":"Launching the endpoint_storage binary with no positional config file argument and no --config flag; passing only unrelated flags like --no-s3-check-on-startup (which itself requires --config).","commonSituations":"Kubernetes/helm chart misconfiguration dropping the args; running the binary by hand without reading usage; wrappers that quote away or drop the config argument.","solutions":["Pass a config file path as the positional argument: endpoint_storage /path/to/config.json","Or pass inline JSON: endpoint_storage --config='{\"pemfile\": ..., \"listen\": ..., \"storage_kind\": ...}'","Check the container command/args in the helm chart or unit file to confirm the argument actually reaches the process"],"exampleFix":"# before\n./endpoint_storage --no-s3-check-on-startup\n# after\n./endpoint_storage --config='{\"pemfile\":\"/certs/jwt.pem\",\"listen\":\"0.0.0.0:51243\",\"storage_kind\":{\"S3\":{\"bucket_name\":\"b\",\"bucket_region\":\"r\",\"prefix_in_bucket\":\"p\"}}}'","handlingStrategy":"validation","validationCode":"# shell wrapper: refuse to launch without config\nif [ -z \"$1\" ] && [ -z \"$ENDPOINT_STORAGE_CONFIG\" ]; then\n  echo \"error: supply a config file path or --config=INLINE_JSON\" >&2\n  exit 2\nfi\nexec ./endpoint_storage \"${1:-}\" ${ENDPOINT_STORAGE_CONFIG:+--config=$ENDPOINT_STORAGE_CONFIG}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Render the config argument in the chart/unit file once and test it with a dry run","Validate the JSON config in CI (parse it with the same serde types) before deploy"],"tags":["endpoint-storage","configuration","startup","cli","rust"],"backgroundTag":"missing-config","analyzedSha":"8f60b04da47ffefe0e52bda2440134b42874eb75","analyzedAt":"2026-08-16T23:39:28.135Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}