dbt-labs/dbt-core · error

V1_CATALOG_TYPES never maps a raw type string onto this…

Error message

V1_CATALOG_TYPES never maps a raw type string onto this variant

What it means

A documented-invariant guard inside validate_catalogs: the V1_CATALOG_TYPES mapping table can never produce this CatalogType variant from a raw type string, so reaching this branch means an enum variant was constructed programmatically through a v2-only path and then handed to v1 validation — an internal v1/v2 invariant violation, not bad user input.

Solutions

  1. Only construct this variant through catalogs-v2 parsing paths
  2. Extend V1_CATALOG_TYPES if v1 catalogs.yml must express this type
  3. Return a structured validation error instead of relying on the unreachable invariant
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at crates/dbt-schemas/src/schemas/dbt_catalogs.rs:1378 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of dbt-labs/dbt-core@0267ce9170 (2026-09-07). Data as JSON: /api/errors/66248a9b1b7fcffa. Report an issue: GitHub.

Appendix: source

Thrown at crates/dbt-schemas/src/schemas/dbt_catalogs.rs:1378

                        && *file_format != FileFormat::Delta
                    {
                        return err!(code => ErrorCode::InvalidConfig, hacky_yml_loc => Some(catalog.write_integrations.1.clone()),
                                "integration '{}': when table_format=iceberg, file_format must be 'delta'",
                                write_integration.integration_name);
                    }
                }

                CatalogType::HiveMetastore => {
                    if write_integration.adapter_properties.is_some() {
                        return err!(code => ErrorCode::InvalidConfig, hacky_yml_loc => Some(catalog.write_integrations.1.clone()),
                            "integration '{}': adapter_properties not allowed for hive_metastore",
                            write_integration.integration_name);
                    }
                }

                CatalogType::BiglakeMetastore => { /* no non-structural constraints */ }
                _ => {
                    unreachable!("V1_CATALOG_TYPES never maps a raw type string onto this variant")
                }
            }
        }
    }

    Ok(())
}

#[cfg(test)]
mod tests {
    use super::*;
    use dbt_yaml as yml;
    use std::path::Path;

    fn parse_view_and_validate(yaml: &str) -> FsResult<()> {
        let v: yml::Value = yml::from_str(yaml).unwrap();
        let v_span = v.span();
        let m = v.as_mapping().expect("top-level YAML must be a mapping");

View on GitHub (pinned to 0267ce9170)