Repository navigation
Closed
Labels
Description
Apache Airflow version
2.4.3
What happened
When I ran
airflow tasks run example_bash_operator runme_0 2015-01-01
I got the error
(venv) myusername@MacBook-Air airflow % airflow tasks run example_bash_operator runme_0 2015-01-01
[2022-11-14 23:49:19,228] {dagbag.py:537} INFO - Filling up the DagBag from /Users/myusername/airflow/dags
[2022-11-14 23:49:19,228] {cli.py:225} WARNING - Dag '\x1b[01mexample_bash_operator\x1b[22m' not found in path /Users/myusername/airflow/dags; trying path /Users/myusername/airflow/dags
[2022-11-14 23:49:19,228] {dagbag.py:537} INFO - Filling up the DagBag from /Users/myusername/airflow/dags
Traceback (most recent call last):
File "/Users/myusername/airflow/venv/bin/airflow", line 8, in <module>
sys.exit(main())
File "/Users/myusername/airflow/venv/lib/python3.10/site-packages/airflow/__main__.py", line 39, in main
args.func(args)
File "/Users/myusername/airflow/venv/lib/python3.10/site-packages/airflow/cli/cli_parser.py", line 52, in command
return func(*args, **kwargs)
File "/Users/myusername/airflow/venv/lib/python3.10/site-packages/airflow/utils/cli.py", line 103, in wrapper
return f(*args, **kwargs)
File "/Users/myusername/airflow/venv/lib/python3.10/site-packages/airflow/cli/commands/task_command.py", line 366, in task_run
dag = get_dag(args.subdir, args.dag_id, include_examples=False)
File "/Users/myusername/airflow/venv/lib/python3.10/site-packages/airflow/utils/cli.py", line 228, in get_dag
raise AirflowException(
airflow.exceptions.AirflowException: Dag 'example_bash_operator' could not be found; either it does not exist or it failed to parse.
What you think should happen instead
Successful completion of the task
How to reproduce
- Create a Python venv based on Python 3.10
- Follow the Quick Start instructions through
airflow tasks run example_bash_operator runme_0 2015-01-01 - The error should appear
Operating System
MacOS 12.5.1
Versions of Apache Airflow Providers
Not applicable
Deployment
Other
Deployment details
This is just on my local machine
Anything else
No response
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
Activity
tirkarthi commentedon Nov 20, 2022
I guess
include_examples=Falseis passed as discussed in commit ce07117 (#26750 (comment)) that could be causing this issue. cc: @ephraimbuddyephraimbuddy commentedon Nov 21, 2022
Ok. That gained us some speed. I will see if there's a workaround
Almenon commentedon Jan 10, 2023
I still see this, should this be working as of 2.5.0? Note that I have airflow running in another terminal tab while I execute the command.
gxcuit commentedon Jan 13, 2023
same issue
tirkarthi commentedon Jan 14, 2023
The initial issue was due to dag not being found since example dags were not loaded. This is due to the execution_date or run_id not found. This is also reported in #28912 . Maybe the example can be improved to use
airflow tasks testthat creates the dag run and deletes it in the end.potiuk commentedon Jan 15, 2023
Fixed in #28949