dbt-labs/dbt-core · error

catalog_relation.supports_create_or_replace() is only availa

Error message

catalog_relation.supports_create_or_replace() is only available under catalogs v2

What it means

This error is returned by the minijinja `call_method` dispatch on the catalog relation object when a template invokes the `supports_create_or_replace` macro/method while the catalogs v2 feature flag is disabled (`fetch_use_catalogs_v2()` returns false). It is a generic capability guard: the method only exists under catalogs v2, so any call that reaches this branch means the environment lacks the v2 catalogs runtime, and the unsupported invocation is surfaced as a minijinja error rather than a real answer.

Source

Thrown at crates/dbt-adapter/src/catalog_relation.rs:1717

            _ => Value::from(()),
        })
    }

    fn call_method(
        self: &Arc<Self>,
        _state: &minijinja::State<'_, '_>,
        name: &str,
        _args: &[Value],
        _listeners: &[std::rc::Rc<dyn minijinja::listener::RenderingEventListener>],
    ) -> Result<Value, minijinja::Error> {
        match name {
            "supports_create_or_replace" => {
                if load_catalogs::fetch_use_catalogs_v2() {
                    Ok(self.gate_by_adapter(vec![AdapterType::Databricks], || {
                        Value::from(self.supports_create_or_replace())
                    }))
                } else {
                    Err(minijinja::Error::new(
                        minijinja::ErrorKind::InvalidOperation,
                        "catalog_relation.supports_create_or_replace() is only available under catalogs v2",
                    ))
                }
            }
            _ => Err(minijinja::Error::new(
                minijinja::ErrorKind::UnknownMethod,
                format!("Unknown method on CatalogRelation: '{name}'"),
            )),
        }
    }

    fn render(self: &Arc<Self>, f: &mut Formatter<'_>) -> std::fmt::Result {
        write!(
            f,
            "CatalogRelation(catalog={}, integration={}, type={}, format={})",
            self.catalog_name.as_deref().unwrap_or("<none>"),
            self.integration_name.as_deref().unwrap_or("<none>"),

View on GitHub (pinned to 0267ce9170)

Solutions

  1. Enable the catalogs v2 feature flag so `fetch_use_catalogs_v2()` returns true and the method becomes available
  2. Remove or guard the `supports_create_or_replace()` call in the Jinja macro/template so it is only invoked when catalogs v2 is active
  3. Pass the capability down explicitly (e.g., via a variable set in the project/profile) instead of calling the gated method from the template
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/dbt-adapter/src/catalog_relation.rs:1717 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/ed4decf0cb07a5c0. Report an issue: GitHub.