Replies: 2 comments 5 replies
-
|
My best guess is that the file is not generated atomically, and it's not fully written when parser parses it. Typical way of solving it is to write the files elsewhere and "mv" them. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @ecodina! This is a known behavior in Airflow 3.x related to the new DAG Versioning system introduced in Airflow 3.0. Here's what's happening and how to address it:
airflow dags show <dag_id> # check if output changes between runs
Or query the metadata DB directly:
sql
SELECT version_number, created_at, dag_code
FROM dag_version
WHERE dag_id = 'your_dag_id'
ORDER BY created_at DESC
LIMIT 5;
Fix — make your dynamic DAG generation deterministic:
python
from datetime import datetime
# ❌ Bad — changes on every parse
start_date = datetime.now()
# ✅ Good — fixed reference
start_date = datetime(2024, 1, 1)
For your web-form-generated DAGs specifically:
Ensure the template renders identically for the same input (no timestamps injected at render time)
Sort any dict/list structures before serialization
Avoid id(object) or memory addresses in any string representations
Let me know what your DAG generation code looks like and I can help narrow down the specific trigger! |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I am having trouble finding out why some Dags keep increasing their version. I am using Airflow 3.1.7.
We have an internal webpage that generates Python Dags based on a web form. An example of a generated Dag is the following:
The above Dag has 2365 versions:

However, it has not been modified since February 11.
The generated dags live in a folder inside $AIRFLOW_HOME/dags. This folder is a docker volume, mounted on a NFS system and shared with the internal web page. The volume options are:
nfsvers=4.2,addr=172.XX.XX.XX,actimeo=0,hard,rwThe Dag has everything hard-coded, so I am not sure what could be changing. My only idea is that this has something to do with the NFS share?
It is also strange that it increases the version only in some days (as you can see in the screenshot, the last day it increased versions was 2 weeks ago). Not all Dags have the same problem, and not all the Dags that increase their version randomly, increase it at the same day/hour.
Any help will be welcome!
Beta Was this translation helpful? Give feedback.
All reactions