{"record":{"id":"10d0b7eb41024265","repo":"dbt-labs/dbt-core","slug":"failed-to-create-relations-from-nodes-10d0b7","errorCode":null,"errorMessage":"Failed to create relations from nodes","messagePattern":"Failed to create relations from nodes","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-main/src/compilation.rs","lineNumber":2772,"sourceCode":"        )\n        .chain(\n            resolved_state\n                .nodes\n                .sources\n                .values()\n                .map(|n| &n.__base_attr__),\n        )\n        .map(|base| {\n            Arc::from(\n                create_relation(\n                    resolved_state.adapter_type,\n                    base.database.clone(),\n                    base.schema.clone(),\n                    Some(base.alias.clone()),\n                    None,\n                    base.quoting,\n                )\n                .expect(\"Failed to create relations from nodes\"),\n            )\n        })\n        .collect::<Vec<_>>();\n    write_catalog_json(\n        &adapter,\n        resolved_state,\n        relations,\n        jinja_env.as_ref(),\n        project_name,\n        &base_context,\n        arg,\n        20,\n    )\n    .await\n}\n\n/// Check if a select expression matches any macro's file path.\n/// Returns the matched selector value if a macro was matched.","sourceCodeStart":2754,"sourceCodeEnd":2790,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-main/src/compilation.rs#L2754-L2790","documentation":"During `docs generate` catalog writing, relations are rebuilt from resolved manifest nodes (seeds/models/snapshots) via an adapter relation constructor, and any construction failure is turned into a panic with this message. It means one of the node's database/schema/alias/quoting components could not be turned into a valid relation by the adapter (e.g. an adapter that doesn't support the operation or an invalid identifier).","triggerScenarios":"Running `dbt docs generate` where `write_catalog_json` iterates `resolved_state` nodes and calls the adapter's relation constructor with a node whose database/schema/alias is None or invalid, or where the adapter returns Err (e.g. unsupported adapter feature or bad quoting config).","commonSituations":"Custom/partial adapters whose `relation_from_node`-style API returns Err; nodes with empty database or schema after profile changes; renamed quoting settings in dbt_project.yml/profile; stale resolved_state mixing adapters.","solutions":["Re-run `dbt docs generate` after a clean `dbt clean` + `dbt build` so resolved_state nodes have complete database/schema/alias","Verify the adapter crate is up to date and supports relation construction for your node types","Check profile/database/schema quoting configuration for empty or invalid identifiers","Run with RUST_BACKTRACE=1 to find which node fails and fix that node's config or database/schema"],"exampleFix":"// before\nBaseRelation::from(\n    adapter, base.database.clone(), base.schema.clone(), Some(base.alias.clone()), None, base.quoting,\n).expect(\"Failed to create relations from nodes\")\n// after: log node id and skip/fail with context\nlet relation = BaseRelation::from(...)\n    .map_err(|e| anyhow!(\"failed to build relation for node {}: {e}\", base.identifier))?;","handlingStrategy":"validation","validationCode":"// validate node identity parts before building relations\nfor node in nodes {\n    if node.database.is_none() || node.schema.is_none() || node.alias.is_none() {\n        return Err(format!(\"node {} missing database/schema/alias\", node.unique_id));\n    }\n}","typeGuard":null,"tryCatchPattern":"let relation = BaseRelation::from(...).map_err(|e| anyhow!(\"node {}: {e}\", node.unique_id))?;","preventionTips":["Run docs generate against a freshly built, complete manifest","Keep adapter crates updated and compatible","Validate quoting/database/schema settings in profile and dbt_project.yml"],"tags":["adapter","relation","docs-generate","panic"],"backgroundTag":"internal-invariant-violation","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"}