From cbdf03bb7ec5e0e17fbf870a1fcc37e621412ce5 Mon Sep 17 00:00:00 2001 From: Jarek Potiuk Date: Mon, 19 Sep 2022 17:14:30 +0200 Subject: [PATCH] Fix proper joining of the path for logs retrieved from celery workers The change #26377 "fixed" the way how logs were retrieved from Celery, but it - unfortunately broke the retrieval eventually. This PR should fix it. Fixes: #26492 --- airflow/utils/log/file_task_handler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/airflow/utils/log/file_task_handler.py b/airflow/utils/log/file_task_handler.py index cd4d049d9aa70..74d4d1b08dc54 100644 --- a/airflow/utils/log/file_task_handler.py +++ b/airflow/utils/log/file_task_handler.py @@ -212,7 +212,8 @@ def _read(self, ti: TaskInstance, try_number: int, metadata: dict[str, Any] | No import httpx url = urljoin( - f"http://{ti.hostname}:{conf.get('logging', 'WORKER_LOG_SERVER_PORT')}/log", log_relative_path + f"http://{ti.hostname}:{conf.get('logging', 'WORKER_LOG_SERVER_PORT')}/log/", + log_relative_path, ) log += f"*** Log file does not exist: {location}\n" log += f"*** Fetching from: {url}\n"