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.

Rohit Gupta
  • 356
  • 2
  • 4
  • 14

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
  • 580
  • 3
  • 5
  • erlang version: 13.0.4 OTP_release: 25 erlang packages was installed from ubuntu repository and compiled ejabberd from source code also the mentioned function "net_adm:ping('aaaa')" can be executed in my erlang installation but not in ejabberd debug console. – abby murali Apr 28 '23 at 07:06
  • I'm not able to execute the function in the debug console...can you suggest a solution .? – abby murali May 04 '23 at 07:39
  • I cannot reproduce your problem, so there's something weird in your installation. I compile ejabberd, install and start like this, then ping works: ./configure --with-rebar=`which rebar3` --prefix=/tmp/eja1 && make && make install && /tmp/eja1/sbin/ejabberdctl live – Badlop May 04 '23 at 11:21
  • I'm using ejabberd version 22.04 which was upgraded from version 21.12. While upgrading the versions, the configure script was not executed with the rebar version,rest all the steps are same as your's. – abby murali May 05 '23 at 11:29