{"record":{"id":"bdd9f9077635ca44","repo":"risingwavelabs/risingwave","slug":"schema-from-url-not-valid-json","errorCode":null,"errorMessage":"schema from {url} not valid JSON","messagePattern":"schema from (.+?) not valid JSON","errorType":"error_code","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/connector/codec/src/decoder/json/mod.rs","lineNumber":61,"sourceCode":"use serde_json::Value;\nuse thiserror::Error;\nuse url::Url;\n\nuse super::avro::{MapHandling, avro_schema_to_fields};\n\n#[derive(Debug, Error, thiserror_ext::ContextInto)]\npub enum Error {\n    #[error(\"could not open schema from {filename}\")]\n    SchemaFromFile {\n        filename: String,\n        source: std::io::Error,\n    },\n    #[error(\"parse error for url {url}\")]\n    UrlParse {\n        url: String,\n        source: url::ParseError,\n    },\n    #[error(\"schema from {url} not valid JSON\")]\n    SchemaNotJson { url: String, source: std::io::Error },\n    #[error(\"request error\")]\n    Request { url: String, source: reqwest::Error },\n    #[error(\"schema from {url} not valid JSON\")]\n    SchemaNotJsonSerde {\n        url: String,\n        source: serde_json::Error,\n    },\n    #[error(\n        \"ref `{ref_string}` cannot be resolved as a pointer, and `{ref_fragment}` cannot be found in the schema\"\n    )]\n    JsonRefPointerNotFound {\n        ref_string: String,\n        ref_fragment: String,\n    },\n    #[error(\"json ref error\")]\n    JsonRef {\n        #[from]","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/codec/src/decoder/json/mod.rs#L43-L79","documentation":"Error::SchemaNotJson wraps a std::io::Error and reports that the document fetched from {url} is not valid JSON. Despite the io::Error source type, the message indicates the response body could not be parsed as JSON during read-to-string/parse handling.","triggerScenarios":"Fetching a JSON schema from a file or URL whose body is HTML (error page), plain text, empty, or otherwise not JSON, and reading/parsing it via IO-based code paths.","commonSituations":"Schema registry URL returning an HTML 404/error page; pointing at a YAML or Avro (IDL) schema file; proxy captive portal responses; wrong registry endpoint.","solutions":["Open the URL in a browser or curl it and confirm the body is valid JSON.","Point the schema location at the correct registry subject/version endpoint.","Check for proxy/firewall interception returning HTML instead of the schema."],"exampleFix":"// before\nschema.location = 'http://registry:8081/schemas/ids/1'  // returns HTML error page\n// after\nschema.location = 'http://registry:8081/subjects/my-topic-value/versions/1/schema'","handlingStrategy":"validation","validationCode":"const body = await fetch(url).then(r => r.text());\nJSON.parse(body); // throws early if the endpoint returns non-JSON","typeGuard":null,"tryCatchPattern":"match result {\n  Err(Error::SchemaNotJson { url, .. }) => log::error!(\"non-JSON body from {url}; check the endpoint\"),\n  other => other?,\n}","preventionTips":["curl the schema URL once and confirm the body starts with '{' before wiring it up.","Beware HTML error pages from misconfigured registries or proxies.","Point at schema endpoints (e.g. /subjects/x/versions/1/schema) rather than UI pages."],"tags":["json","parsing","schema"],"backgroundTag":"json-parse-error","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"}