{"record":{"id":"6c41648f18f92291","repo":"risingwavelabs/risingwave","slug":"malformed-response-message","errorCode":null,"errorMessage":"Malformed response: {message}","messagePattern":"Malformed response: (.+?)","errorType":"exception","errorClass":"MalformedResponseError","httpStatus":null,"severity":"error","filePath":"src/connector/src/schema/mod.rs","lineNumber":40,"sourceCode":"pub use loader::{ConfluentSchemaLoader, SchemaLoader, SchemaVersion};\n\nconst MESSAGE_NAME_KEY: &str = \"message\";\nconst KEY_MESSAGE_NAME_KEY: &str = \"key.message\";\nconst SCHEMA_LOCATION_KEY: &str = \"schema.location\";\nconst SCHEMA_REGISTRY_KEY: &str = \"schema.registry\";\nconst NAME_STRATEGY_KEY: &str = \"schema.registry.name.strategy\";\npub const AWS_GLUE_SCHEMA_ARN_KEY: &str = \"aws.glue.schema_arn\";\n\n#[derive(Debug, thiserror::Error, thiserror_ext::Macro)]\n#[error(\"Invalid option: {message}\")]\npub struct InvalidOptionError {\n    pub message: String,\n    // #[backtrace]\n    // source: Option<risingwave_common::error::BoxedError>,\n}\n\n#[derive(Debug, thiserror::Error, thiserror_ext::Macro)]\n#[error(\"Malformed response: {message}\")]\npub struct MalformedResponseError {\n    pub message: String,\n}\n\n#[derive(Debug, thiserror::Error)]\npub enum SchemaFetchError {\n    #[error(transparent)]\n    InvalidOption(#[from] InvalidOptionError),\n    #[error(transparent)]\n    License(#[from] risingwave_common::license::FeatureNotAvailable),\n    #[error(transparent)]\n    Request(#[from] schema_registry::ConcurrentRequestError),\n    #[error(transparent)]\n    AwsGlue(#[from] Box<aws_sdk_glue::operation::get_schema_version::GetSchemaVersionError>),\n    #[error(transparent)]\n    MalformedResponse(#[from] MalformedResponseError),\n    #[error(\"schema version id invalid: {0}\")]\n    InvalidUuid(#[from] uuid::Error),","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/schema/mod.rs#L22-L58","documentation":"MalformedResponseError indicates a schema registry (Confluent/Glue) response arrived but could not be decoded into the expected structure — wrong content type, unexpected JSON shape, or missing fields.","triggerScenarios":"The HTTP response body from the schema registry cannot be deserialized into the expected schema/model type; raised via thiserror::Macro when parsing registry responses.","commonSituations":"Pointing schema.registry at a non-registry service (proxy returning HTML error pages); an incompatible registry version returning a different JSON shape; auth middleware returning HTML login pages with 200.","solutions":["Verify schema.registry points to a real Confluent Schema Registry endpoint (curl /subjects).","Inspect the raw response — remove proxies/auth layers that return HTML or unexpected bodies.","Upgrade/downgrade RisingWave if the registry version changed its API response format."],"exampleFix":"// before\nWITH (schema.registry = 'http://localhost:8080') // points to Kafka, not registry\n// after\nWITH (schema.registry = 'http://localhost:8081')","handlingStrategy":"try-catch","validationCode":"// preflight: registry must return JSON on /subjects\ncurl -fsS -H 'Accept: application/vnd.schemaregistry.v1+json' http://registry:8081/subjects","typeGuard":null,"tryCatchPattern":"match fetch_schema() {\n    Err(e) if e.to_string().starts_with(\"Malformed response\") => {\n        // verify endpoint is a real schema registry; inspect raw body\n    }\n    Err(e) => return Err(e.into()),\n    Ok(s) => s,\n}","preventionTips":["Verify registry endpoints with curl before configuring sources.","Ensure auth proxies return JSON/401, not HTML pages.","Pin registry version compatible with RisingWave."],"tags":["schema-registry","http","response-parsing"],"backgroundTag":"unexpected-response-shape","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"}