You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
get_manifest_artifacts: Compilation Error in downstream project when upstream project adds versioning to public model referenced in intermediate project
#11032
Open
2 tasks done
taylorterwin opened this issue
Nov 21, 2024
· 3 comments
I have searched the existing issues, and I could not find an existing issue for this bug
Current Behavior
When adding a versioned model to Project A, whereas Project B references that model via cross-project ref, and Project C includes both Project A & Project B dependencies.yml we can confirm that Project C will error once Project A has deployed the version model change to production, but Project B has not yet reran the cross-project ref within Project B's production environment. This causes production runs to fail downstream, without having those dependencies included in the jobs, due to the publication artifact not being updated with the latest node.
We try to inject dependencies among public models in upstream projects, so that downstream projects can see if one of their upstream parents depends on another of their upstream parents
so a project that depends on two other projects (e.g. Project A + Project B) could see this error, even if it doesn't depend on either of those models directly -
and this error might happen if a public model that was an upstream dependency of another public model, has its access changed (no longer public) or is disabled/deleted/missing.
Expected Behavior
Options:
just fail silently, rather than raising an error
I think the risk of this approach is that we fail to find real node-level cycles across projects.
or
should we try to transform the public_model_dependency of proj_B.model_Y to match the latest version of proj_A.model_X, now that we know it's versioned?
Steps To Reproduce
Setup dependencies.yml in Project B as:
# dependencies.ymlprojects:
- name: project_a
create an xref model select * from {{ ref(project_a, model_x) }}
Ensure project_a model being xref'd access is public and run production build job for successful build.
Run project_b production build job including xref model.
in project_a, change xref'd model_x to specify version
# schema.yml exampleversion: 2models:
- name: my_first_dbt_modelaccess: publiclatest_version: 1description: "A starter dbt model"columns:
- name: iddescription: "The primary key for this table"tests:
- unique
- not_nullversions:
- v: 1
Commit, merge, and run project_a production build job to ensure versioned model is picked up.
Try running project_c production build job now and it will fail.
note: Running project_b production build job will update the manifest and grab the latest version/updated node, whereas then project_c production build will successfully complete without error.
I'm missing it in the description; is it necessary for there to be bidirectional dependencies to see the bug, or is it just transitive dependencies? The project graph you describe sounds like this to me;
flowchart LR
A --> B --> C
Loading
Where a model has versioning added in A, and the error appears in the build of C (until B has been rebuilt).
@schicks for the purpose of reproduction this was just A>B>C, however in the customer case where this was first reported it's several projects that all depend on each other. So it occurs in both.
@schicks Good callout. I don't think this is exclusive to bidirectional dependencies, but that setup does make it trickier to debug and "self-heal." In the A → B → C setup, project C stops seeing this error once project B has a successful run, (after A introduces versioning in the model).
jtcohen6
changed the title
get_manifest_artifacts: Compilation Error with bidirectional dependencies
get_manifest_artifacts: Compilation Error in downstream project when upstream project adds versioning to public model referenced in intermediate project
Nov 22, 2024
Is this a new bug in dbt-core?
Current Behavior
When adding a versioned model to Project A, whereas Project B references that model via cross-project ref, and Project C includes both Project A & Project B dependencies.yml we can confirm that Project C will error once Project A has deployed the version model change to production, but Project B has not yet reran the cross-project ref within Project B's production environment. This causes production runs to fail downstream, without having those dependencies included in the jobs, due to the publication artifact not being updated with the latest node.
We try to inject dependencies among public models in upstream projects, so that downstream projects can see if one of their upstream parents depends on another of their upstream parents
so a project that depends on two other projects (e.g. Project A + Project B) could see this error, even if it doesn't depend on either of those models directly -
and this error might happen if a public model that was an upstream dependency of another public model, has its access changed (no longer public) or is disabled/deleted/missing.
Expected Behavior
Options:
I think the risk of this approach is that we fail to find real node-level cycles across projects.
or
Steps To Reproduce
select * from {{ ref(project_a, model_x) }}
note: Running project_b production build job will update the manifest and grab the latest version/updated node, whereas then project_c production build will successfully complete without error.
Relevant log output
Environment
- dbt: versionless
Which database adapter are you using with dbt?
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: