-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
All DAGS disappear on import failure #283
Comments
Hi @skiedude, please could you which version of DAG Factory you're using? We had the hope that 0.2.0 would solve this problem: In particular, this change: |
Hey @tatiana we are using
Which appears to be your released version with the fix. Could it be that I'm not using your method |
Ok tried out the following code
That does work, and the bad dags disappear from the UI, however I don't see any errors at the top showing that dags failed to import and when I check http://localhost:8080/api/v1/importErrors
Is there anyway to know that Dags are failing to import? |
I see your point, @skiedude. The experience would be much better if we displayed those invalid YMLs as DAG import messages in Airflow. You should be able to identify invalid YAML files by checking the scheduler log messages. They will be similar to:
I suggest we add two follow-up tickets out of this one:
|
Thanks for the followup @tatiana . My overall understanding of all the underlying architecture is rudimentary. But in my personal testing I copied the
From what I've observed, even if the So it seems to reason it would need to insert an import error in the database in a different way? that didn't raise an exception. I've poked around the airflow codebase a bit, but haven't found a method of inserting an importerror without just raising one. |
Hi @skiedude, that's a great point. I'm going to check with the Airflow team and get their thoughts on how we can log this so that the error shows up in the UI, without raising an exception and stopping the process. Stay tuned :) |
@skiedude @cmarteepants My thought was to iterate through all the YML files, identify the ones that are problematic, and raise the Import error by the end, printing out the list of YAMLs that were invalid - so the DAGs that can be loaded would be loaded, but we'd still have visibility of the errors via the Airflow UI |
Does that work? My first thought is that ant exception at parse time results in no dags being loaded from the python file |
Also, all the Import Errors are deleted for a file, if that file is parsed correctly: |
This is what I have observed. Even if you raise the exception after the imports have taken place, since that file is the entry point for all of them, if it raises an exception they all still disappear. |
Using the following code we are importing all yaml dag files at once. Airflow sees this in some areas as a "single" dag. This means if one of those yaml files has an issue being loaded, all of them disappear from the UI.
Is it possible to not have that happen? Off the top of my head, we could create one python file to import each dag individually, but that seems very repetative.
The text was updated successfully, but these errors were encountered: