Repository navigation
Description
Describe the bug
Environment
- OrbStack 2.2.5 (2020500), commit bf842321
- Docker Engine 29.8.2, Compose v5.5.0
- macOS 27.2 (26B123), Apple silicon (Mac16,11)
- Settings:
docker.expose_ports_to_lan: true,network_bridge: true,network.subnet4: 192.168.138.0/23 - The Mac's LAN address is 192.168.0.180 (static). It's a home server, so containers are reachable from the LAN.
Setup
9 containers (in 4 compose projects) publish each port on two specific host IPs, the Mac's LAN address and loopback, instead of 0.0.0.0. For example:
services:
bazarr:
ports:
- "192.168.0.180:6767:6767"
- "127.0.0.1:6767:6767"
tautulli:
ports:
- "192.168.0.180:8181:8181"
- "127.0.0.1:8181:8181"Normally this works fine. When it fails, vmgr.log shows agent:docker dialing the container's bridge IP, e.g. dialAddr="192.168.97.7:6767". During a container restart, a few connection refused errors like that are normal.
What goes wrong
Twice in 3 weeks, right after containers were recreated or started in bulk, the forward for one port began dialing the published host IP itself (dialAddr="192.168.0.180:<port>") instead of the container. A connection to 192.168.0.180: from the LAN or from the Mac then never reached the container. The two incidents failed in different ways:
Incident 1: Bazarr (port 6767), during docker compose pull && docker compose up -d, 2026-11-15 04:00
A weekly update script recreated 6 services at about 04:02–04:06: aiostreams, bazarr, kometa, seerr, tautulli and uptime-kuma. aiostreams was then recreated once more for a rollback at 04:05:49. From 04:06 on, every connection to 192.168.0.180:6767 got an empty reply. 127.0.0.1:6767 and the container itself (192.168.97.x:6767) worked. Inside the VM the dial failed at once with cannot assign requested address. That repeated about once a minute (one per uptime monitor check) for 18 hours, until docker compose up -d --force-recreate bazarr at 22:11 fixed it.
agent:docker | time="11-15 04:02:35" level=error msg="unable to get image" error="inspect image sha256:a4323bc0…: [Docker] No such image: sha256:a4323bc0…"
agent:docker | time="11-15 04:06:02" level=error msg="failed to dial local (1)" dialAddr="192.168.0.180:6767" error="dial tcp 192.168.0.180:6767: connect: connection timed out"
agent:docker | time="11-15 04:06:04" level=error msg="failed to dial local (1)" dialAddr="192.168.0.180:6767" error="dial tcp 192.168.0.180:6767: connect: cannot assign requested address"
agent:docker | time="11-15 04:06:24" level=error msg="failed to dial local (1)" dialAddr="192.168.0.180:6767" error="dial tcp 192.168.0.180:6767: connect: cannot assign requested address"
agent:docker | time="11-15 04:06:56" level=error msg="failed to dial local (1)" dialAddr="192.168.0.180:6767" error="dial tcp 192.168.0.180:6767: connect: connection timed out"
agent:docker | time="11-15 04:06:59" level=error msg="failed to dial local (1)" dialAddr="192.168.0.180:6767" error="dial tcp 192.168.0.180:6767: connect: cannot assign requested address"
… the same line about 60 times an hour (1,103 in total) until …
agent:docker | time="11-15 22:10:58" level=error msg="failed to dial local (1)" dialAddr="192.168.0.180:6767" error="dial tcp 192.168.0.180:6767: connect: cannot assign requested address"
agent:docker | time="11-15 22:11:31" level=error msg="failed to dial local (1)" dialAddr="192.168.97.3:6767" error="dial tcp 192.168.97.3:6767: connect: connection refused" <- after the recreate: back to the container IP
Incident 2: Tautulli (port 8181), after restarting OrbStack, 2026-11-15 23:44
After an OrbStack restart, all containers came back at 23:44:43–23:44:46. Their forwards dialed container IPs as usual (192.168.97.7:6767 connection refused while bazarr was starting). From 23:47:11 on, Tautulli's forward dialed 192.168.0.180:8181. This time the dial left the VM and came back in through OrbStack's own listener on 192.168.0.180:8181, which forwarded it again: a loop. Within about 2 minutes the Mac had about 27,000 sockets to 192.168.0.180:8181 and ran out of ephemeral ports. Every forwarded port on the Mac stopped answering, along with anything else on the Mac making outbound connections, from about 23:46 to 23:49. docker compose up -d --force-recreate tautulli at about 23:47:45 fixed it. The sockets drained to 6, and the last self-dial error was at 23:48:50.
vmgr | time="11-15 23:44:43" level=info msg="startup phase begin" phase=verify_rosetta <- OrbStack restart
agent:docker | time="11-15 23:44:45" level=info msg="adding network" config="{192.168.97.0/24 192.168.97.1 … br-1be598310aa2}" name=docker_default
agent:docker | time="11-15 23:44:46" level=error msg="failed to dial local (1)" dialAddr="192.168.97.7:6767" error="dial tcp 192.168.97.7:6767: connect: connection refused" <- normal
agent:docker | time="11-15 23:47:11" level=error msg="failed to dial local (1)" dialAddr="192.168.0.180:8181" error="dial tcp 192.168.0.180:8181: connect: connection timed out" <- wrong target
agent:docker | time="11-15 23:47:32" level=error msg="failed to dial local (1)" dialAddr="192.168.0.180:8181" error="dial tcp 192.168.0.180:8181: connect: connection timed out"
agent:docker | time="11-15 23:47:48" level=error msg="failed to dial local (1)" dialAddr="192.168.0.180:8181" error="dial tcp 192.168.0.180:8181: connect: connection timed out"
agent:docker | time="11-15 23:47:49" level=error msg="failed to dial local (1)" dialAddr="192.168.97.3:8181" error="dial tcp 192.168.97.3:8181: connect: connection refused" <- container being recreated
agent:docker | time="11-15 23:47:56" level=error msg="failed to dial local (1)" dialAddr="192.168.0.180:8181" error="dial tcp 192.168.0.180:8181: connect: connection timed out" <- in-flight loop connections draining
agent:docker | time="11-15 23:48:50" level=error msg="failed to dial local (1)" dialAddr="192.168.0.180:8181" error="dial tcp 192.168.0.180:8181: connect: connection timed out" <- last one
On the Mac during incident 2, netstat -an -p tcp showed about 27,000 connections to 192.168.0.180.8181. Normally there are about 2.
To Reproduce
Not deterministic:
- Publish 5+ services on
<Mac LAN IP>:<port>and127.0.0.1:<port>withexpose_ports_to_lanon. - Recreate several of them at once (
docker compose pull && docker compose up -dwith new images), or restart OrbStack. - Keep a client hitting
<Mac LAN IP>:<port>and watchvmgr.logforfailed to dial localwithdialAddr="<Mac LAN IP>:<port>".
I couldn't reproduce it by recreating a single test container 25 times under load, with either specific-IP or 0.0.0.0 publishing (0 failures each). So it looks like a race that needs many containers or forwards changing at once.
Expected behavior
The forward for 192.168.0.180:8181 -> 8181/tcp always dials the container (its bridge IP or the in-VM published port), never the host bind address. It should never dial an address that routes back into OrbStack's own listener.
Diagnostic report (REQUIRED)
OrbStack info:
Version: 2.2.5
Commit: bf842321f95fc3ca7cda3227bf0cd41cb188c471 (v2.2.5)
System info:
macOS: 27.2 (26B123)
CPU: arm64, 12 cores
CPU model: Apple M4 Pro
Model: Mac16,11
Memory: 48 GiB
Full report: https://orbstack.dev/_admin/diag/orbstack-diagreport_2026-11-16T13-05-42.848328Z.zip
Screenshots and additional context (optional)
Theory
When a forward is bound to a specific host IP, the dial target inside the VM seems to come from the published binding (HostIp:HostPort) in some code path, for example when the container's IP isn't known yet or a stale mapping is used during a recreate or startup race. It doesn't come from the container's IP.
- With
0.0.0.0or127.0.0.1bindings, dialing the bind address inside the VM still reaches dockerd's published port, so the same mistake would be harmless. - With a LAN IP, the address either isn't local in the VM (
cannot assign requested address: incident 1, a dead forward) or routes back to the Mac (connection timed outplus a self-feeding loop: incident 2, port exhaustion). - Once a forward is in this state it stays there until that container is recreated.
Both incidents followed bulk container (re)creation: a compose update of 6 services, and OrbStack starting all 10 containers at once.
Release notes show specific-IP bindings were added in 2.1.0 and fixed in 2.2.0 ("Fixed Docker port forwards bound to specific IPs") and 2.2.2 ("port forwards to specific IPs on ports under 1024"). This may be a remaining case of the same code path. #1493 ("stops listening to the mapped host port while the container is still running") may be related.
Workaround in use
A watchdog runs every 2 minutes. When a port bound to 192.168.0.180 stops answering, or shows a self-dial or socket storm, it recreates that one container. A guard against dialing OrbStack's own host-side listener would at least prevent the port exhaustion.
Activity