Unable to start RabbitMQ: undefined function rabbitmqctl_escript:main/1

4.4k views Asked by At

I would like to start RabbitMQ installed as JFrog Xray and I get:

-bash-4.2$ /opt/jfrog/xray/app/third-party/rabbitmq/escript/rabbitmqctl
escript: exception error: undefined function rabbitmqctl_escript:main/1
  in function  escript:run/2 (escript.erl, line 758)
  in call from escript:start/1 (escript.erl, line 277)
  in call from init:start_em/1
  in call from init:do_boot/3

I know that this is not the standard way to start the service, this is already a result of 3 days fighting!

Escript check says:

-bash-4.2$ escript -s /opt/jfrog/xray/app/third-party/rabbitmq/escript/rabbitmqctl
escript: Cannot load module rabbitmqctl_escript from archive

Versions installed:

# rpm -qa | grep 'erlang\|xray\|socat'
socat-1.7.3.2-2.el7.x86_64
erlang-22.3.4-1.el7.x86_64
xray-3.8.6-1.el6.x86_64

RabbitMQ is part of Xray. Version: RabbitMQ 3.8.3 It starts by using sbin/rabbitmq-server, but as Xray is using the rabbitmqctl, it should be used as well.

2

There are 2 answers

2
Rahul On

uninstall RabbitMQ and Erlang/OTP and then reinstall. make sure all erlang versions are uninstalled and then reinstall only one and then it's compatible RabbitMQ version. this worked for me.

Edit 1 In my case, I didn't realize that my system has more then one erlang installed and I installed a new erlang and rabbit mq. when even new versions were not working I spent almost 2 days searching for answers. but then I just read some information where they were saying that only one version of erlang should be installed in a system. so I checked and found out there are 3 erlang versions were installed. then I removed everything and fresh installed erlang and then rabbit mq. and this worked for me.

0
Michael Thelin On

Resolved this issue by removing a soft link to the RabbitMQ-directory, which was used in PATH and other environmental variables.