Failed to deploy the latest rabbitmq? - rabbitmq

I install erlang(erlang-20.3.7-1.el7.centos.x86_64.rpm),the installed rabbimq(rabbitmq-server-3.7.6). When I check the node status, rabbitmqctl got the
crush message.Have I lost something? Many appritiation!
=INFO REPORT==== 20-Jun-2018::11:11:00.813218 ===
application: logger
exited: {{shutdown,
{failed_to_start_child,'Elixir.Logger.ErrorHandler',noproc}},
{'Elixir.Logger.App',start,[normal,[]]}}
type: temporary
Could not start application logger: Logger.App.start(:normal, []) returned an error: shutdown: failed to start child: Logger.ErrorHandler
** (EXIT) no process: the process is not alive or there's no process currently associated with the given name, possibly because its application isn't started

I just installed rabbitmq-server v3.7.6 and If you are running debian-based distro, makes sure you have pinned your esl-erlang and erlang* package to 20.3.x (see here for more detail). Also, makes sure /var/lib/rabbitmq directory belongs to rabbitmq user and group. If not, use chown -R rabbitmq:rabbitmq /var/lib/rabbitmq to fix it.
And finally, just install one of these packages, esl-erlang or erlang.
I saw that you type erlang-20.3.7-1.el7.centos.x86_64.rpm, but the latest version for v20.3.x branch is v20.3.6. Please check it again...
Read the rabbitmq compatibility with erlang/otp here. I already tested using above configuration, and it works perfectly after I typed sudo rabbitmq-ctl status.
If success, you may see below result.
Status of node rabbit#eternalbox ...
[{pid,28772},
{running_applications,
[{rabbit,"RabbitMQ","3.7.6"},
{mnesia,"MNESIA CXC 138 12","4.15.3"},
{rabbit_common,
"Modules shared by rabbitmq-server and rabbitmq-erlang-client",
"3.7.6"},
{ranch_proxy_protocol,"Ranch Proxy Protocol Transport","1.5.0"},
{ranch,"Socket acceptor pool for TCP protocols.","1.5.0"},
{ssl,"Erlang/OTP SSL application","8.2.6"},
{public_key,"Public key infrastructure","1.5.2"},
{asn1,"The Erlang ASN1 compiler version 5.0.5","5.0.5"},
{os_mon,"CPO CXC 138 46","2.4.4"},
{crypto,"CRYPTO","4.2.2"},
{jsx,"a streaming, evented json parsing toolkit","2.8.2"},
{xmerl,"XML parser","1.3.16"},
{inets,"INETS CXC 138 49","6.5.1"},
{recon,"Diagnostic tools for production use","2.3.2"},
{lager,"Erlang logging framework","3.5.1"},
{goldrush,"Erlang event stream processor","0.1.9"},
{compiler,"ERTS CXC 138 10","7.1.5"},
{syntax_tools,"Syntax tools","2.1.4"},
{syslog,"An RFC 3164 and RFC 5424 compliant logging framework.","3.4.2"},
{sasl,"SASL CXC 138 11","3.1.2"},
{stdlib,"ERTS CXC 138 10","3.4.5"},
{kernel,"ERTS CXC 138 10","5.4.3"}]},
{os,{unix,linux}},
{erlang_version,
"Erlang/OTP 20 [erts-9.3.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:128] [hipe] [kernel-poll:true]\n"},
{memory,
[{connection_readers,0},
{connection_writers,0},
{connection_channels,0},
{connection_other,0},
{queue_procs,0},
{queue_slave_procs,0},
{plugins,5936},
{other_proc,19686048},
{metrics,184824},
{mgmt_db,0},
{mnesia,73040},
{other_ets,1882432},
{binary,57352},
{msg_index,28976},
{code,25081646},
{atom,1041593},
{other_system,12953873},
{allocated_unused,16013176},
{reserved_unallocated,2306048},
{strategy,rss},
{total,[{erlang,60995720},{rss,79314944},{allocated,77008896}]}]},
{alarms,[]},
{listeners,[{clustering,25672,"::"},{amqp,5672,"::"}]},
{vm_memory_calculation_strategy,rss},
{vm_memory_high_watermark,0.4},
{vm_memory_limit,6579339264},
{disk_free_limit,50000000},
{disk_free,118526930944},
{file_descriptors,
[{total_limit,924},{total_used,2},{sockets_limit,829},{sockets_used,0}]},
{processes,[{limit,1048576},{used,211}]},
{run_queue,0},
{uptime,87},
{kernel,{net_ticktime,60}}]
Good luck!

