You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "atul-astronomer (via GitHub)" <gi...@apache.org> on 2025/03/26 12:17:35 UTC
[I] Exception while running CLI command 'airflow dags test' [airflow]
atul-astronomer opened a new issue, #48394:
URL: https://github.com/apache/airflow/issues/48394
### Apache Airflow version
main (development)
### If "Other Airflow 2 version" selected, which one?
_No response_
### What happened?
airflow dags test simple_http_operator
[2025-03-26T12:14:45.617+0000] {manager.py:120} INFO - DAG bundles loaded: dags-folder, example_dags
[2025-03-26T12:14:45.618+0000] {dagbag.py:574} INFO - Filling up the DagBag from /root/airflow/dags/simple_http_operator.py
Traceback (most recent call last):
File "/usr/local/bin/airflow", line 10, in <module>
sys.exit(main())
File "/opt/airflow/airflow-core/src/airflow/__main__.py", line 58, in main
args.func(args)
File "/opt/airflow/airflow-core/src/airflow/cli/cli_config.py", line 49, in command
return func(*args, **kwargs)
File "/opt/airflow/airflow-core/src/airflow/utils/cli.py", line 111, in wrapper
return f(*args, **kwargs)
File "/opt/airflow/airflow-core/src/airflow/utils/providers_configuration_loader.py", line 55, in wrapped_function
return func(*args, **kwargs)
File "/opt/airflow/airflow-core/src/airflow/utils/session.py", line 101, in wrapper
return func(*args, session=session, **kwargs)
File "/opt/airflow/airflow-core/src/airflow/cli/commands/remote_commands/dag_command.py", line 655, in dag_test
raise AirflowException(
airflow.exceptions.AirflowException: Dag 'simple_http_operator' could not be found; either it does not exist or it failed to parse.
### What you think should happen instead?
_No response_
### How to reproduce
Run the below CLI command for any Dag:
**airflow dags test <dag_id>**
### Operating System
Linux
### Versions of Apache Airflow Providers
_No response_
### Deployment
Other
### Deployment details
_No response_
### Anything else?
_No response_
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [x] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
--
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: commits-unsubscribe@airflow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Parsing error while running CLI command 'airflow dags test' [airflow]
Posted by "amarlearning (via GitHub)" <gi...@apache.org>.
amarlearning commented on issue #48394:
URL: https://github.com/apache/airflow/issues/48394#issuecomment-2796586710
Hi @atul-astronomer, I was able to test the DAG using the command airflow dags test <dag_name>. However, I don't have access to the DAG you mentioned or the logs you shared, so when I tested the one I have, it resulted in the same error.
```
root@d9f5f68d4cc7:/opt/airflow# airflow dags test example_simplest_dag
[2025-04-11T11:02:21.122+0000] {manager.py:120} INFO - DAG bundles loaded: dags-folder, example_dags
[2025-04-11T11:02:21.123+0000] {dagbag.py:575} INFO - Filling up the DagBag from /opt/airflow/airflow-core/src/airflow/example_dags/example_simplest_dag.py
[2025-04-11T11:02:21.185+0000] {dag.py:2629} INFO - created dagrun <DagRun example_simplest_dag @ 2025-04-11 11:02:19.546222+00:00: manual__2025-04-11T11:02:21.173426+00:00, state:running, queued_at: None. run_type: manual>
[2025-04-11T11:02:21.234+0000] {dag.py:2567} INFO - [DAG TEST] starting task_id=my_task map_index=-1
[2025-04-11T11:02:21.234+0000] {dag.py:2570} INFO - [DAG TEST] running task <TaskInstance: example_simplest_dag.my_task manual__2025-04-11T11:02:21.173426+00:00 [scheduled]>
/opt/airflow/airflow-core/src/airflow/models/taskinstance.py:1947 RemovedIn20Warning: The legacy calling style of select() is deprecated and will be removed in SQLAlchemy 2.0. Please use the new calling style described at select(). (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9)
[2025-04-11 11:02:21,979] {taskinstance.py:2738} INFO - Exporting env vars: AIRFLOW_CTX_DAG_OWNER='airflow' AIRFLOW_CTX_DAG_ID='example_simplest_dag' AIRFLOW_CTX_TASK_ID='my_task' AIRFLOW_CTX_LOGICAL_DATE='2025-04-11T11:02:19.546222+00:00' AIRFLOW_CTX_TRY_NUMBER='1' AIRFLOW_CTX_DAG_RUN_ID='manual__2025-04-11T11:02:21.173426+00:00'
[2025-04-11T11:02:21.979+0000] {taskinstance.py:2738} INFO - Exporting env vars: AIRFLOW_CTX_DAG_OWNER='airflow' AIRFLOW_CTX_DAG_ID='example_simplest_dag' AIRFLOW_CTX_TASK_ID='my_task' AIRFLOW_CTX_LOGICAL_DATE='2025-04-11T11:02:19.546222+00:00' AIRFLOW_CTX_TRY_NUMBER='1' AIRFLOW_CTX_DAG_RUN_ID='manual__2025-04-11T11:02:21.173426+00:00'
Task instance is in running state
Previous state of the Task instance: queued
Current task name:my_task
Dag name:example_simplest_dag
[2025-04-11T11:02:21.994+0000] {taskinstance.py:648} INFO - ::endgroup::
[2025-04-11 11:02:21,995] {python.py:214} INFO - Done. Returned value was: None
[2025-04-11T11:02:21.995+0000] {python.py:214} INFO - Done. Returned value was: None
[2025-04-11T11:02:21.997+0000] {taskinstance.py:326} INFO - ::group::Post task execution logs
[2025-04-11T11:02:21.997+0000] {taskinstance.py:338} INFO - Marking task as SUCCESS. dag_id=example_simplest_dag, task_id=my_task, run_id=manual__2025-04-11T11:02:21.173426+00:00, logical_date=20250411T110219, start_date=, end_date=20250411T110221
Task instance in success state
Previous state of the Task instance: running
Task instance's state was changed through the API.
Task operator:_PythonDecoratedOperator
[2025-04-11T11:02:22.008+0000] {dag.py:2581} INFO - [DAG TEST] end task task_id=my_task map_index=-1
[2025-04-11T11:02:22.010+0000] {dagrun.py:1155} INFO - Marking run <DagRun example_simplest_dag @ 2025-04-11 11:02:19.546222+00:00: manual__2025-04-11T11:02:21.173426+00:00, state:running, queued_at: None. run_type: manual> successful
Dag run in success state
Dag run start:2025-04-11 11:02:19.546222+00:00 end:2025-04-11 11:02:22.010191+00:00
[2025-04-11T11:02:22.010+0000] {dagrun.py:1205} INFO - DagRun Finished: dag_id=example_simplest_dag, logical_date=2025-04-11 11:02:19.546222+00:00, run_id=manual__2025-04-11T11:02:21.173426+00:00, run_start_date=2025-04-11 11:02:19.546222+00:00, run_end_date=2025-04-11 11:02:22.010191+00:00, run_duration=2.463969, state=success, run_type=manual, data_interval_start=2025-04-11 11:02:19.546222+00:00, data_interval_end=2025-04-11 11:02:19.546222+00:00,
root@d9f5f68d4cc7:/opt/airflow#
```
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Parsing error while running CLI command 'airflow dags test' [airflow]
Posted by "atul-astronomer (via GitHub)" <gi...@apache.org>.
atul-astronomer commented on issue #48394:
URL: https://github.com/apache/airflow/issues/48394#issuecomment-2813318326
Retested on rc3, working fine.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Parsing error while running CLI command 'airflow dags test' [airflow]
Posted by "vatsrahul1001 (via GitHub)" <gi...@apache.org>.
vatsrahul1001 commented on issue #48394:
URL: https://github.com/apache/airflow/issues/48394#issuecomment-2790370504
Sure @rxxj25
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Parsing error while running CLI command 'airflow dags test' [airflow]
Posted by "atul-astronomer (via GitHub)" <gi...@apache.org>.
atul-astronomer closed issue #48394: Parsing error while running CLI command 'airflow dags test'
URL: https://github.com/apache/airflow/issues/48394
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Parsing error while running CLI command 'airflow dags test' [airflow]
Posted by "rxxj25 (via GitHub)" <gi...@apache.org>.
rxxj25 commented on issue #48394:
URL: https://github.com/apache/airflow/issues/48394#issuecomment-2764694900
HI, can I work on this?
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org