Error in Cloud Composer with DBT where path /dbt_packages/dbt_utils/dbt_project.yml is not found

43 Views Asked by At

I'm trying to run a dag with some DbtTestOperator and DbtRunOperator but got an error as the dbt_packages is not in the repo bucket. Even though, I added the dbt_utils package in the file packages.yml the dag failed because of inexistent dbt_packages folder.

packages.yml

packages:
  - package: calogica/dbt_expectations
    version: [">=0.5.0", "<0.6.0"]
  - package: dbt-labs/dbt_utils
    version: 0.7.1

airflow logs

[2024-03-11, 11:28:13 UTC] {dbt_hook.py:126} INFO - Output:
[2024-03-11, 11:28:17 UTC] {dbt_hook.py:130} INFO - 11:28:17  Running with dbt=1.0.9
[2024-03-11, 11:28:17 UTC] {dbt_hook.py:130} INFO - 11:28:17  Encountered an error:
[2024-03-11, 11:28:17 UTC] {dbt_hook.py:130} INFO - Runtime Error
[2024-03-11, 11:28:17 UTC] {dbt_hook.py:130} INFO -   Failed to read package: Runtime Error
[2024-03-11, 11:28:17 UTC] {dbt_hook.py:130} INFO -     no dbt_project.yml found at expected path /home/airflow/gcs/dags/dbt_models/dbt_packages/dbt_utils/dbt_project.yml
[2024-03-11, 11:28:17 UTC] {dbt_hook.py:130} INFO - 
[2024-03-11, 11:28:17 UTC] {dbt_hook.py:130} INFO - Error encountered in /home/airflow/gcs/dags/dbt_models/dbt_packages/dbt_utils
[2024-03-11, 11:28:17 UTC] {dbt_hook.py:132} INFO - Command exited with return code 2
[2024-03-11, 11:28:17 UTC] {taskinstance.py:1904} ERROR - Task failed with exception

What action would resolve this issue ?

0

There are 0 best solutions below