because you are having the wrong version of the erlang to install it properly you need the latest erlang version 20.3 because the 21 version only works with rabbitmq version 3.7.6 beta.
To install rabbitmq and its dependency
sudo apt install rabbitmq-server erlang-base=1:20.3-1 erlang-syntax-tools=1:20.3-1 erlang-asn1=1:20.3-1 erlang-crypto=1:20.3-1 erlang-mnesia=1:20.3-1 erlang-runtime-tools=1:20.3-1 erlang-public-key=1:20.3-1 erlang-ssl=1:20.3-1 erlang-diameter=1:20.3-1 erlang-inets=1:20.3-1 erlang-xmerl=1:20.3-1 erlang-edoc=1:20.3-1 erlang-eldap=1:20.3-1 erlang-erl-docgen=1:20.3-1 erlang-eunit=1:20.3-1 erlang-ic=1:20.3-1 erlang-inviso=1:20.3-1 erlang-odbc=1:20.3-1 erlang-snmp=1:20.3-1 erlang-os-mon=1:20.3-1 erlang-parsetools=1:20.3-1 erlang-percept=1:20.3-1 erlang-ssh=1:20.3-1 erlang-tools=1:20.3-1 erlang-nox=1:20.3-1

Related

yaws built with crypto fails to start

I need to use hashed passwords for authentication in Yaws.
I've rebuilt it from source (https://github.com/klacke/yaws), with this sequence of commands:
./configure --enable-crypto --prefix=/some/local/path
make install
When I run yaws (/some/local/path/bin/yaws -i -erlarg "-boot start_sasl"), I get this error:
{"init terminating in do_boot",{{badmatch,{'EXIT',{badarg,[{erlang,list_to_existing_atom,["crypto"],[]},{yaws,'-start_app_deps/0-fun-0-',2,[{file,"yaws.erl"},{line,264}]},{lists,foldl,3,[{file,"lists.erl"},{line,1263}]},{yaws,start_app_deps,0,[{file,"yaws.erl"},{line,263}]},{yaws,start,0,[{file,"yaws.erl"},{line,209}]},{init,start_em,1,[]},{init,do_boot,3,[]}]}}},[{yaws,start,0,[{file,"yaws.erl"},{line,209}]},{init,start_em,1,[]},{init,do_boot,3,[]}]}}
The crypto library is present:
checking for Erlang/OTP 'crypto' library subdirectory... /usr/local/Cellar/erlang/19.2/lib/erlang/lib/crypto-3.7.2
checking for Erlang/OTP 'crypto' library version... 3.7.2
What is this problem caused by? Do I need to pass some specific options to run the newly built Yaws server?
When I run make test, all tests pass.
EDIT
Starting yaws with bin/yaws -i -erlarg "-init_debug" yields this output:
{progress,preloaded}
{progress,kernel_load_completed}
{progress,modules_loaded}
{start,heart}
{start,error_logger}
{start,application_controller}
{progress,init_kernel_started}
{apply,{application,load,[{application,stdlib,[{description,"ERTS CXC 138 10"},{vsn,"3.2"},{id,[]},{modules,[array,base64,beam_lib,binary,c,calendar,dets,dets_server,dets_sup,dets_utils,dets_v8,dets_v9,dict,digraph,digraph_utils,edlin,edlin_expand,epp,eval_bits,erl_anno,erl_bits,erl_compile,erl_eval,erl_expand_records,erl_internal,erl_lint,erl_parse,erl_posix_msg,erl_pp,erl_scan,erl_tar,error_logger_file_h,error_logger_tty_h,escript,ets,file_sorter,filelib,filename,gb_trees,gb_sets,gen,gen_event,gen_fsm,gen_server,gen_statem,io,io_lib,io_lib_format,io_lib_fread,io_lib_pretty,lib,lists,log_mf_h,maps,math,ms_transform,orddict,ordsets,otp_internal,pool,proc_lib,proplists,qlc,qlc_pt,queue,rand,random,re,sets,shell,shell_default,slave,sofs,string,supervisor,supervisor_bridge,sys,timer,unicode,win32reg,zip]},{registered,[timer_server,rsh_starter,take_over_monitor,pool_master,dets]},{applications,[kernel]},{included_applications,[]},{env,[]},{maxT,infinity},{maxP,infinity}]}]}}
{progress,applications_loaded}
{apply,{application,start_boot,[kernel,permanent]}}
Erlang/OTP 19 [erts-8.2] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:true] [dtrace]
{apply,{application,start_boot,[stdlib,permanent]}}
{apply,{application,start_boot,[sasl,permanent]}}
=PROGRESS REPORT==== 20-Nov-2018::14:09:57 ===
supervisor: {local,sasl_safe_sup}
started: [{pid,<0.60.0>},
{id,alarm_handler},
{mfargs,{alarm_handler,start_link,[]}},
{restart_type,permanent},
{shutdown,2000},
{child_type,worker}]
=PROGRESS REPORT==== 20-Nov-2018::14:09:57 ===
supervisor: {local,sasl_sup}
started: [{pid,<0.59.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==== 20-Nov-2018::14:09:57 ===
supervisor: {local,sasl_sup}
started: [{pid,<0.61.0>},
{id,release_handler},
{mfargs,{release_handler,start_link,[]}},
{restart_type,permanent},
{shutdown,2000},
{child_type,worker}]
{apply,{c,erlangrc,[]}}
=PROGRESS REPORT==== 20-Nov-2018::14:09:57 ===
application: sasl
started_at: nonode#nohost
{progress,started}
{"init terminating in do_boot",{{badmatch,{'EXIT',{badarg,[{erlang,list_to_existing_atom,["crypto"],[]},{yaws,'-start_app_deps/0-fun-0-',2,[{file,"yaws.erl"},{line,264}]},{lists,foldl,3,[{file,"lists.erl"},{line,1263}]},{yaws,start_app_deps,0,[{file,"yaws.erl"},{line,263}]},{yaws,start,0,[{file,"yaws.erl"},{line,209}]},{init,start_em,1,[]},{init,do_boot,3,[]}]}}},[{yaws,start,0,[{file,"yaws.erl"},{line,209}]},{init,start_em,1,[]},{init,do_boot,3,[]}]}}
init terminating in do_boot ()
It appears that the crypto service is not started.

RabbitMQ not starting with message "init terminating in do_boot, noproc" on Ubuntu 18.04

I cannot seem to start or install my RabbitMQ server anymore for my Ubuntu 18.04 anymore. I tried to remove and install it again, but it cannot finish the install because configuration fails. When I try to run sudo apt-get install --fix-broken. This is the result of it failing:
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 61 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up rabbitmq-server (3.6.10-1) ...
Job for rabbitmq-server.service failed because the control process exited with error code.
See "systemctl status rabbitmq-server.service" and "journalctl -xe" for details.
invoke-rc.d: initscript rabbitmq-server, action "start" failed.
● rabbitmq-server.service - RabbitMQ Messaging Server
Loaded: loaded (/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2018-08-22 09:16:51 EEST; 5ms ago
Process: 20997 ExecStartPost=/usr/lib/rabbitmq/bin/rabbitmq-server-wait (code=exited, status=70)
Process: 20996 ExecStart=/usr/sbin/rabbitmq-server (code=exited, status=0/SUCCESS)
Main PID: 20996 (code=exited, status=0/SUCCESS)
elo 22 09:16:48 ubuntu-dev systemd[1]: Starting RabbitMQ Messaging Server...
elo 22 09:16:49 ubuntu-dev rabbitmq[20997]: Waiting for 'rabbit#ubuntu-dev'
elo 22 09:16:49 ubuntu-dev rabbitmq[20997]: pid is 21001
elo 22 09:16:51 ubuntu-dev rabbitmq[20997]: Error: process_not_running
elo 22 09:16:51 ubuntu-dev systemd[1]: rabbitmq-server.service: Control process exited, code=exited status=70
elo 22 09:16:51 ubuntu-dev systemd[1]: rabbitmq-server.service: Failed with result 'exit-code'.
elo 22 09:16:51 ubuntu-dev systemd[1]: Failed to start RabbitMQ Messaging Server.
dpkg: error processing package rabbitmq-server (--configure):
installed rabbitmq-server package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
rabbitmq-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
Then when checking the log files they doesn't provide much more information either. Here is startup_err log file content:
init terminating in do_boot (noproc)
Crash dump is being written to: erl_crash.dump...done'
And here is startup_log file content:
BOOT FAILED
===========
Error description:
noproc
Log files (may contain more information):
/var/log/rabbitmq/rabbit.log
/var/log/rabbitmq/rabbit-sasl.log
Stack trace:
[{gen,do_for_proc,2,[{file,"gen.erl"},{line,228}]},
{gen_event,rpc,2,[{file,"gen_event.erl"},{line,239}]},
{rabbit,ensure_working_log_handlers,0,
[{file,"src/rabbit.erl"},{line,842}]},
{rabbit,'-boot/0-fun-0-',0,[{file,"src/rabbit.erl"},{line,281}]},
{rabbit,start_it,1,[{file,"src/rabbit.erl"},{line,417}]},
{init,start_em,1,[]},
{init,do_boot,3,[]}]
=INFO REPORT==== 22-Aug-2018::09:16:49.691453 ===
Error description:
noproc
Log files (may contain more information):
/var/log/rabbitmq/rabbit.log
/var/log/rabbitmq/rabbit-sasl.log
Stack trace:
[{gen,do_for_proc,2,[{file,"gen.erl"},{line,228}]},
{gen_event,rpc,2,[{file,"gen_event.erl"},{line,239}]},
{rabbit,ensure_working_log_handlers,0,
[{file,"src/rabbit.erl"},{line,842}]},
{rabbit,'-boot/0-fun-0-',0,[{file,"src/rabbit.erl"},{line,281}]},
{rabbit,start_it,1,[{file,"src/rabbit.erl"},{line,417}]},
{init,start_em,1,[]},
{init,do_boot,3,[]}]
{"init terminating in do_boot",noproc}
The other log files it claim to use for logging are empty. For example log file rabbit#ubuntu-dev.log and rabbit#ubuntu-dev-sasl.log.
I also found this post, which explains to check your hostname in /etc/hostname file but I checked and it's correct.
kazhu#ubuntu-dev:/var/log/rabbitmq$ cat /etc/hostname
ubuntu-dev
I also checked RabbitMQ troubleshoot guide and they said to check log folder permissions and they are right to my eye:
kazhu#ubuntu-dev:/var/log/rabbitmq$ ll
total 48
drwxr-xr-x 2 rabbitmq rabbitmq 4096 kesä 14 06:16 ./
drwxrwxr-x 16 root syslog 4096 elo 22 00:09 ../
-rw-r--r-- 1 rabbitmq rabbitmq 0 kesä 14 06:16 'rabbit#ubuntu-dev.log'
-rw-r--r-- 1 rabbitmq rabbitmq 5247 kesä 14 06:16 'rabbit#ubuntu-dev.log.1'
-rw-r--r-- 1 rabbitmq rabbitmq 954 touko 28 08:36 'rabbit#ubuntu-dev.log.2.gz'
-rw-r--r-- 1 rabbitmq rabbitmq 768 touko 21 07:11 'rabbit#ubuntu-dev.log.3.gz'
-rw-r--r-- 1 rabbitmq rabbitmq 708 touko 16 00:12 'rabbit#ubuntu-dev.log.4.gz'
-rw-r--r-- 1 rabbitmq rabbitmq 955 touko 7 07:26 'rabbit#ubuntu-dev.log.5.gz'
-rw-r--r-- 1 rabbitmq rabbitmq 4264 huhti 22 00:07 'rabbit#ubuntu-dev.log.6.gz'
-rw-r--r-- 1 rabbitmq rabbitmq 0 huhti 17 15:58 'rabbit#ubuntu-dev-sasl.log'
-rw-r--r-- 1 rabbitmq rabbitmq 95 elo 22 09:16 startup_err
-rw-r--r-- 1 rabbitmq rabbitmq 1212 elo 22 09:16 startup_log
Guide also stated that perl chrash dump file contains detailed information of the problem and requires Erlang expertises, which I don't have. So decided to upload the file to my Dropbox for you to see.
Can somebody help me solve this? I've tried some time myself but gave up because cannot figure out what the problem seems to be :/
I solved the problem with help of my colleague. I had installed newest erlang and rabbitmq from outside apt source separately. Now when I removed and purged everything related to rabbitmq and erlang, and removed the added apt sources too. Then I just ran sudo apt install rabbitmq-server and it wanted to install erlang packages too because of the dependency. And it installed and everything is working fine after that.
Wanted to share this solution if somebody else has the same problem as me.
UPDATE 9.12.2020:
Someone asked how I removed RabbitMQ and Erlang. I don't fully remember but I think I was following this guide: https://www.rabbitmq.com/install-debian.html.
The point is to remove the installed RabbitMQ and Erlang packages from added repositories and their configuration with
sudo apt purge rabbitmq-server erlang
You might need to search for rest of the erlang packages with
apt list | grep erlang
Then you need to remove added apt repositories. Usually added repositories in Ubuntu goes under /etc/apt/sources.list.d/ folder. Look for files names like rabbitmq and erlang. Make sure you are not deleting any other files!
After this run sudo apt update and apt should remove removed apt repositories. Then just running sudo apt install rabbitmq-server should do the trick and install Erlang package as a dependence. Of course installing this way you get much older version than using added repositories.

Automatically supply yes to phx.new prompts

I'm running this containerized instance of Phoenix.
The documentation says the following command can be run, but gives the error:
root#890ba3f1be37:/code# mix phx.new hello -y
** (Mix) Invalid option: -y
The environmental details are:
root#890ba3f1be37:/code# mix --version
Erlang/OTP 20 [erts-9.1] [source] [64-bit] [smp:1:1] [ds:1:1:10] [async-threads:10] [kernel-poll:false]
Mix 1.5.2
root#890ba3f1be37:/code# elixir --version
Erlang/OTP 20 [erts-9.1] [source] [64-bit] [smp:1:1] [ds:1:1:10] [async-threads:10] [kernel-poll:false]
Elixir 1.5.2
root#890ba3f1be37:/code# mix phx.new --version
Phoenix v1.3.0
Am I missing something here?
I believe the documentation is incorrect as the mix task unconditionally calls Mix.shell.yes?. You can instead pipe echo yes into mix phx.new ... to automatically respond to the prompt with yes.
echo yes | mix phx.new foo

Unable to restart Rabbitmq: badarg rpc.erl line 206

My RabbitMQ server seems to be running all the connections from Celery are refused.
Here is my status:
(venv) root#xyz:/var/log/rabbitmq# sudo -u rabbitmq rabbitmqctl status
Status of node rabbit#xyz ...
[{pid,673},
{running_applications,[{rabbit,"RabbitMQ","3.4.3"},
{os_mon,"CPO CXC 138 46","2.2.14"},
{xmerl,"XML parser","1.3.5"},
{sasl,"SASL CXC 138 11","2.3.4"},
{stdlib,"ERTS CXC 138 10","1.19.4"},
{kernel,"ERTS CXC 138 10","2.16.4"}]},
{os,{unix,linux}},
{erlang_version,"Erlang R16B03 (erts-5.10.4) [source] [64-bit] [smp:4:2] [async-threads:30] [kernel-poll:true]\n"},
{memory,[{total,40492248},
{connection_readers,0},
{connection_writers,0},
{connection_channels,0},
{connection_other,6856},
{queue_procs,2704},
{queue_slave_procs,0},
{plugins,0},
{other_proc,13684848},
{mnesia,0},
{mgmt_db,0},
{msg_index,2263632},
{other_ets,766920},
{binary,2761320},
{code,16179613},
{atom,561761},
{other_system,4264594}]},
{alarms,[]},
{listeners,[]},
{vm_memory_high_watermark,0.4},
{vm_memory_limit,858993459},
{disk_free_limit,50000000},
{disk_free,21639958528},
{file_descriptors,[{total_limit,924},
{total_used,3},
{sockets_limit,829},
{sockets_used,1}]},
{processes,[{limit,1048576},{used,106}]},
{run_queue,0},
{uptime,1619146}]
Here is what I get when I try to restart:
root#xyz:/var/log/rabbitmq# sudo -u rabbitmq rabbitmqctl stop
Stopping and halting node rabbit#xyz ...
Error: {badarg,[{erlang,group_leader,[undefined,<5172.10942.32>],[]},
{rabbit_log,with_local_io,1,[]},
{rabbit,stop_and_halt,0,[]},
{rpc,'-handle_call_call/6-fun-0-',5,
[{file,"rpc.erl"},{line,205}]}]}
Nothing outputs in the logs...
How can I restart my RabbitMQ server?

Configuring Erlang to work with SSL

Erlang version: R13B01
Currently I'm struggling trying to make Erlang work with SSL. The programming part was easy, but now starting the system SSL-enabled is not.
Following the Erlang SSL documentation:
1 - Made the start_ssl.rel file
{release, {"OTP APN 181 01","R13B01"}, {erts, "5.7.2"},
[{kernel,"2.13.2"},
{stdlib,"1.16.2"},
{sasl,"2.1.6"},
{os_mon,"2.2.2"},
{ssl,"3.10.3"}]}.
2 - Executed the following command
1> systools:make_script("start_ssl",[]).
According to the documentation, running the shell would output this (this output is from docs, not mine):
$ erl -boot /home/me/ssl/start_ssl
Erlang (BEAM) emulator version 5.0
Eshell V5.0 (abort with ^G)
1> whereis(ssl_server).
<0.32.0>
But, I'm receiving this instead:
erl -boot start_ssl
Erlang R13B01 (erts-5.7.2) [source] [smp:2:2] [rq:2] [async-threads:0] [kernel-poll:false]
1> whereis(ssl_server).
undefined
2>
So, for now, the remaining steps are failing too. Sadly, there is no documentation nor forum threads around the web with the same issue.
Any tips?
Well, after some try and error, I've managed to start the system:
application:start(ssl)
and passing all certificates when creating the listening socket
ssl:listen(Port, ?TCP_OPTIONS ++ [{ip, Host},{verify, 0},
{depth, 0},
{cacertfile, Cacertfile},
{certfile, Certfile},
{keyfile, Keyfile}])
It worked :)