{"record":{"id":"4530edba746554de","repo":"risingwavelabs/risingwave","slug":"build-schema-registry-client-error-0","errorCode":null,"errorMessage":"build schema registry client error: {0}","messagePattern":"build schema registry client error: (.+?)","errorType":"exception","errorClass":"SchemaRegistryClientError::Build","httpStatus":null,"severity":"error","filePath":"src/connector/src/schema/schema_registry/client.rs","lineNumber":134,"sourceCode":"\n#[derive(Debug, thiserror::Error)]\n#[error(\"all request confluent registry all timeout, {context}\\n{}\", errs.iter().map(|e| format!(\"\\t{}\", e.as_report())).join(\"\\n\"))]\npub struct ConcurrentRequestError {\n    errs: Vec<itertools::Either<RequestError, tokio::task::JoinError>>,\n    context: String,\n}\n\ntype SrResult<T> = Result<T, ConcurrentRequestError>;\n\n#[derive(thiserror::Error, Debug)]\npub enum SchemaRegistryClientError {\n    #[error(transparent)]\n    InvalidOption(#[from] InvalidOptionError),\n    #[error(\"read ca file error: {0}\")]\n    ReadFile(#[source] std::io::Error),\n    #[error(\"parse ca file error: {0}\")]\n    ParsePem(#[source] reqwest::Error),\n    #[error(\"build schema registry client error: {0}\")]\n    Build(#[source] reqwest::Error),\n}\n\nimpl TryFrom<&ConfluentSchemaRegistryConnection> for Client {\n    type Error = InvalidOptionError;\n\n    fn try_from(value: &ConfluentSchemaRegistryConnection) -> Result<Self, Self::Error> {\n        let urls = handle_sr_list(value.url.as_str())?;\n\n        Client::new(\n            urls,\n            &SchemaRegistryConfig {\n                username: value.username.clone(),\n                password: value.password.clone(),\n                ..Default::default()\n            },\n        )\n        .map_err(|e| match e {","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/schema/schema_registry/client.rs#L116-L152","documentation":"SchemaRegistryClientError::Build is returned when reqwest fails to construct the HTTP client for the schema registry, wrapping the underlying reqwest::Error. After reading and parsing certificates and applying TLS/auth settings, reqwest::ClientBuilder::build() failed — typically a TLS backend initialization problem.","triggerScenarios":"Client construction via TryFrom<&ConfluentSchemaRegistryConnection> when the final reqwest ClientBuilder::build() call errors, e.g. invalid TLS configuration after adding the CA cert, or the TLS backend cannot be initialized in the environment.","commonSituations":"Corrupt or incompatible CA cert combined with the TLS backend, missing OpenSSL/rustls system dependencies in the container, or conflicting TLS options.","solutions":["Check that the CA cert is valid PEM (see ParsePem fix) — invalid TLS input is the most common cause.","Ensure the container has the TLS runtime deps (ca-certificates, openssl libs) installed.","Try building the client without the custom CA to isolate whether TLS config is the trigger.","Update/verify the RisingWave build's TLS feature setup if reproducing locally."],"exampleFix":"// before: invalid cert -> build fails\nlet mut builder = reqwest::Client::builder();\nbuilder = builder.add_root_certificate(Certificate::from_pem(&bad_pem)?);\n// after: validate PEM before adding\nlet cert = reqwest::Certificate::from_pem(&pem).expect(\"valid PEM cert\");\nlet client = reqwest::Client::builder().add_root_certificate(cert).build()?;","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match build_client(conn) {\n    Ok(c) => c,\n    Err(SchemaRegistryClientError::Build(e)) => {\n        eprintln!(\"reqwest client build failed: {}\", e); return Err(e.into());\n    }\n    Err(e) => return Err(e.into()),\n}","preventionTips":["Keep TLS runtime deps (ca-certificates, openssl) present in images.","Validate CA certs before passing them to the client builder.","Avoid mixing conflicting TLS options; test client construction in CI.","Pin/verify reqwest TLS feature flags consistent with the runtime environment."],"tags":["tls","http-client","schema-registry"],"backgroundTag":"http-request-failed","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"}