{"record":{"id":"d42d61e8fc27aaa1","repo":"risingwavelabs/risingwave","slug":"could-not-open-schema-from-filename","errorCode":null,"errorMessage":"could not open schema from {filename}","messagePattern":"could not open schema from (.+?)","errorType":"error_code","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/connector/codec/src/decoder/json/mod.rs","lineNumber":51,"sourceCode":"// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\nuse std::collections::HashMap;\nuse std::fs;\n\nuse anyhow::{Context, anyhow};\nuse risingwave_common::catalog::Field;\nuse risingwave_common::util::panic::rw_catch_unwind;\nuse 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    },","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/codec/src/decoder/json/mod.rs#L33-L69","documentation":"Error::SchemaFromFile from the JSON decoder error enum wraps a std::io::Error that occurred while opening/reading the schema file. The thiserror_ext::ContextInto derive formats it as \"could not open schema from {filename}\". It means the file path could not be opened (missing file, permission, IO failure).","triggerScenarios":"Loading a JSON schema via a file:// URL where std::fs::File::open fails: path does not exist, no read permission, path is a directory, or other OS-level IO error.","commonSituations":"Typo in schema file path in the source config; file deleted or moved after config was written; container image lacking the schema file; permission differences between dev and prod environments.","solutions":["Check the filename in the error for typos and verify the path exists relative to the RisingWave process working directory.","Mount or copy the schema file into the container / environment where RisingWave runs.","Fix file permissions so the process user can read the file.","Prefer an http(s):// schema URL if the file lives elsewhere."],"exampleFix":"// before\nschema.location = 'file:///etc/risingwave/schema.json'  // file absent in container\n// after\ncopy schema.json into the image and use 'file:///risingwave/schema.json', or use an http URL the cluster can reach","handlingStrategy":"try-catch","validationCode":"const fs = require('fs');\nif (!fs.existsSync(path) || !fs.statSync(path).isFile()) {\n  throw new Error(`schema file not accessible: ${path}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  let schema = load_schema_from_file(url);\n} catch (e) if e.downcast_ref::<Error>() == Some(&Error::SchemaFromFile { .. }) {\n  eprintln!(\"check schema file path/mount: {e}\");\n}","preventionTips":["Bake schema files into the image or mount them explicitly; never rely on host-local paths.","Use absolute paths to avoid working-directory surprises.","Smoke-test schema loading at deploy time before starting ingestion."],"tags":["io","file","json-schema"],"backgroundTag":"file-open-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"}