Bonjour, Goodbye: A Strange iTerm2 Networking Bug

From time to time, I experienced strange behaviour in my programs and scripts running on my Mac. They became unable to connect to some hosts on my local network: only some, not all. This caused failures in my photo-processing scripts and data backups, and it seemed to happen after something was triggered on the system.

Most of the error messages were network-related, such as “No route to host”.

Connecting to my local API server using curl (or a Python script) didn’t work, but it worked in my browser.

Tired of my scripts and backups failing randomly, I investigated what might be happening. I had a workaround, but it required running those scripts after opening an SSH session to localhost (or running everything as root…).

And it happened again, so I went down the rabbit hole. (Spoiler: a self-upgrade likely triggered it.)

The mystery: two hosts, one subnet, different outcomes

I couldn’t directly connect to a host named pdp17 except when running it via a local SSH session, while I could connect to one called cosmos.

pineapple:~ kewl$ ping -c 1 pdp17 ; ssh localhost ping -c 1 pdp17
PING pdp17.in.eo.lu (10.31.33.23): 56 data bytes

--- pdp17.in.eo.lu ping statistics ---
1 packets transmitted, 0 packets received, 100.0% packet loss
(kewl@localhost) Password:
PING pdp17.in.eo.lu (10.31.33.23): 56 data bytes
64 bytes from 10.31.33.23: icmp_seq=0 ttl=64 time=0.498 ms

--- pdp17.in.eo.lu ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.498/0.498/0.498/0.000 ms
pineapple:~ kewl$ arp -an | grep 10.31.33.23
? (10.31.33.23) at bd:14:41:f1:42:42 on en11 ifscope [ethernet]
pineapple:~ kewl$ ping -c 1 cosmos
PING cosmos.in.eo.lu (10.31.33.5): 56 data bytes
64 bytes from 10.31.33.5: icmp_seq=0 ttl=64 time=0.356 ms

--- cosmos.in.eo.lu ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.356/0.356/0.356/0.000 ms

Eliminating the usual suspects

Maybe it’s related to the system environment, so I compared the environments in the SSH and local sessions. Nothing relevant.

DNS resolution? Nope.

ARP, routing and interface selection? Nope.

Running tcpdump while pinging revealed that the echo request was sent and its reply received, despite the packets being reported as lost.

The permissions paradox

But in the same shell, running sudo ping pdp17 worked.

I opened Terminal.app (instead of iTerm2), and I could ping pdp17 there.

Maybe that macOS Privacy and Security feature for the Local Network? That could explain why root can connect, and also why it works when run via SSH, since the SSH daemon’s parent is launchd. More information here; the relevant notes are:

macOS maintains separate local network privacy state for each user account.

macOS automatically allows local network access by:

  • Any daemon started by `launchd`
  • Any program running as root
  • Command-line tools run from Terminal or over SSH, including any child processes they spawn

important: The exception for `launchd` daemons doesn’t apply to `launchd` agents. If you’re building a `launchd` agent, see the discussion below.

But why would it work on some hosts on the same network? Anyway, it was permitted in System Preferences. Same verification with the firewall rules: there were none.

The breakthrough: Unified Logging

I checked Unified Logging while trying to connect in another session:

pineapple:~ kewl$ sudo log stream --style compact --info --debug  --predicate 'subsystem == "com.apple.networkextension"'
...
2026-11-18 14:03:37.774 I UserEventAgent[115:24bd5f] [com.apple.networkextension:] Got local network blocked notification: pid: 1711, uuid: 44250719-9DD6-396A-B5CD-51BFAD462FFE, bundle_id: (null)  
2026-11-18 14:03:37.774 E UserEventAgent[115:24bd5f] [com.apple.networkextension:] Failed to get the signing identifier for 1711: No such process  
2026-11-18 14:03:37.774 Db UserEventAgent[115:24bd5f] [com.apple.networkextension:] Signing identifier cache miss for 44250719-9DD6-396A-B5CD-51BFAD462FFE  
2026-11-18 14:03:37.774 I UserEventAgent[115:24bd5f] [com.apple.networkextension:] LocalNetwork: did not find bundle ID for UUID 44250719-9DD6-396A-B5CD-51BFAD462FFE  
2026-11-18 14:03:37.774 E UserEventAgent[115:24bd5f] [com.apple.networkextension:] Failed to find bundle ID, ignoring

