Log the original bind exception when encountering Failed to listen on 0.0.0.0, continuing because listening on [::] (#19297)

**Before:**

```
WARNING - call_when_running - Failed to listen on 0.0.0.0, continuing because listening on [::]
```

**After:**

```
WARNING - call_when_running - Failed to listen on 0.0.0.0, continuing because listening on [::]. Original exception: CannotListenError: Couldn't listen on 0.0.0.0:8008: [Errno 98] Address already in use.
```
This commit is contained in:
Eric Eastwood
2025-12-19 14:29:04 -06:00
committed by GitHub
parent f4320b5a49
commit 41938d6fd2
2 changed files with 4 additions and 1 deletions

1
changelog.d/19297.misc Normal file
View File

@@ -0,0 +1 @@
Log the original bind exception when encountering `Failed to listen on 0.0.0.0, continuing because listening on [::]`.

View File

@@ -54,7 +54,9 @@ def check_bind_error(
"""
if address == "0.0.0.0" and "::" in bind_addresses:
logger.warning(
"Failed to listen on 0.0.0.0, continuing because listening on [::]"
"Failed to listen on 0.0.0.0, continuing because listening on [::]. Original exception: %s: %s",
type(e).__name__,
str(e),
)
else:
raise e