{"record":{"id":"8c6f41d03e94e770","repo":"risingwavelabs/risingwave","slug":"url-parse-error-e","errorCode":null,"errorMessage":"Url::parse error: {e}","messagePattern":"Url::parse error: (.+?)","errorType":"validation","errorClass":"SinkError","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/elasticsearch_opensearch/elasticsearch_opensearch_config.rs","lineNumber":205,"sourceCode":"        Ok(config)\n    }\n\n    pub fn build_client(&self, connector: &str) -> Result<ElasticSearchOpenSearchClient> {\n        let check_username_password = || -> Result<()> {\n            if self.username.is_some() && self.password.is_none() {\n                return Err(SinkError::Config(anyhow!(\n                    \"please set the password when the username is set.\"\n                )));\n            }\n            if self.username.is_none() && self.password.is_some() {\n                return Err(SinkError::Config(anyhow!(\n                    \"please set the username when the password is set.\"\n                )));\n            }\n            Ok(())\n        };\n        let url =\n            Url::parse(&self.url).map_err(|e| SinkError::ElasticSearchOpenSearch(anyhow!(e)))?;\n        if connector.eq(ES_SINK) {\n            let mut transport_builder = elasticsearch::http::transport::TransportBuilder::new(\n                elasticsearch::http::transport::SingleNodeConnectionPool::new(url),\n            );\n            if let Some(username) = &self.username\n                && let Some(password) = &self.password\n            {\n                transport_builder = transport_builder.auth(\n                    elasticsearch::auth::Credentials::Basic(username.clone(), password.clone()),\n                );\n            }\n            check_username_password()?;\n            let transport = transport_builder\n                .build()\n                .map_err(|e| SinkError::ElasticSearchOpenSearch(anyhow!(e)))?;\n            let client = elasticsearch::Elasticsearch::new(transport);\n            Ok(ElasticSearchOpenSearchClient::ElasticSearch(client))\n        } else if connector.eq(OPENSEARCH_SINK) {","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/elasticsearch_opensearch/elasticsearch_opensearch_config.rs#L187-L223","documentation":"build_client parses the configured `url` with the `url` crate before constructing the transport; a parse failure (missing scheme, invalid characters, empty string) is surfaced as SinkError::ElasticSearchOpenSearch with this message.","triggerScenarios":"The `url` option in the sink/connection config is malformed: missing http(s):// scheme, contains spaces or illegal characters, or is empty when the config is built.","commonSituations":"Forgetting the `http://`/`https://` prefix; trailing slashes with query fragments; hostnames with underscores; URL copied with surrounding quotes/spaces.","solutions":["Set `url` to a well-formed absolute URL like `http://localhost:9200` or `https://es.example.com:9243`.","Strip whitespace/quotes and drop any path suffixes like `/_bulk` — only the base URL is needed.","Check the full wrapped Url::parse error in the message for the exact character problem."],"exampleFix":"// before\n'url' = 'localhost:9200'\n// after\n'url' = 'http://localhost:9200'","handlingStrategy":"validation","validationCode":"-- sanity check the URL before creating the sink\nSELECT 'http://localhost:9200' = 'http://localhost:9200';\n-- or in shell:\n-- python3 -c \"from urllib.parse import urlparse; u=urlparse('http://localhost:9200'); assert u.scheme in ('http','https') and u.netloc\"","typeGuard":null,"tryCatchPattern":"match err { SinkError::ElasticSearchOpenSearch(e) if e.to_string().contains(\"Url::parse error\") => fix_url_scheme_and_recreate(), _ => return Err(err) }","preventionTips":["Always include the scheme: http:// or https://.","Use only the base URL — no /_bulk path, no spaces or quotes.","Test the URL with `curl <url>` from the RisingWave host first."],"tags":["elasticsearch","opensearch","url","config","validation"],"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"}