Phoenix intallation issues: ** (stop) :eacces

I have Erlang/OTP 21, Elixir 1.6.6 installed on Windows 10. I’m attempting to install Phoenix 1.4.x. Following directions in Phoenix 1.4 beta book. I git cloned the Phoenix archive, installed Hex PM and then attempted to install Phoenix using the following command from the prompt and I get the following:

mix archive.install https://github.com/phoenixframework/archives/raw/master/1.4-dev/phx_new.ez

09:22:38.167 [error] GenServer :inet_gethost_native_sup terminating
** (stop) :eacces
erlang.erl:2213: :erlang.open_port({:spawn, 'inet_gethost 4 '}, [{:packet, 4}, :eof, :binary])
(kernel) inet_gethost_native.erl:184: :inet_gethost_native.server_init/2
Last message: {:EXIT, #PID<0.133.0>, {:eacces, [{:erlang, :open_port, [{:spawn, 'inet_gethost 4 '}, [{:packet, 4}, :eof, :binary]], [file: ‘erlang.erl’, line: 2213]}, {:inet_gethost_native, :server_init, 2, [file: ‘inet_gethost_native.erl’, line: 184]}]}}
State: {:state, :inet_gethost_native, :undefined, #PID<0.133.0>, {:local, :inet_gethost_native_sup}}

I also attempted to use other suggested readme instructions and still getting errors. Any assistance would be greatly appreciated.

Hi @wdtnh!

eacces looks like a permission issue. How did you install Elixir and Erlang/OTP? Could they have been installed in a privileged directory? What happens if you run your current console/terminal/powershell session as an administrator? Does the issue disappear?

1 Like

Also you should not install the development version of phx_new anymore, you should prefer mix archive.install hex phx_new 1.4.0 now.

That aside, it looks as if the BEAM process isn’t allowed to do outgoing connections. Please check your firewall and system policies.

1 Like

Thanks for the replies. No privilege directory and occurs as administrator. I modified my firewall to allow erl.exe through the firewall and I still have the issue. Now getting which suggests same thing is happening:

Failed to check for new Hex version
Failed to fetch record for 'hexpm/phx_new' from registry (using cache)
{:failed_connect, [{:to_address, {'repo.hex.pm', 443}}, {:inet, [:inet], {:eoptions, {:could_not_start_server, :inet_gethost_native}}}]}
{:failed_connect, [{:to_address, {'repo.hex.pm', 443}}, {:inet, [:inet], {:eoptions, {:could_not_start_server, :inet_gethost_native}}}]}

15:57:26.490 [error] GenServer :inet_gethost_native_sup terminating
** (stop) :eacces
    erlang.erl:2213: :erlang.open_port({:spawn, 'inet_gethost 4 '}, [{:packet, 4}, :eof, :binary])
    (kernel) inet_gethost_native.erl:184: :inet_gethost_native.server_init/2
Last message: {:EXIT, #PID<0.150.0>, {:eacces, [{:erlang, :open_port, [{:spawn, 'inet_gethost 4 '}, [{:packet, 4}, :eof, :binary]], [file: 'erlang.erl', line: 2213]}, {:inet_gethost_native, :server_init, 2, [file: 'inet_gethost_native.erl', line: 184]}]}}
State: {:state, :inet_gethost_native, :undefined, #PID<0.150.0>, {:local, :inet_gethost_native_sup}}

15:57:26.491 [error] Process #PID<0.150.0> raised an exception
** (ErlangError) Erlang error: :eacces
    erlang.erl:2213: :erlang.open_port({:spawn, 'inet_gethost 4 '}, [{:packet, 4}, :eof, :binary])
    (kernel) inet_gethost_native.erl:184: :inet_gethost_native.server_init/2
** (Mix) No package with name phx_new (from: mix.exs) in registry

And to clarify. I installed both erlang and elixir from available windows installers. I did not compile from source.

Disclaimer: I know very little about Windows or running Erlang on Windows, sorry.

The issue seems to be with the permissions of inet_gethost (.exe ?), which is a binary executable that is used (by default) to resolve DNS queries. It normally lives in the ERTS ‘bin’ directory, where the BEAM executable and the erl script live. You may want to try and run it directly from a command prompt (inet_gethost -h) and see if you get a more helpful error message.

It is possible to workaround this issue by creating a file called erl_inetrc with the following contents:

{lookup, [file, dns]}.

And then setting the following environment variable before running Erlang/Elixir/Mix: ERL_INETRC=/path/to/erl_inetrc

This does not address the issue with inet_gethost but it should allow DNS queries without relying on that executable. (See http://erlang.org/doc/apps/erts/inet_cfg.html#configuration-data for details on the Inet configuration)

1 Like

Thanks for the reply but no success. We can close this out.