Erlang OTP crashes on IPV6 only enabled Windows

Rabbitmq fails to start on ipv6 only enabled windows server. Below is the crash generated

Thu Dec 8 05:35:35 2022
Slogan: Kernel pid terminated (application_controller) ({application_start_failure,rabbitmq_prelaunch,{{shutdown,{failed_to_start_child,prelaunch,failed_to_read_advanced_configuration_file}},{rabbit_prelaunch_app,start,[normal,[]]}}})
System version: Erlang/OTP 25 [erts-13.1.2] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [jit:ns]
Taints: crypto
Atoms: 13525
Calling Thread: scheduler:1
Scheduler Sleep Info Flags:
Scheduler Sleep Info Aux Work: THR_PRGR_LATER_OP
Current Port:
Run Queue Max Length: 0
Run Queue High Length: 0
Run Queue Normal Length: 0
Run Queue Low Length: 0
Run Queue Port Length: 0
Current Process: <0.0.0>
Current Process State: Running
Current Process Program counter: 0x000002ea0cfff9c0 (init:sleep/1 + 200)
Current Process Limited Stack Trace:
0x000002ea0bb05250:SReturn addr 0xD073840 (erlang:halt/1 + 144)
0x000002ea0bb05268:SReturn addr 0xCFFAEAC (init:boot_loop/2 + 2276)
0x000002ea0bb05288:SReturn addr 0xCFF1F38 ()

Followed the configuration suggested here Networking and RabbitMQ — RabbitMQ. Disabling the ipv6 only in config file will work fine but with ipv6 only it crashes

below is my erl_inetrc file contents

%% Tells DNS client on RabbitMQ nodes and CLI tools to resolve hostnames to IPv6 addresses.
%% The trailing dot is not optional.
{file, hosts, "C:\\Windows\\System32\\drivers\\etc\\hosts"}.

Below are the environment variables set

RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS = "-kernel inetrc 'C:\\erl_inetrc' -proto_dist inet6_tcp"

RABBITMQ_CTL_ERL_ARGS = "-proto_dist inet6_tcp"

Tried in both dual stack and ipv6 enabled windows environments without any luck

Is erlang OTP supported on IPV6 only environments?

1 Like

Erlang itself for sure works with IPv6 only hosts (all our infra works that way).
Based on the crash dump error, it appears to be thrown here: rabbitmq-server/rabbit_prelaunch_conf.erl at b924520e63d7212f084d7ec9dfcf4659f224d2b5 · rabbitmq/rabbitmq-server · GitHub

It means that this code: rabbitmq-server/rabbit_prelaunch_file.erl at b924520e63d7212f084d7ec9dfcf4659f224d2b5 · rabbitmq/rabbitmq-server · GitHub failed. Effectively RabbitMQ was not able to read the “advanced configuration file” for whataver reason. In most cases it means that the file is malformed (e.g. it does not contain valid Erlang terms, probably missing dot at the end).
I suggest to try running just erl and then using file:consult("/path/to/that/config_file") to see whether the file is well-formed. If it is, then it has to be something with case erl_prim_loader:get_file(Path) of - which indeed may not exactly understand IPv6, and you can also try that in the erl console.

1 Like