Score:1

eJabberd leave_cluster failing

mn flag

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. '[email protected]'
  2. '[email protected]'
  3. '[email protected]'

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

ejabberdctl leave_cluster '[email protected]'

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

ejabberd@ltxmpp2:~$ ejabberdctl leave_cluster '[email protected]'
Failed RPC connection to the node '[email protected]': {'EXIT', {undef,
[{erl_error, format_exception, [2,error,undef, [{net_adm, ping, ['[email protected]'],
[]}, {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: [email protected]

Can anyone please explain the reason for the error.

Score:0
ru flag

Installation : From Source

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

error, undef, [{net_adm, ping, ['[email protected]'], []},

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?

abby murali avatar
mn flag
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 avatar
mn flag
I'm not able to execute the function in the debug console...can you suggest a solution .?
Badlop avatar
ru flag
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
abby murali avatar
mn flag
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.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.