macOS cannot use mix properly: connection to builds.hex.pm fails

Hey all,

I am not very active in this forum, but this time I might need your help.

Relevant versions: Elixir v1.16.3
macOS: 14.7.1 (issue was present in 14.6 though too)

I am trying to create a project on macOS, but unfortunately I am getting a very weird error when trying to add a dependency and running mix deps.get. This is the error:

Resolution completed in 0.182s
New:
finch 0.19.0
hpax 1.0.0
jason 1.4.4
mime 2.0.6
mint 1.6.2
nimble_options 1.1.1
nimble_pool 1.1.0
req 0.5.7
telemetry 1.3.0
** (Mix) httpc request failed with: {:failed_connect, [{:to_address, {~c"builds.hex.pm", 443}}, {:inet, [:inet], :ebadf}]}

Could not install Rebar because Mix could not download metadata at https://builds.hex.pm/installs/rebar3-1.x.csv.

Basically the only thing I did was running mix new test, and adding req in version 0.5.7 to the deps, then I ran mix deps.get.

The error I get is very weird. I do not think it is elixir specific though, since running curl yields the following:

  • Host builds.hex.pm:443 was resolved.
  • IPv6: (none)
  • IPv4: 151.101.65.91, 151.101.129.91, 151.101.193.91, 151.101.1.91
  • Trying 151.101.65.91:443…
  • connect to 151.101.65.91 port 443 from 10.3.10.54 port 51918 failed: Bad file descriptor
  • Trying 151.101.129.91:443…
  • connect to 151.101.129.91 port 443 from 10.3.10.54 port 51919 failed: Bad file descriptor
  • Trying 151.101.193.91:443…
  • connect to 151.101.193.91 port 443 from 10.3.10.54 port 51920 failed: Bad file descriptor
  • Trying 151.101.1.91:443…
  • connect to 151.101.1.91 port 443 from 10.3.10.54 port 51921 failed: Bad file descriptor
  • Failed to connect to builds.hex.pm port 443 after 60 ms: Couldn’t connect to server
  • Closing connection
    curl: (7) Failed to connect to builds.hex.pm port 443 after 60 ms: Couldn’t connect to server

Furthermore, no browser can connect to the page (I get ERR_INVALID_HANDLE on Chrome which I have never seen before), and it works on an Arch machine I have lying around. It seems to be specific to this macOS installation, but the builds page is the only page exhibiting this behavior.

Is there anyone having an idea what could be behind this? Thanks in advance for any suggestions!

Thanks! :smiley:

Any firewalls or antiviruses?

It’s a working machine. It uses SentinelOne as an antivirus. Just confirmed with a colleague, he gets the same error when calling the page.

But does he also use the antivirus?

Yes, he does. It’s not something one can easily disable. It still seems weird to me that no other page does this, what kind of bad file descriptor could this be?

The error itself does not matter much, it’s something you get when an agent along the way blocks stuff is what I noticed before in more closed-up environments, though I can’t tell for sure it’s what going on in your case. Simply sharing past experience.

I just upgraded the dependencies of a toy project of mine with no issues so I can tell you the servers are alive and well.

Did you use macOS too? On a linux machine this worked too without issues.

Yes, I am on the latest macOS though – 15.1.

No antiviruses or firewalls either.

Hmm, then I guess the setup is too specific at the moment. Thanks for checking and the suggestions though.