2

我正在尝试将 DBT 与 AWS MWAA 集成,但出现以下错误:

2021-09-06 07:04:31,290] {{dbt_hook.py:117}} INFO - /usr/local/airflow/.local/bin/dbt run --profiles-dir /usr/local/airflow/dags/dbt/
[2021-09-06 07:04:31,326] {{dbt_hook.py:126}} INFO - Output:
[2021-09-06 07:04:33,280] {{dbt_hook.py:130}} INFO - Running with dbt=0.20.1
[2021-09-06 07:04:35,416] {{dbt_hook.py:130}} INFO - Encountered an error:
[2021-09-06 07:04:35,450] {{dbt_hook.py:130}} INFO - [Errno 30] Read-only file system: 'target/partial_parse.msgpack'
[2021-09-06 07:04:35,636] {{dbt_hook.py:134}} INFO - Command exited with return code 2

我的达格是:

from airflow import DAG
from airflow_dbt.operators.dbt_operator import (
    DbtSeedOperator,
    DbtSnapshotOperator,
    DbtRunOperator,
    DbtTestOperator
)
from airflow.utils.dates import days_ago


default_args = {
    'start_date': days_ago(0)
}

with DAG(dag_id='dbt_snow', default_args=default_args, schedule_interval='@daily') as dag:
    dbt_run = DbtRunOperator(
        task_id='dbt_run',
        dbt_bin='/usr/local/airflow/.local/bin/dbt',
        profiles_dir='/usr/local/airflow/dags/dbt/',
        dir='/usr/local/airflow/dags/dbt/learn/'
    )

我正在使用提供的插件:

https://github.com/gocardless/airflow-dbt

https://pypi.org/project/airflow-dbt/

https://docs.getdbt.com/docs/running-a-dbt-project/running-dbt-in-production#using-airflow

我尝试通过将配置添加到 false 来删除部分解析,即使这样我也收到了这个错误。

关于如何解决它的任何指针。

4

1 回答 1

0

将目标和日志位置更改为以下使其工作:

/usr/local/airflow/dags/dbt/ 

因此,我们需要根据需要将它们运回。

于 2021-09-08T00:29:40.573 回答