managed-airflow-dag-troubleshooting
它能做什么
这项技能调查 Managed Service for Apache Airflow(前身为 Cloud Composer)上失败的 Airflow 运行。适合定时工作流出错、需要明确原因的人。
适用场景
- ✓Managed Airflow 中的某次 DAG 运行或任务实例失败的时候。
- ✓你需要阅读 Airflow 任务日志,查找 traceback 或 API 错误的时候。
- ✓某个任务不断超时,例如出现 AirflowTaskTimeout 错误的时候。
技能链接
https://github.com/google/skills/blob/main/skills/cloud/managed-airflow-dag-troubleshooting/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我的每晚 Airflow DAG 在加载任务上失败了。请读取日志,告诉我哪里出了问题。”
每周 5 个新技能,1 分钟读完。
工作原理
它会用 gcloud logging 获取任务日志,并从存储中获取 DAG 代码,然后查找 traceback 和 API 错误代码等错误模式。它的建议仅基于找到的内容。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Managed Service for Apache Airflow (formerly Cloud Composer) DAG troubleshooting guide
This skill provides instructions for troubleshooting Managed Airflow DAGs (DAG
runs and task instances), utilizing gcloud composer, gcloud logging and
gcloud storage commands to fetch remote logs and code.
Attribution
MUST READ: Before executing any gcloud, REST API, or MCP command, you
MUST read Usage Attribution. For commands executed
directly in the terminal (never in generated scripts, Terraform, or user code),
prefix gcloud with
CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:managed-airflow-dag-troubleshooting)"
and append agent-skills/1.0 (skill:managed-airflow-dag-troubleshooting) to User-Agent headers.
General rules
Provide suggestions on how to troubleshoot the failed jobs. Provide only the steps that the user can actually take. Ground all troubleshooting advice in direct findings.
When troubleshooting a failure, follow the following practices to always provide a deterministic diagnosis:
Fetch relevant logs: Always fetch the logs for a task under investigation using
gcloud logging read; check the logs for specific error patterns: Python tracebacks, API error codes (e.g., 400, 403, 404, 500), or Airflow signals (e.g.,AirflowTaskTimeout).Fetch task metadata: When troubleshooting a task, fetch the task state and metadata (execution state, try number, timestamps, and execution details) using:
gcloud composer environments run {env_name} \ --location {location} \ tasks states-for-dag-run -- -d {dag_id} -r {run_id}or for an individual task instance:
gcloud composer environments run {env_name} \ --location {location} \ tasks state -- {dag_id} {task_id} {execution_date}Retrieve and compare DAG source code: Download the remote DAG source code using
gcloud storage cp gs://{bucket_name}/dags/{dag_file}.py .(find the environment bucket viagcloud composer environments describe {env_name} --location {location} --format="value(config.dagGcsPrefix)"). Compare the parameters in the code (e.g., table IDs, disk sizes, URI paths) against the error messages found in the task logs.Explain code mistakes and potential fixes: Explain mistakes in the code (if any are actually visible); suggest potential fixes (if they are very likely to be meaningful); discuss source code availability if needed - if some source code is unavailable (e.g. imported from a file other than the main source code file), mention this (you can mention the package name) - in such a case take into account most likely trigger rules if they are unknown.
Check for environment-level errors: Query Cloud Logging with
gcloud logging readto see if there are high-level environment issues or known platform errors correlating with the failure (see Known issues below). You MUST return ALL found issues.Identify failing tasks in a DAG run: When troubleshooting a failed DAG run, mention the task that caused a failure (use
tasks states-for-dag-runor Cloud Logging to identify failed tasks). Provide a task instance name. If many tasks failed, mention which task was critical (mandatory for successful DAG run execution - look into task dependencies and trigger rules) and focus on this one.Verify service configurations in code: If logs suggest an issue with a specific service (e.g., BigQuery, Dataform, Compute Engine), use the log details to verify the configuration in the DAG source code.
Correlate logs with code: E.g., if BigQuery returns a 404, verify the dataset ID or table ID in the DAG source code matches reality.
Prioritize known platform issues: Check against Known issues below. If Cloud Logging queries return matching platform error signals, prioritize that diagnosis.
Summarize with Evidence (Deterministic Response): Your response must be specific. Avoid general advice like 'check your permissions.' or 'check the logs.' Instead, say 'The service account is missing X permission
常见问题
它会检查整体环境性能吗?
不会。性能建议由另一项技能负责。
它需要访问日志吗?
需要。它使用 gcloud logging 和 gcloud storage 读取日志和 DAG 代码。
它会猜测原因吗?
不会。它的建议以日志和代码中的直接发现为依据。
详情
作者的原始描述
Provides guidance for troubleshooting Apache Airflow DAGs (failed DAG runs and task instances) in Managed Service for Apache Airflow (MSAA; formerly Cloud Composer). Use when figuring out reasons for DAG run or task instance failures. Don't use when looking for overall recommendations for Managed Airflow environment performance.
repo: google/skills
热度
- GitHub 星标
- 22k
- 排名
- #10343
- 许可证
- Apache-2.0
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
finding-google-skills
22k帮你的智能体为某项设置任务找到合适的 Google 指南,例如托管、数据库、存储、登录或 AI 模型服务。
gcloud
22k帮你的智能体编写并检查 Google Cloud gcloud 命令,在运行任何内容之前查阅准确的语法,避免猜测参数。
google-cloud-recipe-auth
22k引导你的智能体了解 Google Cloud 的身份与访问管理,包括人员和服务如何登录,以及它们各自获得哪些权限。
google-cloud-recipe-onboarding
22k带领新开发者完成在 Google Cloud 上的第一步,包括选择项目、关联计费,以及部署第一个资源。