{"record":{"id":"092783988d33e90f","repo":"dbt-labs/dbt-core","slug":"get-seed-file-path-failed-to-deserialize-dbtseed","errorCode":null,"errorMessage":"get_seed_file_path: Failed to deserialize DbtSeed: {e}","messagePattern":"get_seed_file_path: Failed to deserialize DbtSeed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-adapter/src/adapter/mod.rs","lineNumber":4231,"sourceCode":"            \"generate_unique_temporary_table_suffix\" => {\n                self.generate_unique_temporary_table_suffix(state, args)\n            }\n            // existing_columns: List[Column], model_columns: dict, model_constraints: List[dict]\n            \"parse_columns_and_constraints\" => self.parse_columns_and_constraints(state, args),\n            // sql: str\n            \"clean_sql\" => self.clean_sql(state, args),\n            \"get_seed_file_path\" => {\n                // model: dict (seed node)\n                let iter = ArgsIter::new(name, &[\"model\"], args);\n                let model = iter.next_arg::<Value>()?;\n                iter.finish()?;\n\n                // Extract seed file path from the model\n                // The seed file path is root_path + original_file_path\n                let seed =\n                    minijinja_value_to_typed_struct::<dbt_schemas::schemas::nodes::DbtSeed>(model)\n                        .map_err(|e| {\n                            minijinja::Error::new(\n                                minijinja::ErrorKind::SerdeDeserializeError,\n                                format!(\"get_seed_file_path: Failed to deserialize DbtSeed: {e}\"),\n                            )\n                        })?;\n\n                let root_path = seed.__seed_attr__.root_path.unwrap_or_default();\n                let original_file_path = &seed.__common_attr__.original_file_path;\n                let full_path = root_path.join(original_file_path);\n                Ok(Value::from(full_path.display().to_string()))\n            }\n            \"external_root\" => {\n                // (no args)\n                let iter = ArgsIter::new(name, &[], args);\n                iter.finish()?;\n                self.external_root(state)\n            }\n            \"external_write_options\" => self.external_write_options(state, args),\n            \"external_read_location\" => self.external_read_location(state, args),","sourceCodeStart":4213,"sourceCodeEnd":4249,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-adapter/src/adapter/mod.rs#L4213-L4249","documentation":"The `adapter.get_seed_file_path(model)` Jinja method deserializes the passed model dict into a typed `DbtSeed` struct via `minijinja_value_to_typed_struct`. When the model dict does not match the expected DbtSeed schema (missing or wrongly-typed attributes such as `root_path` or `original_file_path`), the serde deserialization fails and this `SerdeDeserializeError` is raised from crates/dbt-adapter/src/adapter/mod.rs:4231.","triggerScenarios":"Calling `adapter.get_seed_file_path(...)` from a Jinja macro with a Value that is not a well-formed seed node dict — e.g. passing a model (not a seed) node, a relation object, a hand-built dict missing `original_file_path`/`root_path`, or attributes of the wrong type (string where a path/list is expected).","commonSituations":"Custom materialization or seed macros that pass the wrong node to get_seed_file_path; cross-project macros written for a different dbt version where the node schema differs; manually constructed node dicts in tests; dispatch to a seed macro with a `model` context instead of `seed` context.","solutions":["Ensure the argument passed to `adapter.get_seed_file_path()` is the actual seed node dict (e.g. `this` or the seed model object), not a relation or config object.","Check the error's inner message `{e}` to see which field failed to deserialize; add that field (typically `original_file_path`, or `root_path`) to the dict with the correct type.","If constructing a dict by hand, build it from the real parsed node rather than a partial map.","If this comes from a custom/adapter macro, verify the adapter and dbt schema versions match — DbtSeed attributes may have changed between releases."],"exampleFix":"// before (Jinja)\n{% set path = adapter.get_seed_file_path(config.model) %}\n// after (pass the seed node itself)\n{% set path = adapter.get_seed_file_path(model) %}","handlingStrategy":"validation","validationCode":"{# Jinja: ensure the object looks like a seed node before dispatching #}\n{% if model is not mapping or 'original_file_path' not in model %}\n  {{ exceptions.raise_compiler_error(\"get_seed_file_path expects a seed node dict, got: \" ~ model) }}\n{% endif %}\n{% set path = adapter.get_seed_file_path(model) %}","typeGuard":"fn is_seed_node(v: &minijinja::Value) -> bool {\n    v.is_object() || (v.is_mapping() && v.get_attr(\"original_file_path\").is_defined())\n}","tryCatchPattern":"{# Jinja #}\n{% set path = adapter.get_seed_file_path(model) %}","preventionTips":["Always pass the parsed seed node (the `model`/`this` context object), never a hand-built dict or relation.","Verify node type before dispatch (e.g. `model.resource_type == 'seed'`).","Keep adapter and dbt schema versions in sync; DbtSeed fields change between releases.","Read the inner serde message — it names the exact missing/mistyped attribute."],"tags":["jinja","serde","deserialization","seed"],"backgroundTag":"schema-validation-failed","analyzedSha":"0267ce9170576975b76b64ce856b2e5848e96617","analyzedAt":"2026-09-07T21:53:39.732Z","contentChangedAt":"2026-09-07T21:53:39.732Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}