You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: system start reports success when the DNS server can't bind 127.0.0.1:2053 #2519
If possible, I've reproduced the issue using the 'main' branch of this project
Steps to reproduce
Hold the port with any other process, e.g. python3 -c 'import socket,time; s=socket.socket(socket.AF_INET, socket.SOCK_DGRAM); s.bind(("127.0.0.1", 2053)); time.sleep(600)' &
container system stop && container system start
container system status
container run -d --name dnsprobe docker.io/library/alpine:3 sleep 300, then dig +short @127.0.0.1 -p 2053 dnsprobe.test
port free port held
system start exit 0 exit 0
system status running running
dig dnsprobe.test 192.168.64.2 connection timed out
Problem description
If something else already holds 127.0.0.1:2053, the DNS server for container names can't start, but nothing tells you. system start succeeds, system status says running, and container names just stop resolving. The only trace is one log line that doesn't say what failed:
container-apiserver: [com.apple.container:APIServer] API server task failed: bind(descriptor:ptr:bytes:): Address already in use) (errno: 48)
One way to hit this is a second macOS user running container on the same Mac, since the port is fixed. The original report in #1693 shows two users and port 2053 held by the other one, so it may be this.
From the code, the localhost resolver on 1053 fails the same way (not tested).
I'd expect system start to fail, or at least system status to show DNS isn't running, with the log naming the DNS server and port.
Activity