Install at "pleroma mix deps.get" fails #10

Closed
opened 2019-11-19 00:54:43 +00:00 by llnu · 11 comments
Member

Alpine linux (4.19.80-0-vanilla) fresh install
Ipv6 only connection (with dns/nat64)

I can resolve repo.hex.pm (it has ipv6 address) and wget/curl the file.

/opt/pleroma# sudo -Hu pleroma mix deps.get
!!! RUNNING IN LOCALHOST DEV MODE! !!!
FEDERATION WON'T WORK UNTIL YOU CONFIGURE A dev.secret.exs
Could not find Hex, which is needed to build dependency :phoenix
Shall I install Hex? (if running non-interactively, use "mix local.hex --force") [Yn]
** (Mix) httpc request failed with: {:failed_connect, [{:to_address, {'repo.hex.pm', 443}}, {:inet, [:inet], :nxdomain}]}

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

Alpine linux (4.19.80-0-vanilla) fresh install Ipv6 only connection (with dns/nat64) I can resolve repo.hex.pm (it has ipv6 address) and wget/curl the file. /opt/pleroma# sudo -Hu pleroma mix deps.get \ !!! RUNNING IN LOCALHOST DEV MODE! !!! \ FEDERATION WON'T WORK UNTIL YOU CONFIGURE A dev.secret.exs \ Could not find Hex, which is needed to build dependency :phoenix \ Shall I install Hex? (if running non-interactively, use "mix local.hex --force") [Yn] \ `** (Mix) httpc request failed with: {:failed_connect, [{:to_address, {'repo.hex.pm', 443}}, {:inet, [:inet], :nxdomain}]}` `Could not install Hex because Mix could not download metadata at https://repo.hex.pm/installs/hex-1.x.csv.`

this is an ipv6 only setup?

this is an ipv6 only setup?
Author
Member

yes

yes

this might be the problem. @feld you tried something like this, right?

this might be the problem. @feld you tried something like this, right?
Author
Member

My vm can only speak ipv6, but with nat64 and fake ipv6 dns entries (dns64) I can connect to ipv4 only servers. There are a few corner cases where this setup fails:
The ipv4 address is hardcoded, or the application doesnt support ipv6 at all.

Im new to to the elixir env. Do you think this issue is solely caused my mix? If yes, I can open an issue there.

My vm can only speak ipv6, but with nat64 and fake ipv6 dns entries (dns64) I can connect to ipv4 only servers. There are a few corner cases where this setup fails: The ipv4 address is hardcoded, or the application doesnt support ipv6 at all. Im new to to the elixir env. Do you think this issue is solely caused my mix? If yes, I can open an issue there.

@plataformatec have you ever encountered this?

@plataformatec have you ever encountered this?
Member

This looks similar to https://github.com/hexpm/hex/issues/384 and it looks like an issue with ipv6.

Could you run this command in IEx session and paste the output?

iex> :inets.start(); :ssl.start(); :httpc.request(:get, {'https://repo.hex.pm/installs/hex-1.x.csv', []}, [], [])

If it's {:error, :nxdomain} then the problem is with how OTP handles ipv6.

This looks similar to https://github.com/hexpm/hex/issues/384 and it looks like an issue with ipv6. Could you run this command in IEx session and paste the output? ```elixir iex> :inets.start(); :ssl.start(); :httpc.request(:get, {'https://repo.hex.pm/installs/hex-1.x.csv', []}, [], []) ``` If it's `{:error, :nxdomain}` then the problem is with how OTP handles ipv6.
Author
Member
iex(1)> :inets.start(); :ssl.start(); :httpc.request(:get, {'https://repo.hex.pm/installs/hex-1.x.csv', []}, [], [])
{:error,
  {:failed_connect,
  [{:to_address, {'repo.hex.pm', 443}}, {:inet, [:inet], :enetunreach}]}}
iex(1)> :inets.start(); :ssl.start(); :httpc.request(:get, {'https://repo.hex.pm/installs/hex-1.x.csv', []}, [], []) {:error, {:failed_connect, [{:to_address, {'repo.hex.pm', 443}}, {:inet, [:inet], :enetunreach}]}}
Author
Member

Input from Nico:
It seems that the connection is tried via the inet protocol however it should be from the inet6 protocol.

Input from Nico: It seems that the connection is tried via the inet protocol however it should be from the inet6 protocol.

Good morning! I was wondering if there is anything I can do to support pleroma in IPv6 only situations?

Good morning! I was wondering if there is anything I can do to support pleroma in IPv6 only situations?

Well, figuring out why this happens and fixing that would be the best way to help :) Nobody on the team is probably too interested in this use case, so this is the perfect issue for an outside contributor.

Well, figuring out why this happens and fixing that would be the best way to help :) Nobody on the team is probably too interested in this use case, so this is the perfect issue for an outside contributor.
Owner

It's my understanding when talking with Kaniini that Erlang/BEAM isn't IPv6-only compatible, but I don't really know the details. You do need to enable ipv6 DNS resolution, though:

http://erlang.org/doc/apps/erts/inet_cfg.html:

{inet6, Bool}.
Bool = true | false

Tells the DNS client inet_res(3) to look up IPv6 addresses. Defaults to false.

You can enable inet6 support by creating a file like erl_inetrc with the following contents:

%% -- ERLANG INET CONFIGURATION FILE --
{inet6, true}.

and then you can make Pleroma use it by referencing a vm.args file with contents similar to this:

-kernel inetrc '"/usr/local/etc/pleroma/erl_inetrc"'

And finally make Pleroma use the vm.args with something like this:

elixir --erl '-args_file /usr/local/etc/pleroma/vm.args' -S mix phx.server

Anything related to IPv6 being broken with mix deps.get in Elixir should be directed upstream. It's a bug in Elixir then.

It's my understanding when talking with Kaniini that Erlang/BEAM isn't IPv6-only compatible, but I don't really know the details. You do need to enable ipv6 DNS resolution, though: http://erlang.org/doc/apps/erts/inet_cfg.html: ``` {inet6, Bool}. Bool = true | false Tells the DNS client inet_res(3) to look up IPv6 addresses. Defaults to false. ``` You can enable inet6 support by creating a file like `erl_inetrc` with the following contents: ``` %% -- ERLANG INET CONFIGURATION FILE -- {inet6, true}. ``` and then you can make Pleroma use it by referencing a `vm.args` file with contents similar to this: ``` -kernel inetrc '"/usr/local/etc/pleroma/erl_inetrc"' ``` And finally make Pleroma use the `vm.args` with something like this: `elixir --erl '-args_file /usr/local/etc/pleroma/vm.args' -S mix phx.server` Anything related to IPv6 being broken with `mix deps.get` in Elixir should be directed upstream. It's a bug in Elixir then.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
5 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pleroma/pleroma-support#10
No description provided.