macOS local network access protection preventing requests

Periodically macOS decides that my Erlang apps are not to be allowed access to the local network. This is despite me marking iTerm2 as an allowed app – and indeed ping in the terminal works just fine for local IPs. But running any Erlang app doesn’t. I get errors such as FailedToConnect(Posix("ehostunreach"), Posix("nxdomain")) (if in Gleam), or:

4> httpc:request(get, {"http://192.168.xxx.yyy", []}, [], []).
{error,{failed_connect,[{to_address,{"192.168.xxx.yyy",80}},
                        {inet,[inet],ehostunreach}]}}

I’ve fixed this issue once already, back in April, but for the life of me I can’t recall how. I’ve already tried sudo tccutil reset All com.googlecode.iterm2, to no avail. And as said, ping works just fine, it’s Erlang inside the terminal that doesn’t.

I don’t see beam.smp or anything Erlang related in the local network access settings panel.

I made this topic to:

  • get help if anyone knows what to try,
  • make this issue more searchable online, and
  • document what I do for myself for next time, because I’m bound to forget again. :smiley:

So if anyone has any ideas, let me know. Otherwise I’ll keep trying things and come back to this thread when I get it fixed.

Welp, I found my notes from last time:

Nicd — 30/04/2025, 20:29
after installing the latest OS update and running my Gleam backend again, the OS popped up the permission dialog and now it works :lucysweat:

Not really all that helpful considering I don’t even have an update to install this time. Hopefully we can find something more reliable.

I usually get them for the beam process itself whenever I install a new Erlang version. Perhaps you need to reset the permissions for the BEAM executable instead?

Problem is, I don’t know what to give tccutil for BEAM. iTerm2 is com.googlecode.iterm2, does BEAM have a reverse domain name? I also don’t see it in the settings dialog so there’s nothing to trigger there.

I’ve done two things now:

  • sudo tccutil reset All – did not do anything on its own.
  • Restarted the laptop.

My Erlang is working again! I’m not sure which one of those did the thing, so I’ll have to test when this happens again. Hopefully never, but I’m expecting the worst.

1 Like

:joy: Sad but safe.

1 Like