airflow: Task fails and cannot read logs. Invalid URL 'http://:8793/log/...': No host supplied
Apache Airflow version
Other Airflow 2 version (please specify below)
If “Other Airflow 2 version” selected, which one?
2.10.1
What happened?
I’m having an issue with an airflow instance where a task fails and I cannot read the logs.
Logs:
*** Could not read served logs: Invalid URL 'http://:8793/log/dag_id=my_dag/run_id=dynamic__apple_3_my_dag_cb353081__2024-09-09T14:41:22.596199__f73c5571719e4f35bf195ded40e5e25b/task_id=cleanup_temporary_directory/attempt=1.log': No host supplied
Event logs:
Executor CeleryExecutor(parallelism=128) reported that the task instance <TaskInstance: my_dag.cleanup_temporary_directory dynamic__apple_3_my_dag_cb353081__2024-09-09T14:41:22.596199__f73c5571719e4f35bf195ded40e5e25b [queued]> finished with state failed, but the task instance's state attribute is queued. Learn more: https://airflow.apache.org/docs/apache-airflow/stable/troubleshooting.html#task-state-changed-externally
Additionally I checked the logs directory for the dag_id/run_id and it’s missing the respective task_id folder.
What you think should happen instead?
I should be able to access the logs.
How to reproduce
Not sure how to.
Operating System
Ubuntu 24.04 LTS
Versions of Apache Airflow Providers
No response
Deployment
Other Docker-based deployment
Deployment details
Deployed with docker-compose on Docker Swarm setup on 2 VMs.
Anything else?
Additionally I checked the logs directory for the dag_id/run_id and it’s missing the respective task_id folder.
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
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 36
- Comments: 53 (7 by maintainers)
same issue for us when upgrading to 2.10.2
We are facing a similar issue in versions: 2.10.2 and 2.10.4 in EKS. I noticed that when we had our workers in a Statefulset, they return the full FQDN:
airflow-worker-0.airflow-worker.airflow.cluster.local, whereas when they are deployed in a Deployment, they only return:airflow-worker-xxxxxxxx-yyyy. For us, changinghostname_callabletoairflow.utils.net.get_host_ip_addressfixed the issue. This might be something nice to set automatically when worker’s persistence is disabled in the HelmChart?I have the same issue with 2.10.0, using the CeleryExecutor. It worked before I upgrading from version 2.9.0 to 2.10.0.
eventlog
Scheduler has a error log at the same hour as eventlog.
got the same behavior since upgrading from version 2.9.3 to 2.10.1. We are using LocalExecutor
Finally found the issue when i trie to upgrade my docker airflow 2 to airflow 3.
For the record im using LocalExecutor, so it wasnt neither redis nor celery causing the issue since i dont need those.
In my case my
base_urlconfig inairflow.cfgwas set tohttp://localhost:8080and it was working fine in Airflow 2 but in Airflow 3 i had to update it by using my docker hostname so in my case it becamehttp://webserver:8080and the issue was finally gone 😎Hope this will help some of you !
We are facing the same issue on 2.10.4
We have upgraded on
2.10.1like @andrew-stein-sp and we could reproduce the same behaviorhaving the same issue with 2.10.1 in k8s, using the CeleryKubernetesExecutor.
Could this be related to the inheritance issue that was discussed in https://github.com/apache/airflow/issues/41891?
Some further testing- I spun up another celery worker using the same credentials as configured for airflow.cfg and did a simple proof of concept using a separate celery task and that succeeded. So it is definitely something within airflow as opposed to my valkey/redis setup/config.
I am running 2.10.5 with docker compose but still had get this problem neither rebuilding all containers nor changing to hostname_callable to airflow.utils.net.get_host_ip_address.
At this time (https://github.com/apache/airflow/issues/42136#issuecomment-2357283522), I used the
airflow db upgradecommand , but I realized it has been deprecated. I retried the upgrade using theairflow db migrate -n "2.10.2"command, and it works for me now.https://airflow.apache.org/docs/apache-airflow/2.10.0/installation/upgrading.html#offline-sql-migration-scripts
I’m having this issue using 3.0.0rc2, too. Thoughts? I’m using docker.
I use docker compose to run airflow and had the same problem for all dags. What I did was stopping all dags, mark all task which were up for retry as failed, and rebuild all containers related to airflow. Now I can run my dags.
try to check that dags exist in worker, schedule and webserver. I deploy Airflow in K8S and get this error when putting my dags into scheduler(expecting that in will replicate into another pods), but when I check dags folder in worker it was empty