1

It seems I can run the rabbitmq-server command fine and it starts up but rabbitmqctl fails with an error so I can't stop it or do anything else.

~/rabbit/rabbitmq_server-3.7.15/sbin> 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

This is with Erlang/OTP 22 Erlang/OTP 22 [erts-10.4] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]

Am I missing a config or something?

MichaelB
  • 541
  • 4
  • 10
  • What operating system? How did you install Erlang and RabbitMQ? – Luke Bakken Jul 03 '19 at 13:40
  • SLES and OTP was built from source: https://www.erlang.org/downloads rabbit was just a download and untar. – MichaelB Jul 03 '19 at 14:04
  • Double-check your generic unix package's checksum: `$ sha256sum rabbitmq-server-generic-unix-3.7.15.tar.xz 4d70e4d057c6e40022369584626fd7c2bdaa24997aae5cc7f8f182c6d46456cf rabbitmq-server-generic-unix-3.7.15.tar.xz` – Luke Bakken Jul 03 '19 at 14:21
  • Also, what is the output of `which -a rabbitmqctl` when you are in the `sbin` dir? – Luke Bakken Jul 03 '19 at 14:26
  • `> sha256sum rabbitmq-server-generic-unix-3.7.15.tar.xz 4d70e4d057c6e40022369584626fd7c2bdaa24997aae5cc7f8f182c6d46456cf rabbitmq-server-generic-unix-3.7.15.tar.xz` and it doesn't matter how I run it... in that case I put it in my path but it always does the same regardless `~/rabbit/rabbitmq_server-3.7.15> ./sbin/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 ` – MichaelB Jul 03 '19 at 14:29
  • I would like to see the output of `which -a rabbitmqctl` when you haven't moved commands around. Also, `which -a erl` and `which -a escript`. I regularly run RabbitMQ this way for testing and development and have never seen this issue. – Luke Bakken Jul 03 '19 at 14:42
  • Without it in the path, it doesn't find it... `mb@localhost:~/rabbit/rabbitmq_server-3.7.15> which -a rabbitmqctl which: no rabbitmqctl in (/home/mb/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:/other/opt/java11/bin:/home/mb/opt/node/bin:/home/mb/local/bin) mb@localhost:~/rabbit/rabbitmq_server-3.7.15> which -a erl /home/mb/local/bin/erl mb@localhost:~/rabbit/rabbitmq_server-3.7.15> which -a escript /home/mb/local/bin/escript` – MichaelB Jul 03 '19 at 14:47
  • Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/95678/discussion-between-luke-bakken-and-michaelb). – Luke Bakken Jul 03 '19 at 15:04

1 Answers1

0

This can happen if you have mismatched binaries. For example, let's say your system has outdated versions of RabbitMQ and/or Erlang, installed via your package manager. If you then download the current version of RabbitMQ, such as the generic binary release, and try to run it, your $PATH may point to the outdated version of Erlang elsewhere on your system.

The solution (particularly if you don't have root access), is to install the correct version of Erlang and the update your $PATH to ensure that the sbin directory under RabbitMQ and the erl executable of the newer Erlang are ahead of any other directory that might point to the older versions.

Demitri
  • 105
  • 3