diff --git a/airflow/utils/log/secrets_masker.py b/airflow/utils/log/secrets_masker.py index 623d5da0f2f71..c263cbb945fee 100644 --- a/airflow/utils/log/secrets_masker.py +++ b/airflow/utils/log/secrets_masker.py @@ -211,11 +211,13 @@ def _redact(self, item: "RedactableItem", name: Optional[str], depth: int) -> "R else: return item # I think this should never happen, but it does not hurt to leave it just in case + # Well. It happened (see https://github.com/apache/airflow/issues/19816#issuecomment-983311373) + # but it caused infinite recursion, so we need to cast it to str first. except Exception as e: log.warning( - "Unable to redact %r, please report this via . " + "Unable to redact %s, please report this via . " "Error was: %s: %s", - item, + repr(item), type(e).__name__, str(e), )