Skip to content
Discussion options

You must be logged in to vote

You have a few ways to handle this:

  1. Use airflow db clean outside the DAG

The simplest approach is to keep DB cleaning as a manual or scheduled job outside Airflow:

Use a cron job or systemd timer that executes the command inside the container.

Example:

docker exec airflow-airflow-worker-1 airflow db clean --clean-before-timestamp 20250930 --yes

  1. Use a separate script and run it as a container task

Create a small Docker container (or script) that runs the cleaning command.

Schedule it via Airflow using a KubernetesPodOperator or DockerOperator instead of BashOperator.

The container can safely have the real DB connection string, bypassing the “blocked” environment.

  1. Explicitly pass the D…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jlandercy
Comment options

Answer selected by jlandercy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants