1

eJabberd Version: 22.05
OS: Ubuntu 18.04 LTS
Installation : From Source

We've an ejabberd cluster with three nodes having the below listed node names.

  1. 'ejabberd@ltxmpp2.gims'
  2. 'ejabberd@ltxmpp1.gims'
  3. 'ejabberd@ltxmpp3.gims'

When we try to remove a node from the cluster using the command

ejabberdctl leave_cluster 'ejabberd@ltxmpp2.gims'

The command was issued on the node ltxmpp2.gims throwing error.

ejabberd@ltxmpp2:~$ ejabberdctl leave_cluster 'ejabberd@ltxmpp2.gims'
Failed RPC connection to the node 'ejabberd@ltxmpp2.gims': {'EXIT', {undef,
[{erl_error, format_exception, [2,error,undef, [{net_adm, ping, ['ejabberd@ltxmpp2.gims'],
[]}, {ejabberd_cluster_mnesia,
leave,1,
[{file, "src/ejabberd_cluster_mnesia.erl"},
{line,78}]}, {ejabberd_ctl, call_command, 4, [{file, "src/ejabberd_ctl.erl"},
{line, 332}]}, {ejabberd_ctl, try_call_command, 4, [{file, "src/ejabberd_ctl.erl"},
{line, 297}]}, {ejabberd_ctl, process2,4, [{file, "src/ejabberd_ctl.erl"},
{line, 235}]}, {ejabberd_ctl, process,2, [{file, "src/ejabberd_ctl.erl"},
{line, 213}]}, {erpc, execute_call, 4, [{file, "erpc.erl"},
{line, 392}]}], #Fun<misc.6.97582168>, #Fun<misc.7.97582168>], []},
{ejabberd_ctl, try_call_command, 4, [{file, "src/ejabberd_ctl.erl"},
{line,315}]}, {ejabberd_ctl, process2,4, [{file, "src/ejabberd_ctl.erl"},
{line,235}]}, {ejabberd_ctl, process,2, [{file, "src/ejabberd_ctl.erl"},
{line,213}]}, {ejabberd_ctl, process,1, []}]}}\

Commands to start an ejabberd node:

  start            Start in server mode
  foreground       Start in server mode (attached)
  foreground-quiet Start in server mode (attached), show only critical messages
  live             Start in interactive mode, with Erlang shell
  iexlive          Start in interactive mode, with Elixir shell

Commands to interact with a running ejabberd node:

  debug            Attach an interactive Erlang shell to a running node
  iexdebug         Attach an interactive Elixir shell to a running node
  etop             Attach to a running node and start Erlang Top
  ping             Send ping to the node, returns pong or pang
  started|stopped  Wait for the node to fully start|stop

Optional parameters when starting an ejabberd node:

  --config-dir dir   Config ejabberd:    /usr/local/etc/ejabberd
  --config file      Config ejabberd:    /usr/local/etc/ejabberd/ejabberd.yml
  --ctl-config file  Config ejabberdctl: /usr/local/etc/ejabberd/ejabberdctl.cfg
  --logs dir         Directory for logs: /usr/local/var/log/ejabberd
  --spool dir        Database spool dir: /usr/local/var/lib/ejabberd
  --node nodename    ejabberd node name: ejabberd@ltxmpp2.gims

Can anyone please explain the reason for the error.

1 Answers1

0

Installation : From Source

This means you installed erlang packages from ubuntu, and compiled ejabberd from source code.

error, undef, [{net_adm, ping, ['ejabberd@ltxmpp2.gims'], []},

If I understand correctly, the most relevant part of that long error message is that line.

That line may mean that either:

  • A) the erlang module net_adm.beam couldn't be found,
  • B) or the module doesn't include a function called ping with one argument.

Let's dig a little more in your installation to see what could be the exact problem.

A.1) The file net_adm.beam in ubuntu is included in the package erlang-base. Do you have that package installed?

https://packages.ubuntu.com/search?searchon=contents&keywords=net_adm.beam&mode=exactfilename&suite=kinetic&arch=any

Is it installed? Then:

A.2) Check yourself that the function net_adm:ping can be used in your erlang installation:

$ erl
Erlang/OTP 25 [erts-13.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit:ns]

Eshell V13.2 (abort with ^G) 1> net_adm:ping('aaaa').
pang 2> q().

Does it work in a simple erlang shell? Then:

A.3) Check in your ejabberd installation that the function net_adm:ping can be used:

$ ejabberdctl live
...
(ejabberd2@localhost)1> net_adm:ping('aaaa').
pang
(ejabberd2@localhost)2> q().
ok

B) That function was included in Erlang many time ago... What erlang version do you have installed?

Badlop
  • 670