【发布时间】:2020-07-19 20:59:29
【问题描述】:
我不熟悉使用 Apache Airflow。 我的 dag 的一些操作员状态为失败。我试图了解错误的根源。
以下是问题的详细信息:
我的 dag 很大,它的某些部分是由子 dag 组成的。
我在 Composer UI 中注意到的是,失败的 Subdags 都在名为 download_file 的 task_id 中完成,它使用 XCom 和 GoogleCloudStorageDownloadOperator。
>> GoogleCloudStorageDownloadOperator(
task_id='download_file',
bucket="sftp_sef",
object="{{task_instance.xcom_pull(task_ids='find_file') | first }}",
filename="/home/airflow/gcs/data/zips/{{{{ds_nodash}}}}_{0}.zip".format(table)
)
上述 Subdag 中的日志没有显示任何有用的信息。
日志:
[2020-04-07 15:19:25,618] {models.py:1359} INFO - 依赖关系全部满足 对于 [2020-04-07 15:19:25,660] {models.py:1359} INFO - [2020-04-07 15:19:25,660] 的依赖项全部满足 {models.py:1577} 信息 -
----------------------------------------------- -------------------------------- 开始尝试第 10 次,共 1 次
[2020-04-07 15:19:25,685] {models.py:1599} 信息 - 正在执行 在 2020-04-06T11:44:31+00:00 [2020-04-07 15:19:25,685] {base_task_runner.py:118} 信息 - 运行:['bash','-c','气流运行 datamart_integration.consentement_email download_file 2020-04-06T11:44:31+00:00 --job_id 156313 --pool 集成 --raw -sd DAGS_FOLDER/datamart/datamart_integration.py --cfg_path /tmp/tmpacazgnve']
我不确定是否有我没有检查的地方...这是我的问题:
- 我一般如何调试 Composer DAG 中的错误
- 创建一个局部气流环境来运行& 在本地调试我的 dags?
- 如何验证 XCom 中是否存在错误?
【问题讨论】:
标签: python google-cloud-platform google-cloud-composer airflow