-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
Airflow task log handling broken for non-Kubernetes executors #34783
Comments
Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval. |
Could you provide a bit more details, e.g example of your dag. I've unable to reproduce on current main branch [2023-10-05, 22:05:02 UTC] {ecs.py:531} INFO - Running ECS Task - Task definition: sample-task:1 - on cluster test-cluster
[2023-10-05, 22:05:02 UTC] {ecs.py:534} INFO - EcsOperator overrides: {'containerOverrides': [{'name': 'busybox', 'command': ['/bin/sh', '-c', 'echo regular; sleep 6; echo finish']}]}
[2023-10-05, 22:05:02 UTC] {base.py:73} INFO - Using connection ID 'aws_default' for task execution.
[2023-10-05, 22:05:02 UTC] {credentials.py:1123} INFO - Found credentials in environment variables.
[2023-10-05, 22:05:04 UTC] {ecs.py:647} INFO - ECS task ID is: aef0db066c2f48faad6303efc27180f0
[2023-10-05, 22:05:04 UTC] {ecs.py:573} INFO - Starting ECS Task Log Fetcher
[2023-10-05, 22:05:34 UTC] {base.py:73} INFO - Using connection ID 'aws_default' for task execution.
[2023-10-05, 22:05:34 UTC] {credentials.py:1123} INFO - Found credentials in environment variables.
[2023-10-05, 22:05:35 UTC] {task_log_fetcher.py:63} INFO - [2023-10-05 22:05:17,228] regular
[2023-10-05, 22:05:35 UTC] {task_log_fetcher.py:63} INFO - [2023-10-05 22:05:23,229] finish |
@Taragolis thank you for looking into this so quickly! Shortly after opening this issue, I was able to identify the real root cause for why our logs stopped being written to S3. We had added a logger for LOGGING_CONFIG["loggers"]["airflow"] = {
"handlers": ["file"],
"level": LOG_LEVEL,
"propagate": False,
} After removing the aforementioned logger, our task logs began to show up as expected. However, the reason we hit this issue was still due to the changes made in #28440. The changes made in that PR introduced a hard requirement for the Thus, there still needs to be a couple of things done in order to fully resolve this issue.
I'll work on putting together PRs to make the necessary changes. |
Hi @taharah did you get a chance to work on it? |
Apache Airflow version
Other Airflow 2 version (please specify below)
What happened
After upgrading Airflow from 2.5.3 to 2.6.3, none of our task logs for the ECS operator were being written to the configured file and S3 remote write handlers.
What you think should happen instead
Airflow task logs should be written to the configured handlers.
How to reproduce
Configure a remote write handler for a non-Kubernetes based executor.
Operating System
Amazon Linux 2
Versions of Apache Airflow Providers
apache-airflow-providers-amazon = "7.4.1"
apache-airflow-providers-celery = "3.3.4"
Deployment
Other
Deployment details
Airflow is deployed to Amazon ECS.
Anything else
The issue seems to be a result of the change from #28440. Specifically, the change to remove the handlers from the source logger (https://github.com/apache/airflow/pull/28440/files#diff-ad618185a072910e49c11770954af009d1cc070b120a4fde5f2fc095a588271bR704), which was not the previous behavior.
I am happy to submit a change for this; however, want to get some direction on what others feel is the best path forward, e.g., making this behavior configurable or reverting to the original behavior.
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: