{"record":{"id":"9d21326b3cb9b61c","repo":"risingwavelabs/risingwave","slug":"schema-compilation-error-0","errorCode":null,"errorMessage":"schema compilation error: {0}","messagePattern":"schema compilation error: (.+?)","errorType":"exception","errorClass":"SchemaFetchError::SchemaCompile","httpStatus":null,"severity":"error","filePath":"src/connector/src/schema/mod.rs","lineNumber":59,"sourceCode":"pub 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),\n    #[error(\"schema compilation error: {0}\")]\n    SchemaCompile(\n        #[source]\n        #[backtrace]\n        risingwave_common::error::BoxedError,\n    ),\n    #[error(\"{0}\")] // source+{0} is effectively transparent but allows backtrace\n    YetToMigrate(\n        #[source]\n        #[backtrace]\n        ConnectorError,\n    ),\n    #[error(\"schema registry client error: {0}\")]\n    Client(#[from] schema_registry::SchemaRegistryClientError),\n}\n","sourceCodeStart":41,"sourceCodeEnd":74,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/schema/mod.rs#L41-L74","documentation":"SchemaFetchError::SchemaCompile carries a boxed error indicating the fetched schema (Protobuf/Avro/JSON) failed to compile or parse into a RisingWave schema — e.g. invalid .proto syntax, Avro schema that can't be processed, or unsupported schema constructs.","triggerScenarios":"A schema fetched from file/HTTP/S3/registry is syntactically invalid or uses features RisingWave's schema compiler doesn't accept, during source/materialized-view schema resolution.","commonSituations":"Malformed .proto files (missing syntax declaration, unresolved imports); Avro schemas with unsupported logical types; registry serving a schema incompatible with the embedded parser version.","solutions":["Validate the schema locally (protoc --descriptor_set_out for proto, avro tools for avro) before registering.","Fix syntax errors: add missing imports, 'syntax = \"proto3\";', correct types.","Simplify/remove schema features unsupported by RisingWave's compiler."],"exampleFix":"// before (schema.proto)\nmessage Event { required string id = 1; } // proto2 without syntax line\n// after\nsyntax = \"proto3\";\nmessage Event { string id = 1; }","handlingStrategy":"validation","validationCode":"// compile-check schemas before registering\n// protobuf:\n//   protoc --descriptor_set_out=/dev/null schema.proto\n// avro:\n//   avro-tools compile-schema schema.avsc","typeGuard":null,"tryCatchPattern":"match fetch_and_compile_schema() {\n    Err(e) if e.to_string().starts_with(\"schema compilation error\") => {\n        // fix .proto/.avsc per the inner error text, then retry\n    }\n    Err(e) => return Err(e.into()),\n    Ok(s) => s,\n}","preventionTips":["CI-validate schemas with protoc/avro-tools on every change.","Avoid schema features unsupported by RisingWave.","Use forward-compatible schema evolution practices."],"tags":["schema","protobuf","avro","compilation"],"backgroundTag":"schema-validation-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"}