This is an automated email from the ASF dual-hosted git repository.

pierrejeambrun pushed a commit to branch v3-2-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/v3-2-test by this push:
     new cbfd1d0de3c [v3-2-test] Breeze: bind api-server dual-stack so 
http://localhost works in Chrome/Safari (#67320) (#67339)
cbfd1d0de3c is described below

commit cbfd1d0de3cb4158a92b1ce66aba9fd0a8f5bd6a
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri May 22 19:10:40 2026 +0200

    [v3-2-test] Breeze: bind api-server dual-stack so http://localhost works in 
Chrome/Safari (#67320) (#67339)
    
    * Breeze: bind api-server dual-stack so localhost works in Chrome/Safari
    
    * Apply the same dual-stack bind in the tmux startup script
    
    The mprocs path was patched in the previous commit, but breeze also
    supports tmux as a terminal multiplexer (selectable via
    `--terminal-multiplexer tmux`). The tmux path hard-codes the
    api-server invocation in scripts/in_container/bin/run_tmux and needs
    the same `--host '::'` treatment so localhost works in browsers that
    prefer IPv6.
    (cherry picked from commit 11ba5ec753bdc8baccb79c28a7b0fd474cba3803)
    
    Co-authored-by: Pierre Jeambrun <[email protected]>
---
 scripts/in_container/bin/generate_mprocs_config.py | 14 ++++++++++++--
 scripts/in_container/bin/run_tmux                  |  9 ++++++---
 2 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/scripts/in_container/bin/generate_mprocs_config.py 
b/scripts/in_container/bin/generate_mprocs_config.py
index 1747582671a..e89643d0668 100755
--- a/scripts/in_container/bin/generate_mprocs_config.py
+++ b/scripts/in_container/bin/generate_mprocs_config.py
@@ -66,12 +66,22 @@ def generate_mprocs_config() -> str:
     use_airflow_version = get_env("USE_AIRFLOW_VERSION", "")
     if not use_airflow_version.startswith("2."):
         # API Server (Airflow 3.x+)
+        # Bind dual-stack (IPv6 + IPv4) so http://localhost:28080 works from 
browsers that
+        # resolve `localhost` to ::1 first (e.g. Chrome/Safari on macOS with 
OrbStack, which
+        # forwards both IPv4 and IPv6 host ports into the container). The 
default `0.0.0.0`
+        # binds IPv4 only, causing the IPv6 attempt to land inside the 
container with no
+        # listener and TCP RST → opaque chrome-error://chromewebdata/ page.
+        api_host_arg = "--host '::'"
         if get_env_bool("BREEZE_DEBUG_APISERVER"):
             port = get_env("BREEZE_DEBUG_APISERVER_PORT", "5679")
-            api_cmd = f"debugpy --listen 0.0.0.0:{port} --wait-for-client -m 
airflow api-server -d"
+            api_cmd = (
+                f"debugpy --listen 0.0.0.0:{port} --wait-for-client -m airflow 
api-server {api_host_arg} -d"
+            )
         else:
             dev_mode = get_env_bool("DEV_MODE")
-            api_cmd = "airflow api-server -d" if dev_mode else "airflow 
api-server"
+            api_cmd = (
+                f"airflow api-server {api_host_arg} -d" if dev_mode else 
f"airflow api-server {api_host_arg}"
+            )
         procs["api_server"] = {"shell": api_cmd, "restart": "always", 
"scrollback": 100000}
     else:
         # Webserver (Airflow 2.x)
diff --git a/scripts/in_container/bin/run_tmux 
b/scripts/in_container/bin/run_tmux
index bf3f3d95e58..b13ee81289a 100755
--- a/scripts/in_container/bin/run_tmux
+++ b/scripts/in_container/bin/run_tmux
@@ -65,15 +65,18 @@ fi
 if [[ ! ${USE_AIRFLOW_VERSION=} =~ ^2\..*  ]]; then
   tmux split-window -h
   tmux select-pane -t 2
+    # Bind dual-stack (IPv6 + IPv4) so http://localhost:28080 works from 
browsers that resolve
+    # `localhost` to ::1 first (e.g. Chrome/Safari on macOS with OrbStack, 
which forwards both
+    # IPv4 and IPv6 host ports into the container). The default `0.0.0.0` 
binds IPv4 only.
     if [[ ${BREEZE_DEBUG_APISERVER} == "true" ]]; then
         tmux set-option -p @airflow_component "API Server(Debug Mode)"
-        tmux send-keys "debugpy --listen 
0.0.0.0:${BREEZE_DEBUG_APISERVER_PORT} --wait-for-client -m airflow api-server 
-d" C-m
+        tmux send-keys "debugpy --listen 
0.0.0.0:${BREEZE_DEBUG_APISERVER_PORT} --wait-for-client -m airflow api-server 
--host '::' -d" C-m
     else
   tmux set-option -p @airflow_component "API Server"
     if [[ ${DEV_MODE=} == "true" ]]; then
-        tmux send-keys 'airflow api-server -d' C-m
+        tmux send-keys "airflow api-server --host '::' -d" C-m
     else
-        tmux send-keys 'airflow api-server' C-m
+        tmux send-keys "airflow api-server --host '::'" C-m
     fi
     fi
 else

Reply via email to