PID 1711 no longer existed when I checked, and macOS couldn’t determine its signing identifier or associate it with an application bundle. Could a process have died? So it’s a process that isn’t allowed to connect, and it’s not iTerm2.

I later wanted to investigate what this PID could be, and my assumption that it wasn’t iTerm2 was both right and wrong: it was the PID of iTerm2 before it self-updated, and ended up with helper processes from versions 3.7.6 and 3.7.7 running simultaneously. Also, the bundle 44250719-9DD6-396A-B5CD-51BFAD462FFE?

I investigated the UUID reported in the Local Network blocked notification: 44250719-9DD6-396A-B5CD-51BFAD462FFE, and after discovering that components from both iTerm2 3.7.6 and 3.7.7 were still running, I checked the old application’s executable in my backup using dwarfdump –uuid, and it was a match!

When different tools disagree

Establishing the connection with netcat worked, but not with telnet:

pineapple:~ kewl$ nc -v pdp17 22
Connection to pdp17 port 22 [tcp/ssh] succeeded!
SSH-2.0-OpenSSH_10.0p2
^C
pineapple:~ kewl$ telnet pdp17 22
Trying 10.31.33.23...
telnet: connect to address 10.31.33.23: No route to host
telnet: Unable to connect to remote host

telnet is installed from Homebrew, but nc comes with the OS. I also inspected their code signature, which was irrelevant (the command used was: codesign -dv --verbose=4 "$(command -v nc)" 2>&1 ; replace nc with telnet and ssh)

Another interesting pattern was when forcing IPv4: ssh -4 pdp17 led to a stalled socket that didn’t time out for several minutes, but running ssh -4 10.31.33.23 connected to the host.

 SSH itself had another strange error; while most tools returned “No route to host”, SSH had its own message, which is quite obscure.

pineapple:~ kewl$ ssh pdp17 id
ssh: connect to host pdp17 port 22: Undefined error: 0

 But where it got interesting is when I added an argument to ssh, it connected:

pineapple:~ kewl$ ssh -o ConnectTimeout=3 pdp17 id
uid=1000(kewl) gid=1000(kewl) groups=1000(kewl),27(sudo),100(users)

 OpenSSH’s options affect the connection behaviour. It may change the connection to use non-blocking sockets.

And I found this web page where someone had a similar problem, where they mention:

So the evidence points to the blocking connect() to these mDNS-resolved IPv6 addresses failing on current macOS build, while the non-blocking path works. This could be a bug in this macOS build’s handling of mDNS-resolved scoped addresses, or something in the Local Network privacy layer.

The unexpected fix: disabling Bonjour in iTerm2

That blog post invited me to look towards mDNS. So I tried disabling Bonjour in iTerm2’s Magick settings. Then I opened a new tab, and it just connected.

I found a workaround which doesn’t require me to change my process, but it’s not the root cause.

One final observation

Disabling Bonjour in iTerm2 restored connectivity, but that doesn’t necessarily mean Bonjour was the problem.

After the troubleshooting session, I looked deeper into Unified Logging and found the UUID in macOS’s Local Network blocked notification matched the executable from the previous version of iTerm2, which I had upgraded the day before. Components from both versions were still running.

I suspect that the update left some stale application identity or network permission state, possibly interacting with iTerm2’s Bonjour integration, but it’s only a hypothesis.

So, maybe Bonjour was the trigger, the workaround reset something, or the two observations are related in another way.

One other detail I remembered after I wrote this text: I also disabled Wi-Fi to use my wired Gigabit Ethernet connection. That may have triggered a network-interface change while iTerm2 was running, possibly affecting Bonjour discovery or macOS’s Local Network privacy state. So the self-upgrade wasn’t necessarily the only trigger.

Below are the versions I used:

  • iTerm2: Build 3.7.7, but components of 3.7.6 and and 3.7.7 ended up running simultaneously.
  • macOS: Darwin pineapple 25.6.0 Darwin Kernel Version 25.6.0: Mon Oct 12 00:33:09 PDT 2026; root:xnu-12377.161.15.701.48~2/RELEASE_X86_64 x86_64
  • OpenSSH: OpenSSH_10.5p1, LibreSSL 3.3.6

The investigation was done on November 18, 2026.

What this taught me

The Network is the Computer, and the terminal emulator has opinions about both!

Leave a Reply

Your email address will not be published. Required fields are marked *