{"record":{"id":"691a79628fab76d1","repo":"risingwavelabs/risingwave","slug":"json-ref-error","errorCode":null,"errorMessage":"json ref error","messagePattern":"json ref error","errorType":"error_code","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/connector/codec/src/decoder/json/mod.rs","lineNumber":77,"sourceCode":"        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]\n        source: std::io::Error,\n    },\n    #[error(\"need url to be a file or a http based, got {url}\")]\n    UnsupportedUrl { url: String },\n    #[error(transparent)]\n    Uncategorized(\n        #[from]\n        #[backtrace]\n        anyhow::Error,\n    ),\n}\n\ntype Result<T, E = Error> = std::result::Result<T, E>;\n\n#[derive(Debug)]\npub struct JsonRef {","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/codec/src/decoder/json/mod.rs#L59-L95","documentation":"Error::JsonRef wraps a std::io::Error (via #[from]) raised while resolving JSON schema $ref references. The message is generic; the underlying IO error (e.g. failing to read a referenced local file) carries the specifics.","triggerScenarios":"During $ref resolution the resolver performs IO (such as reading a referenced file) and the read fails, converting into this variant automatically via #[from].","commonSituations":"$ref pointing to a relative file path that cannot be opened from the process working directory; permission or missing-file errors during reference resolution.","solutions":["Inspect the chained io::Error source for the real cause (path, permissions).","Make all $ref targets resolvable within the single schema document (inline definitions).","Ensure any referenced files exist and are readable relative to the RisingWave process.","Use http-based schema URLs if references live remotely."],"exampleFix":"// before\n{\"$ref\": \"common_types.json#/Address\"}  // common_types.json not accessible\n// after\n{\"$ref\": \"#/definitions/Address\"} with Address inlined in the same document","handlingStrategy":"try-catch","validationCode":"const fs = require('fs');\nfor (const p of collectRefFilePaths(schema)) {\n  if (!fs.existsSync(p)) throw new Error(`$ref target file missing: ${p}`);\n}","typeGuard":null,"tryCatchPattern":"match res {\n  Err(Error::JsonRef { source }) => eprintln!(\"io failure during $ref resolution: {source}\"),\n  other => other?,\n}","preventionTips":["Inline all $ref targets so resolution never needs extra IO.","Ensure referenced files are readable by the RisingWave process user.","Prefer http(s) schema URLs over relative file references."],"tags":["io","json-schema","ref-resolution"],"backgroundTag":"file-read-failed","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T21:17:11.552Z"}