When I type iex command to start Elixir shell, it prompts the following error, I have no idea what is wrong, tried to reinstall erlang and elixir, but not works.
The error message :
Erlang/OTP 17 [erts-6.4] [source] [64-bit] [smp:4:4] [async- threads:10] [kernel-poll:false]
*** ERROR: Shell process terminated! (^G to start new job) ***
=INFO REPORT==== 8-Apr-2015::17:55:56 ===
application: elixir
exited: {bad_return,
{{elixir,start,[normal,[]]},
{'EXIT',
{{badmatch,{error,enotsup}},
[{elixir,start,2,[{file,"src/elixir.erl"},{line,34}]},
{application_master,start_it_old,4,
[{file,"application_master.erl"},{line,272}]}]}}}}
type: temporary
=INFO REPORT==== 8-Apr-2015::17:55:56 ===
application: syntax_tools
exited: stopped
type: temporary
=INFO REPORT==== 8-Apr-2015::17:55:56 ===
application: compiler
exited: stopped
type: temporary
=INFO REPORT==== 8-Apr-2015::17:55:56 ===
application: crypto
exited: stopped
type: temporary
=ERROR REPORT==== 8-Apr-2015::17:55:56 ===
Error in process <0.27.0> with exit value: {{badmatch,{error,{elixir, {bad_return,{{elixir,start,[normal,[]]},{'EXIT',{{badmatch,{error,enotsup}},[{elixir,start,2,[{file,"src/elixir.erl"},{line,34}]},{application_master,start_it_old,4,[{file,"application_master....
Elixir v1.0.3 does not work with Erlang 17.5. You need to either update Elixir to v1.0.4 or downgrade Erlang to 17.4.
the error enotsup denotes an operation not supported on your platform. check if elixir is correctly compiled, the error occurs at the very beginning of the elixir startup.
Related
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'm using Erlang/OTP 20 on macOS. Eshell prints multiple lines with heading "PROGRESS REPORT", I want it to not print that.
Inverse greping and similar work around are not desirable.
Here's a sample of statements getting printed:
=PROGRESS REPORT==== 28-Aug-2017::22:39:40 ===
supervisor: {local,sasl_safe_sup}
started: [{pid,<0.59.0>},
{id,alarm_handler},
{mfargs,{alarm_handler,start_link,[]}},
{restart_type,permanent},
{shutdown,2000},
{child_type,worker}]
=PROGRESS REPORT==== 28-Aug-2017::22:39:40 ===
supervisor: {local,sasl_sup}
started: [{pid,<0.58.0>},
{id,sasl_safe_sup},
{mfargs,
{supervisor,start_link,
[{local,sasl_safe_sup},sasl,safe]}},
{restart_type,permanent},
{shutdown,infinity},
{child_type,supervisor}]
=PROGRESS REPORT==== 28-Aug-2017::22:39:40 ===
supervisor: {local,sasl_sup}
started: [{pid,<0.60.0>},
{id,release_handler},
{mfargs,{release_handler,start_link,[]}},
{restart_type,permanent},
{shutdown,2000},
{child_type,worker}]
As described in the documentation for the sasl application, you can suppress progress reports by setting the configuration parameter errlog_type to error.
You can specify it on the command line:
erl -sasl errlog_type error
Or, if you're using a sys.config file, add it there:
{sasl, [{errlog_type, error}]}
Setting it with application:set_env after the node has started won't work: it only takes effect if the value was set before the sasl application started.
If you don't want the SASL app to start at all you can use a different boot script:
erl -boot start_clean
This will disable SASL messages completely.
My rabbitMQ service is crashing as soon as I start it. The service was running fine for last two years but suddenly, it stopped working. I looked at the log and saw this:
=INFO REPORT==== 8-Oct-2015::11:40:56 ===
Starting RabbitMQ 3.0.2 on Erlang R16B
=INFO REPORT==== 8-Oct-2015::11:40:56 ===
Limiting to approx 8092 file handles (7280 sockets)
=WARNING REPORT==== 8-Oct-2015::11:40:56 ===
Only 2048MB of 4095MB memory usable due to limited address space.
=INFO REPORT==== 8-Oct-2015::11:40:56 ===
Memory limit set to 819MB of 4095MB total.
=INFO REPORT==== 8-Oct-2015::11:40:56 ===
Disk free limit set to 1000MB
=INFO REPORT==== 8-Oct-2015::11:40:56 ===
msg_store_transient: using rabbit_msg_store_ets_index to provide index
=INFO REPORT==== 8-Oct-2015::11:40:56 ===
msg_store_persistent: using rabbit_msg_store_ets_index to provide index
=INFO REPORT==== 8-Oct-2015::11:40:56 ===
started TCP Listener on [::]:5672
=ERROR REPORT==== 8-Oct-2015::11:40:56 ===
Error in process
So I decided to run following commad:
rabbitmqctl set_vm_memory_high_watermark 0.5
it gives following error:
Setting memory threshold on rabbit#sn4324324 to 0.5 ...
Error: unable to connect to node rabbit#sn4324324: nodedown
DIAGNOSTICS
===========
nodes in question: [rabbit#sn4324324]
hosts, their running nodes and ports:
- sn4324324: [{rabbitmqctl601389,64542}]
current node details:
- node name: rabbitmqctl601389#sn4324324
- home dir: C:\Users\TestUser
- cookie hash: /GF4XhumN66/5SsNp0a8gQ==
How can I set th value for set_vm_memory_high_watermark
I have a debian box running tasks with celery and rabbitmq for about a year. Recently I noticed tasks were not being processed so I logged into the system and noticed that celery could not connect to rabbitmq. I restarted rabbitmq-server and even though celery was not complaining anymore it was not executing new tasks now. The odd thing was that rabbitmq was devouring cpu and memory resources like crazy. Restarting server would not solve the problem. After spending couple hours looking for solution online to no avail I decided to rebuild the server.
I rebuilt new server with Debian 7.5, rabbitmq 2.8.4, celery 3.1.13 (Cipater). For about an hour or so everything worked beautifully again until celery started complaining again that it can't connect to rabbitmq!
[2014-08-06 05:17:21,036: ERROR/MainProcess] consumer: Cannot connect to amqp://guest:**#127.0.0.1:5672//: [Errno 111] Connection refused.
Trying again in 6.00 seconds...
I restarted rabbitmq service rabbitmq-server start and same issue gain:
rabbitmq started again swelling up constantly pounding on cpu and slowly taking over all ram and swap:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
21823 rabbitmq 20 0 908m 488m 3900 S 731.2 49.4 9:44.74 beam.smp
Here's the result on rabbitmqctl status:
Status of node 'rabbit#li370-61' ...
[{pid,21823},
{running_applications,[{rabbit,"RabbitMQ","2.8.4"},
{os_mon,"CPO CXC 138 46","2.2.9"},
{sasl,"SASL CXC 138 11","2.2.1"},
{mnesia,"MNESIA CXC 138 12","4.7"},
{stdlib,"ERTS CXC 138 10","1.18.1"},
{kernel,"ERTS CXC 138 10","2.15.1"}]},
{os,{unix,linux}},
{erlang_version,"Erlang R15B01 (erts-5.9.1) [source] [64-bit] [smp:8:8] [async-threads:30] [kernel-poll:true]\n"},
{memory,[{total,489341272},
{processes,462841967},
{processes_used,462685207},
{system,26499305},
{atom,504409},
{atom_used,473810},
{binary,98752},
{code,11874771},
{ets,6695040}]},
{vm_memory_high_watermark,0.3999999992280962},
{vm_memory_limit,414559436},
{disk_free_limit,1000000000},
{disk_free,48346546176},
{file_descriptors,[{total_limit,924},
{total_used,924},
{sockets_limit,829},
{sockets_used,3}]},
{processes,[{limit,1048576},{used,1354}]},
{run_queue,0},
Some entries from /var/log/rabbitmq:
=WARNING REPORT==== 8-Aug-2014::00:11:35 ===
Mnesia('rabbit#li370-61'): ** WARNING ** Mnesia is overloaded: {dump_log,
write_threshold}
=WARNING REPORT==== 8-Aug-2014::00:11:35 ===
Mnesia('rabbit#li370-61'): ** WARNING ** Mnesia is overloaded: {dump_log,
write_threshold}
=WARNING REPORT==== 8-Aug-2014::00:11:35 ===
Mnesia('rabbit#li370-61'): ** WARNING ** Mnesia is overloaded: {dump_log,
write_threshold}
=WARNING REPORT==== 8-Aug-2014::00:11:35 ===
Mnesia('rabbit#li370-61'): ** WARNING ** Mnesia is overloaded: {dump_log,
write_threshold}
=WARNING REPORT==== 8-Aug-2014::00:11:36 ===
Mnesia('rabbit#li370-61'): ** WARNING ** Mnesia is overloaded: {dump_log,
write_threshold}
=INFO REPORT==== 8-Aug-2014::00:11:36 ===
vm_memory_high_watermark set. Memory used:422283840 allowed:414559436
=WARNING REPORT==== 8-Aug-2014::00:11:36 ===
memory resource limit alarm set on node 'rabbit#li370-61'.
**********************************************************
*** Publishers will be blocked until this alarm clears ***
**********************************************************
=INFO REPORT==== 8-Aug-2014::00:11:43 ===
started TCP Listener on [::]:5672
=INFO REPORT==== 8-Aug-2014::00:11:44 ===
vm_memory_high_watermark clear. Memory used:290424384 allowed:414559436
=WARNING REPORT==== 8-Aug-2014::00:11:44 ===
memory resource limit alarm cleared on node 'rabbit#li370-61'
=INFO REPORT==== 8-Aug-2014::00:11:59 ===
vm_memory_high_watermark set. Memory used:414584504 allowed:414559436
=WARNING REPORT==== 8-Aug-2014::00:11:59 ===
memory resource limit alarm set on node 'rabbit#li370-61'.
**********************************************************
*** Publishers will be blocked until this alarm clears ***
**********************************************************
=INFO REPORT==== 8-Aug-2014::00:12:00 ===
vm_memory_high_watermark clear. Memory used:411143496 allowed:414559436
=WARNING REPORT==== 8-Aug-2014::00:12:00 ===
memory resource limit alarm cleared on node 'rabbit#li370-61'
=INFO REPORT==== 8-Aug-2014::00:12:01 ===
vm_memory_high_watermark set. Memory used:415563120 allowed:414559436
=WARNING REPORT==== 8-Aug-2014::00:12:01 ===
memory resource limit alarm set on node 'rabbit#li370-61'.
**********************************************************
*** Publishers will be blocked until this alarm clears ***
**********************************************************
=INFO REPORT==== 8-Aug-2014::00:12:07 ===
Server startup complete; 0 plugins started.
=ERROR REPORT==== 8-Aug-2014::00:15:32 ===
** Generic server rabbit_disk_monitor terminating
** Last message in was update
** When Server state == {state,"/var/lib/rabbitmq/mnesia/rabbit#li370-61",
50000000,46946492416,100,10000,
#Ref<0.0.1.79456>,false}
** Reason for termination ==
** {unparseable,[]}
=INFO REPORT==== 8-Aug-2014::00:15:37 ===
Disk free limit set to 50MB
=ERROR REPORT==== 8-Aug-2014::00:16:03 ===
** Generic server rabbit_disk_monitor terminating
** Last message in was update
** When Server state == {state,"/var/lib/rabbitmq/mnesia/rabbit#li370-61",
50000000,46946426880,100,10000,
#Ref<0.0.1.80930>,false}
** Reason for termination ==
** {unparseable,[]}
=INFO REPORT==== 8-Aug-2014::00:16:05 ===
Disk free limit set to 50MB
UPDATE:
Seems like problem was solved when installed newest version of rabbitmq (3.3.4-1) from rabbitmq.com repository. Originally I had one installed (2.8.4) from Debian repositories. So far rabbitmq-server is working smoothly. I will update this post if issue comes back.
UPDATE:
Unfortunately after about 24 hours the issue reappeared where rabbitmq shut down and restarting the process would make it consume resources until it shuts down again within minutes.
Finally I found the solution. These posts helped to figure this out.
RabbitMQ on EC2 Consuming Tons of CPU
and
https://serverfault.com/questions/337982/how-do-i-restart-rabbitmq-after-switching-machines
What happened was rabbitmq was holding on to all the results that were never freed to the point it became overloaded. I cleared all the stale data in /var/lib/rabbitmq/mnesia/rabbit/, restarted rabbit and it works fine now.
My solution was to disable storing results alltogether with CELERY_IGNORE_RESULT = True in the Celery config file to assure this does not happen again.
You can also reset the queue:
Warning: This clears all data and configuration! Use with caution.
sudo service rabbitmq-server start
sudo rabbitmqctl stop_app
sudo rabbitmqctl reset
sudo rabbitmqctl start_app
You might need to run these command right after rebooting if your system is not responding.
You are running out the memory resources because of celery, I got a similar issue and it was a problem with the queues used by celery backend result.
You can check how many queues there are using rabbitmqctl list_queues command, take attention if that number grows forever. In that case check out your celery use.
About celery, if you are not getting the results as asycronous events dont configure a backend for store those unused results.
I experienced a similar issue and it turned out to be due to some rogue RabbitMQ client applications.
The issue seems to have been that due to some un-handled error, the rogue application was continuously trying to make a connection to the RabbitMQ broker.
Once the client applications were restarted, everything went back to normal (since the application stopped malfunctioning and there for stopped trying to make a connection to RabbitMQ in an endless loop)
Another possible cause: The management-plugin.
I'm running RabbitMQ 3.8.1 with enabled management-plugin.
On a 10-core server I had up to 1000% CPU-usage with 3 idle consumers and not a single message being sent, and one queue.
When I disabled the management-plugin by executing rabbitmq-plugins disable rabbitmq_management the usage dropped to 0% with occasional spikes of 200%.
When I am trying to install yaws 1.89, the error bellow is raised. Please help me to overcome that error.
~/yaws$ sudo yaws
Erlang R16B03 (erts-5.10.4) [source] [64-bit] [smp:4:4] [async-threads:10] [kernel-poll:true]
Eshell V5.10.4 (abort with ^G)
1> =ERROR REPORT==== 14-Mar-2014::15:05:09 ===
Failed to load setuid_drv (from "/usr/local/lib/yaws/priv/lib") : "Driver compiled with incorrect version of erl_driver.h"
=ERROR REPORT==== 14-Mar-2014::15:05:09 ===
FATAL {'EXIT',normal}
=INFO REPORT==== 14-Mar-2014::15:05:09 ===
application: yaws
exited: {{shutdown,
{failed_to_start_child,yaws_server,
{badconf,
[{yaws_server,init,1,
[{file,"yaws_server.erl"},{line,159}]},
{gen_server,init_it,6,
[{file,"gen_server.erl"},{line,304}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,239}]}]}}},
{yaws_app,start,[normal,[]]}}
type: permanent
{"Kernel pid terminated",application_controller,"{application_start_failure,yaws,{{shutdown,{failed_to_start_child,yaws_server,{badconf,[{yaws_server,init,1,[{file,\"yaws_server.erl\"},{line,159}]},{gen_server,init_it,6,[{file,\"gen_server.erl\"},{line,304}]},{proc_lib,init_p_do_apply,3,[{file,\"proc_lib.erl\"},{line,239}]}]}}},{yaws_app,start,[normal,[]]}}}"}
Crash dump was written to: erl_crash.dump
Kernel pid terminated (application_controller) ({application_start_failure,yaws,{{shutdown,{failed_to_start_child,yaws_server,{badconf,[{yaws_server,init,1,[{file,"yaws_server.erl"},{line,159}]},{ge
Yaws 1.89 was released in September 2010, but you're trying to run it on a newer version of Erlang, R16B03, which was released in December 2013. The drivers Yaws uses, which are compiled native code, were compiled using a version of the Erlang driver interface that doesn't match that of the Erlang version you're running, which is what causes the error messages you're seeing.
Your comment above hints that you were able to get it working by downloading yaws-1.89.tar.gz and building it yourself; if so, then yes, that's a good way to get it working with your current version of Erlang. But a better way would be to use a newer version of Yaws — the latest version at this time of writing is Yaws 1.98, released in November 2013.