can not find dag_id when using backfill and specify subdir
when I run:
airflow backfill -sd /home/prod/tony/dag_test -s 2015-08-20 -e 2015-08-21 tutorial.
the python code http://airflow.readthedocs.org/en/latest/tutorial.html
StackTrace log:
Traceback (most recent call last):
File "/usr/local/bin/airflow", line 10, in
Can I ask which version of airflow you are using?
I remember hitting a similar bug that I fixed by 1) upgrading my version of airflow to the latest 2) Making sure that my AIRFLOW_HOME was set correctly and that the DAGS_FOLDER was correctly entered in my airflow.cfg file.
Both are setted in airflow.cfg, what I want to say is I'm running by sepecified subdir. Thanks for your reply.
I'm having the same issue. When I specify -sd /mytest_dags/ it works for the "test", "list_dags", "list_tasks" commands, but for backfill there are some complications:
-
First it initially finds my job and knows how many tasks to run, etc. 2015-08-31 10:04:12,802 INFO - Filling up the DagBag from /mytestdags 2015-08-31 10:04:12,803 INFO - Importing /mytestdags/example_hive_job.py 2015-08-31 10:04:12,805 INFO - Loaded DAG <DAG: example_hive_job> 2015-08-31 10:04:13,011 INFO - Adding to queue: airflow run example_hive_job waitfor_for_hdfs 2015-08-26T00:00:00 --local -sd DAGS_FOLDER//mytestdags/example_hive_job.py -s 2015-08-26T00:00:00 2015-08-31 10:04:18,020 INFO - [backfill progress] waiting: 3 | succeeded: 0 | kicked_off: 1 | failed: 0 | skipped: 0
-
When it runs each task though, it runs it apparently by prepending the "DAGS_FOLDER" as follows: Adding to queue: airflow run example_hive_job waitfor_for_hdfs 2015-08-26T00:00:00 --local -sd DAGS_FOLDER//mytestdags/example_hive_job.py -s 2015-08-26T00:00:00
-
This fails with an error: airflow.utils.AirflowException: DAG [example_hive_job] could not be found
Also, using Airflow version: v1.5.0
I've ran into similar issue with 1.5.2 and was able to resolve by adding the --ship_dag switch on the CLI.
I've also seen the same error when AIRFLOW_HOME environment variable hasn't been set.
I guess this error happens because dags_folder contains '/' at the end of the folder, try to remove '/' at the end of config. example:
wrong: /home/user/airflow/dags/ right: /home/user/airflow/dags
@tonylee0329 I know this is an old issue but I just came across it and I think I put a fix for this in #1271