{"record":{"id":"23d5bbbba1add9bd","repo":"dbt-labs/dbt-core","slug":"remote-state-must-be-relationconfig","errorCode":null,"errorMessage":"remote_state must be RelationConfig","messagePattern":"remote_state must be RelationConfig","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-adapter/src/relation/relation_impl.rs","lineNumber":1291,"sourceCode":"            }\n            Bigquery => {\n                if remote_state_value.is_none() {\n                    return Err(minijinja::Error::new(\n                        minijinja::ErrorKind::InvalidArgument,\n                        \"remote_state cannot be None\",\n                    ));\n                }\n                let current_state = remote_state_value\n                    .as_object()\n                    .ok_or_else(|| {\n                        minijinja::Error::new(\n                            minijinja::ErrorKind::InvalidArgument,\n                            \"remote_state must be Object\",\n                        )\n                    })?\n                    .downcast_ref::<RelationConfig>()\n                    .ok_or_else(|| {\n                        minijinja::Error::new(\n                            minijinja::ErrorKind::InvalidArgument,\n                            \"remote_state must be RelationConfig\",\n                        )\n                    })?;\n\n                // TODO(serramatutu): minijinja_value_to_typed_struct does not work with\n                // references, so we have to clone the value here...\n                let local_config = minijinja_value_to_typed_struct::<InternalDbtNodeWrapper>(\n                    local_config_value.clone(),\n                )\n                .map_err(|e| {\n                    minijinja::Error::new(\n                        minijinja::ErrorKind::SerdeDeserializeError,\n                        format!(\"Failed to deserialize InternalDbtNodeWrapper: {e}\"),\n                    )\n                })?;\n                let local_config = match local_config {\n                    InternalDbtNodeWrapper::Model(model) => model,","sourceCodeStart":1273,"sourceCodeEnd":1309,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-adapter/src/relation/relation_impl.rs#L1273-L1309","documentation":"The remote_state argument passed to a config-changeset path is not a RelationConfig object — the downcast to the expected wrapper failed, so current-vs-desired state comparison cannot proceed. Distinct from the earlier 'remote_state cannot be None' check: here a value exists but has the wrong type.","triggerScenarios":"Thrown at crates/dbt-adapter/src/relation/relation_impl.rs:1291 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the RelationConfig produced by the adapter's describe/get_relation path","Don't substitute plain dicts or unrelated objects for remote_state","Type-check remote_state before invoking the changeset logic"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0267ce9170576975b76b64ce856b2e5848e96617","analyzedAt":"2026-09-07T21:53:39.732Z","contentChangedAt":"2026-09-07T21:53:39.732Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}