{"record":{"id":"5515aef24e9fe4d0","repo":"risingwavelabs/risingwave","slug":"err-5515ae","errorCode":null,"errorMessage":"{err}","messagePattern":"\\{err\\}","errorType":"exception","errorClass":"SinkError::DorisStarrocksConnect","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/starrocks.rs","lineNumber":768,"sourceCode":"        // username & password may contain special chars, so we need to do URL encoding on them.\n        // Otherwise, Opts::from_url may report a `Parse error`\n        let user = form_urlencoded::byte_serialize(user.as_bytes()).collect::<String>();\n        let password = form_urlencoded::byte_serialize(password.as_bytes()).collect::<String>();\n\n        let conn_uri = format!(\n            \"mysql://{}:{}@{}:{}/{}?prefer_socket={}&max_allowed_packet={}&wait_timeout={}\",\n            user,\n            password,\n            host,\n            port,\n            db,\n            STARROCK_MYSQL_PREFER_SOCKET,\n            STARROCK_MYSQL_MAX_ALLOWED_PACKET,\n            STARROCK_MYSQL_WAIT_TIMEOUT\n        );\n        let pool = mysql_async::Pool::new(\n            Opts::from_url(&conn_uri)\n                .map_err(|err| SinkError::DorisStarrocksConnect(anyhow!(err)))?,\n        );\n        let conn = pool\n            .get_conn()\n            .await\n            .map_err(|err| SinkError::DorisStarrocksConnect(anyhow!(err)))?;\n\n        Ok(Self { table, db, conn })\n    }\n\n    pub async fn get_columns_from_starrocks(&mut self) -> Result<HashMap<String, String>> {\n        let query = format!(\n            \"select column_name, column_type from information_schema.columns where table_name = {:?} and table_schema = {:?};\",\n            self.table, self.db\n        );\n        let mut query_map: HashMap<String, String> = HashMap::default();\n        self.conn\n            .query_map(query, |(column_name, column_type)| {\n                query_map.insert(column_name, column_type)","sourceCodeStart":750,"sourceCodeEnd":786,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/starrocks.rs#L750-L786","documentation":"The StarRocks schema client failed to create a MySQL-protocol connection pool because `mysql_async::Opts::from_url` could not parse the provided connection URI, and the error is wrapped as `SinkError::DorisStarrocksConnect`. The URI comes from the sink's host/port/user/password configuration.","triggerScenarios":"Malformed or unsupported JDBC-style or URL-encoded connection string passed to the StarRocks sink (e.g. `jdbc:mysql://host:port/db` instead of a plain `mysql://` URL, missing scheme, invalid characters/credentials in URL).","commonSituations":"Users copying a JDBC URL from StarRocks docs into the sink's `starrocks.url`/host option; special characters in the password not percent-encoded; empty host.","solutions":["Use a `mysql://user:password@host:port/db` format URL (mysql_async supported format)","Percent-encode special characters (`@`, `:`, `/`) in user/password within the URL","If using a JDBC URL, strip the `jdbc:` prefix and translate parameters","Check host/port values are correct (default StarRocks FE query port 9030)"],"exampleFix":"// before\n'starrocks.url' = 'jdbc:mysql://fe:9030/db'\n// after\n'starrocks.url' = 'mysql://user:pass@fe:9030/db'","handlingStrategy":"validation","validationCode":"try {\n  new URL(\"mysql://user:pass@fe:9030/db\"); // mirror of Opts::from_url format\n} catch (e) {\n  throw \"starrocks.url must be mysql://user:pass@host:port/db\";\n}","typeGuard":null,"tryCatchPattern":"match err {\n  SinkError::DorisStarrocksConnect(e) => log(\"check connection URI format\", e),\n  other => return Err(other),\n}","preventionTips":["Use mysql:// URLs, never jdbc: URLs","Percent-encode credentials in URLs"],"tags":["starrocks","url","config","mysql"],"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-23T08:17:48.524Z"}