{"record":{"id":"cb2f51b9abdd51dc","repo":"risingwavelabs/risingwave","slug":"invalid-listen-address","errorCode":null,"errorMessage":"invalid listen address","messagePattern":"invalid listen address","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/meta/node/src/lib.rs","lineNumber":218,"sourceCode":"    )]\n    pub temp_secret_file_dir: String,\n\n    /// Address of the serverless backfill controller.\n    /// Needed if meta receives a streaming job with serverless backfill enabled.\n    /// Feature disabled by default.\n    #[clap(long, env = \"RW_SBC_ADDR\", default_value = \"\")]\n    pub serverless_backfill_controller_addr: String,\n}\n\nimpl risingwave_common::opts::Opts for MetaNodeOpts {\n    fn name() -> &'static str {\n        \"meta\"\n    }\n\n    fn meta_addr(&self) -> MetaAddressStrategy {\n        format!(\"http://{}\", self.listen_addr)\n            .parse()\n            .expect(\"invalid listen address\")\n    }\n}\n\nuse std::future::Future;\nuse std::pin::Pin;\nuse std::sync::Arc;\n\nuse risingwave_common::config::{MetaBackend, RwConfig, load_config};\nuse tracing::info;\n\n/// Start meta node\npub fn start(\n    opts: MetaNodeOpts,\n    shutdown: CancellationToken,\n) -> Pin<Box<dyn Future<Output = ()> + Send>> {\n    // WARNING: don't change the function signature. Making it `async fn` will cause\n    // slow compile in release mode.\n    Box::pin(async move {","sourceCodeStart":200,"sourceCodeEnd":236,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/meta/node/src/lib.rs#L200-L236","documentation":"RisingWave's MetaNodeOpts::meta_addr builds the meta node's advertised address by prefixing `http://` onto the configured `listen_addr` and parsing it into a URL. If `listen_addr` is not a valid `host:port` (or full URL) string, `.parse()` returns Err and the `.expect(\"invalid listen address\")` panics. It is a startup-time configuration sanity check: the process cannot advertise itself to peers without a parseable address.","triggerScenarios":"Calling `meta_addr()` (invoked during meta node startup via the `Opts` trait) when `--listen-addr`/`RW_LISTEN_ADDR` contains a malformed value such as an empty string, a bare hostname with no port, a value with an invalid port (e.g. `127.0.0.1:99999`), or characters not allowed in a URL authority.","commonSituations":"Typos in CLI flags or env files (e.g. `RW_LISTEN_ADDR=localhost:port`), template/CI variables left unexpanded (`${LISTEN_ADDR}`), empty string defaults, or copy-pasting an address including a scheme or path that breaks the `host:port` form.","solutions":["Set `--listen-addr` (or env `RW_LISTEN_ADDR`) to a valid `host:port` value, e.g. `127.0.0.1:5690`.","Check for empty or unexpanded shell/env variables in your launch script and quote/expand them correctly.","Remove any accidental scheme or path from the value; the code already prepends `http://`.","If the panic comes from programmatic use of `meta_addr`, validate/construct `listen_addr` with a SocketAddr parse before calling it."],"exampleFix":"// before\nRW_LISTEN_ADDR=\"${META_HOST}\"\n// after\nRW_LISTEN_ADDR=\"${META_HOST}:5690\"  # ensure host:port, e.g. 127.0.0.1:5690","handlingStrategy":"validation","validationCode":"fn validate_listen_addr(addr: &str) -> Result<(), String> {\n    if addr.trim().is_empty() {\n        return Err(\"listen address is empty\".into());\n    }\n    addr.parse::<std::net::SocketAddr>()\n        .map(|_| ())\n        .map_err(|e| format!(\"invalid listen address '{addr}': {e}\"))\n}","typeGuard":"fn is_valid_listen_addr(addr: &str) -> bool {\n    addr.parse::<std::net::SocketAddr>().is_ok()\n}","tryCatchPattern":null,"preventionTips":["Always set --listen-addr as explicit host:port (e.g. 0.0.0.0:5690); never rely on unexpanded env vars.","Smoke-test startup scripts by echoing resolved flag values before launching the binary.","Prefer SocketAddr validation in tooling/wrappers before spawning RisingWave.","Keep schemes and paths out of listen_addr values; the code prepends http:// itself."],"tags":["rust","config","startup","panic","address-parsing"],"backgroundTag":"invalid-url-format","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}