Unable to see logs in the web UI when the job is running #45516
Labels
area:core
area:logging
area:webserver
Webserver related Issues
kind:bug
This is a clearly a bug
pending-response
provider:amazon-aws
AWS/Amazon - related issues
Apache Airflow version
Other Airflow 2 version (please specify below)
If "Other Airflow 2 version" selected, which one?
2.10.3
What happened?
Since our migration from Airflow 2.4.3 to 2.9.3 and then to 2.10.3, we have noticed that it has become impossible to access logs via the web UI or the Rest API for a running Task instance.
We run our Airflow instance within the in-house k8s infrastructure, using S3 as our remote logging end.
When the Task instance completes its run, the remote log is visible through the web UI. In v2.4.3 for the same params we never encountered similar issues. Here are our logging config section:
When we try to access the logs for the running task, we see the following text with no content:
Same result for already finalized task attempts:
When we try to get the logs via the REST API (
/api/v1/dags/MY-DAG1/dagRuns/manual__DATE/taskInstances/MY-TASK/logs/8?full_content=false
) after long waiting, we get a time-out exception and following page:What you think should happen instead?
If we check the webserver logs we notice the following exceptions:
What we notice is that the
s3_task_handler
does its part of the job correctly, for a running task it gets the s3 content and if there is no content it clearly saysNo logs found on s3 for ti=<TaskInstance: ...
The problem starts when we try to get stdout for the running k8s pod, as shown above it ends withBlockingIOError - Resource temporarily unavailable
. It all fails infile_task_handler
within_read
method:It looks like this problem has been around for several minor releases.
How to reproduce
You need to deploy an instance of airflow within a k8s cluster with remote logs activated, it should be enough. For solving another issue related to the remote logging, we set up following env vars(not sure if it's relevant):
Operating System
Debian GNU/Linux trixie/sid
Versions of Apache Airflow Providers
Deployment
Official Apache Airflow Helm Chart
Deployment details
Kube version:
v1.30.4
Helm:
version.BuildInfo{Version:"v3.15.2", GitCommit:"1a500d5625419a524fdae4b33de351cc4f58ec35", GitTreeState:"clean", GoVersion:"go1.22.4"}
Anything else?
No response
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: