diff --git a/airflow-core/src/airflow/utils/log/file_task_handler.py b/airflow-core/src/airflow/utils/log/file_task_handler.py index 4dc9051c02559..3669aae122b3d 100644 --- a/airflow-core/src/airflow/utils/log/file_task_handler.py +++ b/airflow-core/src/airflow/utils/log/file_task_handler.py @@ -175,6 +175,9 @@ def _fetch_logs_from_service(url: str, log_relative_path: str) -> Response: secret_key=get_signing_key("api", "secret_key"), # Since we are using a secret key, we need to be explicit about the algorithm here too algorithm="HS512", + # We must set an empty private key here as otherwise it can be automatically loaded by JWTGenerator + # and secret_key and private_key cannot be set together + private_key=None, # type: ignore[arg-type] issuer=None, valid_for=conf.getint("webserver", "log_request_clock_grace", fallback=30), audience="task-instance-logs",