Pebble32 opened a new issue, #77243:
URL: https://github.com/apache/airflow/issues/77243

   ### Apache Airflow version
   
   main (development)
   
   ### What happened?
   
   A Dag from a Lang-SDK runtime (found with the TypeScript SDK 1.0.0) with an 
out of range cron such as `schedule: "0 25 * * *"` passes `airflow-ts-pack` and 
is saved by the Dag processor without an import error. The Dag shows up in the 
UI but never gets a run. The only trace is a `Failed to fetch run info` 
traceback in the Dag processor log ending in `CroniterBadCronError: [0 25 * * 
*] is not acceptable, out of range`, followed by `next_dagrun=None`.
   
   The same schedule in a Python Dag fails at parse time, because 
`DAG.validate()` calls `timetable.validate()`. 
`DagSerialization.validate_serialized_dag` checks the schema, duplicate task 
ids, `max_active_runs`, `catchup` and cycles for Lang-SDK Dags, but doesn't 
call `timetable.validate()`.
   
   The Go and Java SDKs are affected too. Their schedule checks only look at 
the shape of the expression and leave ranges to croniter (the Go comment in 
`serialize.go` says croniter rejects those "only when Airflow tries to schedule 
the Dag"), so `0 25 * * *` and `61 * * * *` pass them as well.
   
   ### What you think should happen instead?
   
   The Dag should get an import error like a Python Dag does. Calling 
`timetable.validate()` in `validate_serialized_dag` and raising 
`DeserializationError` on `AirflowTimetableInvalid` would cover the TypeScript, 
Go and Java SDKs.
   
   ### How to reproduce
   
   ```ts
   import { Bundle, Dag } from "@apache-airflow/ts-sdk";
   
   const dag = new Dag("bad_cron", { schedule: "0 25 * * *" });
   const a = dag.task("a", async () => 1);
   a();
   
   await new Bundle(dag).serve();
   ```
   
   Pack it with `airflow-ts-pack` and put the bundle in the Dags folder. The 
Dag is created with no import error and `next_dagrun` stays `None`.
   
   ### Are you willing to submit PR?
   
   Yes I am willing to submit a PR!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to