Skip to content
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

Improve diagnostics message when users have secret_key misconfigured #17410

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions airflow/utils/log/file_task_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from typing import TYPE_CHECKING, Optional

import httpx
from httpx import HTTPStatusError
potiuk marked this conversation as resolved.
Show resolved Hide resolved
from itsdangerous import TimedJSONWebSignatureSerializer

from airflow.configuration import AirflowConfigException, conf
Expand Down Expand Up @@ -186,6 +187,11 @@ def _read(self, ti, try_number, metadata=None):
)
response.encoding = "utf-8"

if response.status_code == 403:
log += "*** !!!! Please make sure that all your webservers and workers have" \
" the same 'secret_key' configured in 'webserver' section !!!!!\n***"
log += "*** See more at https://airflow.apache.org/docs/apache-airflow/" \
"stable/configurations-ref.html#secret-key\n***"
# Check if the resource was properly fetched
response.raise_for_status()

Expand Down