risingwavelabs/risingwave · error · AccessError

Undefined field ` ` at

Error message

Undefined field `{name}` at `{path}`

What it means

AccessError::Undefined is defined in src/connector/codec/src/decoder/mod.rs:28. It is thrown when a decoder/accessor tries to read a named field (e.g. accessing a column by name) that does not exist in the record's schema at the given path. It carries the missing field `name` and the `path` where the lookup happened.

Solutions

  1. Align the RisingWave table/source column definitions with the actual upstream payload fields (recreate the source with the correct schema)
  2. Check field name casing and exact spelling against the upstream schema
  3. Enable/use schema registry so the schema is fetched from the payload rather than hand-declared
  4. Handle the field as optional in the upstream producer so it is always present

Example fix

-- before
CREATE SOURCE s (user_id INTEGER, usr_name VARCHAR) ...;
-- after (field actually named 'user_name' in payload)
CREATE SOURCE s (user_id INTEGER, user_name VARCHAR) ...;
Defensive patterns

Strategy: try-catch

Validate before calling

fn validate_columns(payload_fields: &[&str], rw_columns: &[&str]) -> Vec<String> {
    rw_columns.iter()
        .filter(|c| !payload_fields.contains(c))
        .map(|c| c.to_string())
        .collect()
}

Try / catch

match accessor.access(record, "user_name") {
    Ok(v) => v,
    Err(AccessError::Undefined { name, path }) => {
        tracing::warn!(name, path, "missing field; using default");
        Datum::None
    }
    Err(e) => return Err(e.into()),
}

Prevention

When it happens

Trigger: Accessing `accessor.access(field_name, ...)` / record field access on a decoded payload where the field name is not present in the current schema object — e.g. a Protobuf/Avro/JSON accessor navigating into a nested object that lacks the expected field.

Common situations: Source schema (registered in RisingWave) drifted from the actual payload: upstream renamed or removed a field; column name casing mismatch (upstream uses camelCase, RW expects snake_case); reading a nested struct path where an intermediate value is a scalar.

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11). Data as JSON: /api/errors/4014300f9ea6925a. Report an issue: GitHub.

Appendix: source

Thrown at src/connector/codec/src/decoder/mod.rs:28

// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

pub mod avro;
pub mod json;
pub mod protobuf;
pub mod utils;

use risingwave_common::error::NotImplemented;
use risingwave_common::types::{DataType, Datum, DatumCow, ToOwnedDatum};
use thiserror::Error;
use thiserror_ext::Macro;

#[derive(Error, Debug, Macro)]
#[thiserror_ext(macro(mangle, path = "crate::decoder"))]
pub enum AccessError {
    #[error("Undefined field `{name}` at `{path}`")]
    Undefined { name: String, path: String },
    #[error("Cannot parse value `{value}` with type `{got}` into expected type `{expected}`")]
    TypeError {
        expected: String,
        got: String,
        value: String,
    },
    #[error("Unsupported data type `{ty}`")]
    UnsupportedType { ty: String },

    /// CDC auto schema change specific error that may include table context
    #[error("CDC auto schema change error: unsupported data type `{ty}` in table `{table_name}`")]
    CdcAutoSchemaChangeError { ty: String, table_name: String },

    #[error("Unsupported additional column `{name}`")]
    UnsupportedAdditionalColumn { name: String },

    #[error("Fail to convert protobuf Any into jsonb: {0}")]

View on GitHub (pinned to 6469eb736d)