You deployed `daily_sales.py` an hour ago. It is in the dags folder and it is not in the UI. Nothing is red anywhere. What do you run?
The DAG — work out what the scheduler does with it before reading on
The DAG
dags/daily_sales.py
This file is in the dags folder. The DAG is not in the UI and nothing is red.
import pendulum
from airflow import DAG
from airflow.sdk import task
from airflow.providers.mysql.hooks.mysql import MySqlHook
with DAG(
dag_id="daily_sales",
schedule="@daily",
start_date=pendulum.datetime(2026, 3, 1, tz="UTC"),
catchup=False,
):
@task
def load():
return MySqlHook(mysql_conn_id="sales").get_records("select 1")
load()
What gets run
look for the DAGairflow dags reserialize
ask what failed to importairflow dags list-import-errors
and this is what you saw firstairflow dags list
Why they ask this
The most common 'my DAG isn't working' ticket, and the answer is a single command most people do not know. It also teaches why the symptom is silence rather than a failure.
Say this
`airflow dags list-import-errors`. The file failed to parse, so no DAG object was ever created — and a DAG that does not exist cannot have a failed run to show you.
The reasoning
Airflow discovers DAGs by importing every file in the dags folder. If the import raises — a syntax error, a missing provider package, a module that is not on the path — the file produces no DAG. There is nothing to display, nothing to schedule and nothing to mark red. The absence *is* the error, which is why people stare at an empty UI looking for a failure.
`airflow dags list-import-errors` prints exactly the file and the traceback, and it is the first command to run for this symptom. `airflow dags list` shows the same thing indirectly — no data, plus a hint that files failed to load. The dag processor also logs it, and its log is where you would find it in a deployment you cannot get a shell on.
The most common causes in order: a provider package installed in your local environment but not in the image the scheduler runs; a relative import or a helper module that is not on `PYTHONPATH`; a genuine syntax error from a bad merge; and a parse that times out because of slow top-level code, which is the nasty one because the DAG appears and disappears intermittently.
The prevention is the fifteen-line DAG-integrity test in CI: build a `DagBag`, assert `import_errors` is empty. It runs in seconds and it turns this from an hour of confusion into a failed pull request. That the check is so cheap is why the absence of it is worth flagging in an interview.
What happened — 3 runs run on Airflow 3.3.0
look for the DAGairflow dags reserialize
Parsing the folder is what the dag processor does on a loop. It reports the failure to its log and moves on.
Airflow says
Traceback (most recent call last): ModuleNotFoundError: No module named 'airflow.providers.mysql'
ask what failed to importairflow dags list-import-errors
The DAG never parsed, so there is no run and no task to be red — which is why the UI shows an absence rather than an error.
It prints
bundle_name | filepath | error
============+================+===============================================================================
dags-folder | daily_sales.py | Traceback (most recent call last):
| | File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
| | File "<project>/dags/daily_sales.py", line 4, in <module>
| | from airflow.providers.mysql.hooks.mysql import MySqlHook
| | ModuleNotFoundError: No module named 'airflow.providers.mysql'
| |and this is what you saw firstairflow dags list
Airflow says
Error: Failed to load all files. For details, run `airflow dags
It prints
No data found Error: Failed to load all files. For details, run `airflow dags list-import-errors`
The answer most people give
"Restart the scheduler." It re-imports the same broken file and the DAG is still missing. Restarting occasionally fixes a stale parse, which is exactly why it survives as folklore.
They’ll ask next
The DAG appears and disappears every few minutes. What is different about that case?
