Related
I'm trying to deploy a Dockerfile to Heroku and when the app starts, it immediately crashes with this error:
=INFO REPORT==== 2-Apr-2022::16:20:30.959748 ===
Can't set long node name!
Please check your configuration
=SUPERVISOR REPORT==== 2-Apr-2022::16:20:30.960208 ===
supervisor: {local,net_sup}
errorContext: start_error
reason: {'EXIT',nodistribution}
offender: [{pid,undefined},
{id,net_kernel},
{mfargs,{net_kernel,start_link,
[[api#,longnames],true,net_sup]}},
{restart_type,permanent},
{significant,false},
{shutdown,2000},
{child_type,worker}]
=CRASH REPORT==== 2-Apr-2022::16:20:30.960246 ===
crasher:
initial call: net_kernel:init/1
pid: <0.3363.0>
registered_name: []
exception exit: {error,badarg}
in function gen_server:init_it/6 (gen_server.erl, line 407)
ancestors: [net_sup,kernel_sup,<0.3349.0>]
message_queue_len: 0
messages: []
links: [<0.3360.0>]
dictionary: [{longnames,true}]
trap_exit: true
status: running
heap_size: 987
stack_size: 28
reductions: 770
neighbours:
=SUPERVISOR REPORT==== 2-Apr-2022::16:20:30.963246 ===
supervisor: {local,kernel_sup}
errorContext: start_error
reason: {shutdown,
{failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}
offender: [{pid,undefined},
{id,net_sup},
{mfargs,{erl_distribution,start_link,[]}},
{restart_type,permanent},
{significant,false},
{shutdown,infinity},
{child_type,supervisor}]
=CRASH REPORT==== 2-Apr-2022::16:20:30.966821 ===
crasher:
initial call: application_master:init/4
pid: <0.3348.0>
registered_name: []
exception exit: {{shutdown,
{failed_to_start_child,net_sup,
{shutdown,
{failed_to_start_child,net_kernel,
{'EXIT',nodistribution}}}}},
{kernel,start,[normal,[]]}}
in function application_master:init/4 (application_master.erl, line 142)
ancestors: [<0.3347.0>]
message_queue_len: 1
messages: [{'EXIT',<0.3349.0>,normal}]
links: [<0.3347.0>,<0.3346.0>]
dictionary: []
trap_exit: true
status: running
heap_size: 610
stack_size: 28
reductions: 165
neighbours:
=INFO REPORT==== 2-Apr-2022::16:20:30.967283 ===
application: kernel
exited: {{shutdown,
{failed_to_start_child,net_sup,
{shutdown,
{failed_to_start_child,net_kernel,
{'EXIT',nodistribution}}}}},
{kernel,start,[normal,[]]}}
type: permanent
{"Kernel pid terminated",application_controller,"{application_start_failure,kernel,{{shutdown,{failed_to_start_child,net_sup,{shutdown,{failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}}},{kernel,start,[normal,[]]}}}"}
Kernel pid terminated (application_controller) ({application_start_failure,kernel,{{shutdown,{failed_to_start_child,net_sup,{shutdown,{failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}}},{ker
Crash dump is being written to: erl_crash.dump...done
Process exited with status 1
State changed from starting to crashed
Let me know if theres specific info you need to help me narrow the problem down.
Anyone have any ideas?
I had a rel/env.sh.eex file that was setting
export RELEASE_DISTRIBUTION=name
export RELEASE_NODE=api#${POD_IP}
where POD_IP was not set, causing the error.
You should check your pc's os hostname. It should contain ".",otherwise long name can't be used.
When running an EUnit test that tests an application or starts and stops (or tests killing of) gen_server or supervisor processs, error logger outputs crash reports and other messages by default:
$ rebar3 eunit 1s
===> Verifying dependencies...
===> Compiling my_app
===> Performing EUnit tests...
...........=INFO REPORT==== 5-Sep-2019::16:32:18.760457 ===
application: ranch
exited: stopped
type: temporary
=INFO REPORT==== 5-Sep-2019::16:32:18.760545 ===
application: xmerl
exited: stopped
type: temporary
=INFO REPORT==== 5-Sep-2019::16:32:18.763882 ===
application: my_app
exited: stopped
type: temporary
......=ERROR REPORT==== 5-Sep-2019::16:32:18.814431 ===
** Generic server my_app_sup terminating
** Last message in was {'EXIT',<0.279.0>,test_kill}
** When Server state == {state,
{local,my_app_sup},
simple_one_for_one,
{[undefined],
#{undefined =>
{child,undefined,undefined,
{my_app_server,start_link,[]},
transient,5000,worker,
[my_app_server]}}},
{maps,#{<0.355.0> => [my_app_test]}},
1,5,[],0,my_app_sup,[]}
** Reason for termination ==
** test_kill
=CRASH REPORT==== 5-Sep-2019::16:32:18.814598 ===
crasher:
initial call: supervisor:my_app_sup/1
pid: <0.354.0>
registered_name: my_app_sup
exception exit: test_kill
in function gen_server:decode_msg/9 (gen_server.erl, line 432)
ancestors: [<0.279.0>]
message_queue_len: 0
messages: []
links: []
dictionary: []
trap_exit: true
status: running
heap_size: 1598
stack_size: 27
reductions: 6463
neighbours:
...........
Finished in 0.457 seconds
28 tests, 0 failures
How can I avoid these expected messages during testing?
These can be avoided by temporarily disabling TTY reports in the error logger. Surround the code which produces the reports with this:
my_test() ->
error_logger:tty(false),
try
% code that produces error logger reports
after
error_logger:tty(true)
end.
If you use this many times in the tests, this wrapper can be useful:
without_error_logger(Fun) ->
error_logger:tty(false),
try
Fun()
after
error_logger:tty(true)
end.
Which is used like so:
without_error_logger(fun() ->
% code that produces error logger reports
end)
I am not familiar with erlang and new to ejabberd. I am getting following
error in crash.log.
2017-06-22 04:58:53 =CRASH REPORT====
crasher:
initial call: ejabberd_receiver:init/1
pid: <0.23584.370>
registered_name: []
exception exit: {{badarg,[{fxml_stream,new,[undefined,65536],[]},{ejabberd_receiver,handle_call,3,[{file,"src/ejabberd_receiver.erl"},{line,168}]},{gen_server,try_handle_call,4,[{file,"gen_server.erl"},{line,615}]},{gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,647}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]},[{gen_server,terminate,7,[{file,"gen_server.erl"},{line,812}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]}
ancestors: [<0.358.0>,ejabberd_listener,ejabberd_sup,<0.62.0>]
messages: []
links: []
dictionary: []
trap_exit: false
status: running
heap_size: 610
stack_size: 27
reductions: 275
neighbours:
2017-06-22 07:05:00 =ERROR REPORT====
** Generic server <0.25047.377> terminating
** Last message in was {become_controller,undefined}
** When Server state == {state,#Port<0.5706277>,gen_tcp,none,undefined,65536,undefined,infinity}
** Reason for termination ==
** {badarg,[{fxml_stream,new,[undefined,65536],[]},{ejabberd_receiver,handle_call,3,[{file,"src/ejabberd_receiver.erl"},{line,168}]},{gen_server,try_handle_call,4,[{file,"gen_server.erl"},{line,615}]},{gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,647}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]}
Can anybody help me understand the issue here?
There is the corresponding issue in the bugtracker which is already fixed.
RabbitMQ crashed.
RabbitMQ was working correctly for many days(10-15 days).
I am not getting why it got crashed.
I am using RabbitMQ 3.4.0 on Erlang 17.0
The erlang has created dump file for the crash. Which shows
eheap_alloc: Cannot allocate 229520 bytes of memory (of type "old_heap").
Also note that the rabbitmq publish-subscribe message load is very low. (max:1-2 messages/second).And RabbitMQ messages are processed as it comes so RabbitMQ is almost empty all the time. The disk space & memory are also sufficient.
More system info:
Limiting to approx 8092 file handles (7280 sockets)
Memory limit set to 6553MB of 16383MB total.
Disk free limit set to 50MB.
The RabbitMQ logs are as below.
=ERROR REPORT==== 18-Jul-2015::04:29:31 ===
** Generic server rabbit_disk_monitor terminating
** Last message in was update
** When Server state == {state,"c:/Users/jasmin.joshi/AppData/Roaming/RabbitMQ/db/rabbit#localhost-mnesia",
50000000,28358258688,100,10000,
#Ref<0.0.106.70488>,false}
** Reason for termination ==
** {eacces,[{erlang,open_port,
[{spawn,"C:\\Windows\\system32\\cmd.exe /c dir /-C /W \"c:/Users/jasmin.joshi/AppData/Roaming/RabbitMQ/db/rabbit#localhost-mnesia\""},
[stream,in,eof,hide]],
[]},
{os,cmd,1,[{file,"os.erl"},{line,204}]},
{rabbit_disk_monitor,get_disk_free,2,[]},
{rabbit_disk_monitor,internal_update,1,[]},
{rabbit_disk_monitor,handle_info,2,[]},
{gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,599}]},
{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]}
=INFO REPORT==== 18-Jul-2015::04:29:31 ===
Disabling disk free space monitoring on unsupported platform:
{{'EXIT',{eacces,[{erlang,open_port,
[{spawn,"C:\\Windows\\system32\\cmd.exe /c dir /-C /W \"c:/Users/jasmin.joshi/AppData/Roaming/RabbitMQ/db/rabbit#localhost-mnesia\""},
[stream,in,eof,hide]],
[]},
{os,cmd,1,[{file,"os.erl"},{line,204}]},
{rabbit_disk_monitor,get_disk_free,2,[]},
{rabbit_disk_monitor,init,1,[]},
{gen_server,init_it,6,[{file,"gen_server.erl"},{line,306}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,239}]}]}},
17179336704}
=INFO REPORT==== 18-Jul-2015::04:29:31 ===
Disabling disk free space monitoring on unsupported platform:
{{'EXIT',{eacces,[{erlang,open_port,
[{spawn,"C:\\Windows\\system32\\cmd.exe /c dir /-C /W \"c:/Users/jasmin.joshi/AppData/Roaming/RabbitMQ/db/rabbit#localhost-mnesia\""},
[stream,in,eof,hide]],
[]},
{os,cmd,1,[{file,"os.erl"},{line,204}]},
{rabbit_disk_monitor,get_disk_free,2,[]},
{rabbit_disk_monitor,init,1,[]},
{gen_server,init_it,6,[{file,"gen_server.erl"},{line,306}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,239}]}]}},
17179336704}
=CRASH REPORT==== 18-Jul-2015::04:29:31 ===
crasher:
initial call: rabbit_disk_monitor:init/1
pid: <0.167.0>
registered_name: rabbit_disk_monitor
exception exit: {eacces,
[{erlang,open_port,
[{spawn,
"C:\\Windows\\system32\\cmd.exe /c dir /-C /W \"c:/Users/jasmin.joshi/AppData/Roaming/RabbitMQ/db/rabbit#localhost-mnesia\""},
[stream,in,eof,hide]],
[]},
{os,cmd,1,[{file,"os.erl"},{line,204}]},
{rabbit_disk_monitor,get_disk_free,2,[]},
{rabbit_disk_monitor,internal_update,1,[]},
{rabbit_disk_monitor,handle_info,2,[]},
{gen_server,handle_msg,5,
[{file,"gen_server.erl"},{line,599}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,239}]}]}
in function gen_server:terminate/6 (gen_server.erl, line 746)
ancestors: [rabbit_disk_monitor_sup,rabbit_sup,<0.140.0>]
messages: []
links: [<0.166.0>]
dictionary: []
trap_exit: false
status: running
heap_size: 4185
stack_size: 27
reductions: 481081978
neighbours:
=SUPERVISOR REPORT==== 18-Jul-2015::04:29:31 ===
Supervisor: {local,rabbit_disk_monitor_sup}
Context: child_terminated
Reason: {eacces,
[{erlang,open_port,
[{spawn,
"C:\\Windows\\system32\\cmd.exe /c dir /-C /W \"c:/Users/jasmin.joshi/AppData/Roaming/RabbitMQ/db/rabbit#localhost-mnesia\""},
[stream,in,eof,hide]],
[]},
{os,cmd,1,[{file,"os.erl"},{line,204}]},
{rabbit_disk_monitor,get_disk_free,2,[]},
{rabbit_disk_monitor,internal_update,1,[]},
{rabbit_disk_monitor,handle_info,2,[]},
{gen_server,handle_msg,5,
[{file,"gen_server.erl"},{line,599}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,239}]}]}
Offender: [{pid,<0.167.0>},
{name,rabbit_disk_monitor},
{mfargs,{rabbit_disk_monitor,start_link,[50000000]}},
{restart_type,{transient,1}},
{shutdown,4294967295},
{child_type,worker}]
=CRASH REPORT==== 18-Jul-2015::04:29:31 ===
crasher:
initial call: rabbit_disk_monitor:init/1
pid: <0.24989.51>
registered_name: []
exception exit: unsupported_platform
in function gen_server:init_it/6 (gen_server.erl, line 322)
ancestors: [rabbit_disk_monitor_sup,rabbit_sup,<0.140.0>]
messages: []
links: [<0.166.0>]
dictionary: []
trap_exit: false
status: running
heap_size: 1598
stack_size: 27
reductions: 650
neighbours:
=SUPERVISOR REPORT==== 18-Jul-2015::04:29:31 ===
Supervisor: {local,rabbit_disk_monitor_sup}
Context: start_error
Reason: unsupported_platform
Offender: [{pid,<0.167.0>},
{name,rabbit_disk_monitor},
{mfargs,{rabbit_disk_monitor,start_link,[50000000]}},
{restart_type,{transient,1}},
{shutdown,4294967295},
{child_type,worker}]
=CRASH REPORT==== 18-Jul-2015::04:29:31 ===
crasher:
initial call: rabbit_disk_monitor:init/1
pid: <0.24991.51>
registered_name: []
exception exit: unsupported_platform
in function gen_server:init_it/6 (gen_server.erl, line 322)
ancestors: [rabbit_disk_monitor_sup,rabbit_sup,<0.140.0>]
messages: []
links: [<0.166.0>]
dictionary: []
trap_exit: false
status: running
heap_size: 1598
stack_size: 27
reductions: 650
neighbours:
=SUPERVISOR REPORT==== 18-Jul-2015::04:29:31 ===
Supervisor: {local,rabbit_disk_monitor_sup}
Context: start_error
Reason: unsupported_platform
Offender: [{pid,{restarting,<0.167.0>}},
{name,rabbit_disk_monitor},
{mfargs,{rabbit_disk_monitor,start_link,[50000000]}},
{restart_type,{transient,1}},
{shutdown,4294967295},
{child_type,worker}]
From the error message, rabbitmq can't open more files due to system limits.
You can set max open file numbers to upper value to avoid the problem.
https://serverfault.com/questions/249477/windows-server-2008-r2-max-open-files-limit
There are two unrelated errors here: one is the VM failure to allocate memory. Another is disk space monitor terminating. Disk space monitor is optional and on some less common platforms or with specific security restrictions, it is known to fail. That does not bring the VM down, and certainly has nothing to do with heap allocation failures.
The heap allocation failure typically comes down to two most common cases:
A known bug fixed in Erlang 17.x (don't recall which specific patch release, so use 17.5)
You run 32 bit Erlang/OTP on a 64 bit OS.
Chen Yu's comment about the EACCESS system call error is correct.
I get analog error
systemd unit for activation check: "rabbitmq-server.service"
eheap_alloc: Cannot allocate 306586976 bytes of memory (of type "heap").^M
^M
Crash dump is being written to: erl_crash.dump...done^M
ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 514979
max locked memory (kbytes, -l) 65536
max memory size (kbytes, -m) unlimited
open files (-n) 1048576
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 514979
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
this is crush dump
=erl_crash_dump:0.5
Wed Dec 2 17:16:31 2020
Slogan: eheap_alloc: Cannot allocate 306586976 bytes of memory (of type "heap").
System version: Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:32:32] [ds:32:32:10] [async-threads:512] [kernel-poll:true]
Compiled: Mon Feb 5 17:34:00 2018
Taints: crypto,asn1rt_nif,erl_tracer,zlib
Atoms: 34136
Calling Thread: scheduler:0
=scheduler:1
Scheduler Sleep Info Flags: SLEEPING | TSE_SLEEPING | WAITING
Scheduler Sleep Info Aux Work:
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
Run Queue Flags: OUT_OF_WORK | HALFTIME_OUT_OF_WORK
Current Process:
=scheduler:2
Scheduler Sleep Info Flags: SLEEPING | TSE_SLEEPING
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
Run Queue Flags: OUT_OF_WORK | HALFTIME_OUT_OF_WORK | NONEMPTY | EXEC
Current Process:
=scheduler:3
Scheduler Sleep Info Flags:
Scheduler Sleep Info Aux Work: DELAYED_AW_WAKEUP | DD | 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
Run Queue Flags: OUT_OF_WORK | HALFTIME_OUT_OF_WORK | NONEMPTY | EXEC
Current Process: <0.12306.0>
Current Process State: Running
Current Process Internal State: ACT_PRIO_NORMAL | USR_PRIO_NORMAL | PRQ_PRIO_NORMAL | ACTIVE | RUNNING | TRAP_EXIT | ON_HEAP_MSGQ
Current Process Program counter: 0x00007f2f3ab3a060 (unknown function)
Current Process CP: 0x0000000000000000 (invalid)
Current Process Limited Stack Trace:
0x00007f2b50252d68:SReturn addr 0x32A6EC98 (rabbit_channel:handle_method/3 + 6712)
0x00007f2b50252d78:SReturn addr 0x32A69630 (rabbit_channel:handle_cast/2 + 4160)
0x00007f2b50252df8:SReturn addr 0x51102708 (gen_server2:handle_msg/2 + 1808)
0x00007f2b50252e28:SReturn addr 0x3FD85E70 (proc_lib:init_p_do_apply/3 + 72)
0x00007f2b50252e48:SReturn addr 0x7FFB4948 (<terminate process normally>)
=scheduler:4
Scheduler Sleep Info Flags: SLEEPING | TSE_SLEEPING | WAITING
I'm trying to run the sellaprime example OTP application from Chapter 23 of Programming Erlang 2nd Ed. I have uploaded the code to https://github.com/myles-mcdonnell/sellaprime
After compiling with rebar I run erl from the root, then switch dir ..
1> c(src).
/Users/mylesmcdonnell/sellaprime/src
ok
then I load the app..
2> application:load(sellaprime).
ok
then I try to start the app..
3> application:start(sellaprime).
=CRASH REPORT==== 5-Feb-2015::09:55:34 ===
crasher:
initial call: application_master:init/4
pid: <0.48.0>
registered_name: []
exception exit: {bad_return,
{{sellaprime_app,start,[normal,[]]},
{'EXIT',
{undef,
[{sellaprime_app,start,[normal,[]],[]},
{application_master,start_supervisor,3,
[{file,"application_master.erl"},
{line,326}]},
{application_master,start_the_app,5,
[{file,"application_master.erl"},
{line,308}]},
{application_master,start_it_new,7,
[{file,"application_master.erl"},
{line,294}]}]}}}}
in function application_master:init/4 (application_master.erl, line 133)
ancestors: [<0.47.0>]
messages: [{'EXIT',<0.49.0>,normal}]
links: [<0.47.0>,<0.7.0>]
dictionary: []
trap_exit: true
status: running
heap_size: 610
stack_size: 27
reductions: 124
neighbours:
=INFO REPORT==== 5-Feb-2015::09:55:34 ===
application: sellaprime
exited: {bad_return,
{{sellaprime_app,start,[normal,[]]},
{'EXIT',
{undef,
[{sellaprime_app,start,[normal,[]],[]},
{application_master,start_supervisor,3,
[{file,"application_master.erl"},{line,326}]},
{application_master,start_the_app,5,
[{file,"application_master.erl"},{line,308}]},
{application_master,start_it_new,7,
[{file,"application_master.erl"},
{line,294}]}]}}}}
type: temporary
{error,
{bad_return,
{{sellaprime_app,start,[normal,[]]},
{'EXIT',
{undef,
[{sellaprime_app,start,[normal,[]],[]},
{application_master,start_supervisor,3,
[{file,"application_master.erl"},{line,326}]},
{application_master,start_the_app,5,
[{file,"application_master.erl"},{line,308}]},
{application_master,start_it_new,7,
[{file,"application_master.erl"},{line,294}]}]}}}}}
Clearly something is undefined but I'm struggling to determine what? I have lifted the code directly from the book download site with no changes.