Airflow & DAGs · Testing & Troubleshooting

Works locally but fails in Airflow: why?

Mediumtroubleshootingdebugging

Interview question

Why might a task work locally but fail in Airflow?

How to answer

The short answer

Usual suspects:

  • Different Python version/environment
  • Missing package on the worker
  • Missing env vars / secrets
  • Local file paths that don't exist on workers
  • Permissions (S3/DB/API)
  • Wrong/missing Airflow Connections
  • Timezone differences
  • Network restrictions
  • Different working directory

Debug approach: