erlang crashes when starting ejabberd after adding a host in ejabberd.cfg

Starting ejabberd and got a crash dump. Process beam died. This happens after changing to node name (instead of the default "localhost"). In fact, I tried to change the node name and ejabberctl couldn't talk to the node, then I changed the node name again to see if I can make progress but still ejabberdctl can't communicate with the new node name.

Erlang R15B01 (erts-5.9.1)
ejabberd 2.1.11

After the innitial installation, ejabberd came up with the default node name ejabberd@localhost.
Since I changed the host to a different value "ejabberd.test" I can no longer start ejabberd.
It seems that the beam process crashes when starting ejabberd (can no longer be found):

[root@cp-linux1 ~]# ps -ef | grep beam
root 24823 7321 0 10:59 pts/0 00:00:00 grep beam
[root@cp-linux1 ~]# ps -ef | grep beam
root 24834 7321 0 10:59 pts/0 00:00:00 grep beam
[root@cp-linux1 ~]# ps -ef | grep epm
root 24771 1 0 10:53 ? 00:00:00 /usr/local/lib/erlang/erts-5.9.1/bin/epmd -daemon
root 24846 7321 0 11:01 pts/0 00:00:00 grep epm

ejabberd.cfg specific changes:

override_global.
override_local.

%% Admin user
{acl, admin, {user, "admin", "ejabberd.test"}}.

%% Hostname
{hosts, ["ejabberd.test"]}.

Last few lines of erlang.log:

=PROGRESS REPORT==== 31-Aug-2012::10:07:03 ===
application: mnesia
started_at: 'ejabberd@ejabberd.test'

=PROGRESS REPORT==== 31-Aug-2012::10:07:03 ===
supervisor: {local,crypto_sup}
started: [{pid,<0.107.0>},
{name,crypto_server},
{mfargs,{crypto_server,start_link,[]}},
{restart_type,permanent},
{shutdown,2000},
{child_type,worker}]

=PROGRESS REPORT==== 31-Aug-2012::10:07:03 ===
application: crypto
started_at: 'ejabberd@ejabberd.test'

=PROGRESS REPORT==== 31-Aug-2012::10:07:03 ===
supervisor: {local,stringprep_sup}
started: [{pid,<0.109.0>},
{name,stringprep},
{mfargs,{stringprep,start_link,[]}},
{restart_type,permanent},
{shutdown,brutal_kill},
{child_type,worker}]

=CRASH REPORT==== 31-Aug-2012::10:07:04 ===
crasher:
initial call: application_master:init/4
pid: <0.35.0>
registered_name: []
exception exit: {bad_return,{{ejabberd_app,start,[normal,[]]},
{'EXIT',"Error reading Mnesia database"}}}
in function application_master:init/4 (application_master.erl, line 138)
ancestors: [<0.34.0>]
messages: []
links: [<0.34.0>,<0.36.0>,<0.6.0>]
dictionary: []
trap_exit: true
status: running
heap_size: 987
stack_size: 24
reductions: 156
neighbours:

First few lines of crash dump:
=erl_crash_dump:0.1
Fri Aug 31 10:31:38 2012
Slogan: Kernel pid terminated (application_controller) ({application_start_failure,kernel,{shutdown,{kernel,start,[normal,[]]}}})
System version: Erlang R15B01 (erts-5.9.1) [source] [smp:2:2] [async-threads:0] [hipe] [kernel-poll:true]
Compiled: Wed Aug 29 14:36:55 2012
Taints:
Atoms: 4798
=memory
total: 10960784
processes: 1157575
processes_used: 1151754
system: 9803209
atom: 98917
atom_used: 80300
binary: 23048
code: 1227009
ets: 29532

I'm also trying to follow the instructions in:
http://www.process-one.net/docs/ejabberd/guide_en.pdf
Section 4.5 (Converting to new host name)
but got an error at step 2:
[root@cp-linux1 ~]# ejabberdctl --node $OLDNODE start
[root@cp-linux1 ~]# ejabberdctl --node $OLDNODE backup $OLDFILE
Failed RPC connection to the node 'ejabberd@cp-linux1.test.com': nodedown

The error reported saw when doing ejabberdctl live:
{error_logger,{{2012,8,31},{12,56,14}},"Protocol: ~p: register error: ~p~n",["inet_tcp",{{badmatch,{error,duplicate_name}},[{inet_tcp_dist,listen,1,[{file,"inet_tcp_dist.erl"},{line,70}]},{net_kernel,start_protos,4,[{file,"net_kernel.erl"},{line,1314}]},{net_kernel,start_protos,3,[{file,"net_kernel.erl"},{line,1307}]},{net_kernel,init_node,2,[{file,"net_kernel.erl"},{line,1197}]},{net_kernel,init,1,[{file,"net_kernel.erl"},{line,357}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,304}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]}]}

So I don't know to rid the system off of the old host name and make ejabberd works.

I did do similar thing on a Linux VM running ubuntu and it worked in that case. This is a different Linux device running RedHat and have installed the required software from source.

Could you tell me how to find the root cause or a work-around. I'm new to both erlang and ejabberd.

Thanks,
steve

Hello folks, Just to let you

Hello folks,

Just to let you know that I found my mistake and I'm now up and running with the new node name.
Basically, I forgot to make the corresponding change in the ejabberdctl script:

[root@cp-linux1 ~]# which ejabberdctl
/sbin/ejabberdctl
[root@cp-linux1 ~]# vi /sbin/ejabberdctl
Here I just need to change the value of the HOST variable (under the section # define default environment variables).

After the above change I killed process beam and epmd. Then I deleted all the files in the database spool dir: //var/lib/ejabberd. Please be aware that if you delete those files, you will have to recreate all the registrations at the minimum. In my case, since I started from fresh and do not have any registrations, deleting the spool files has no detrimental effect.
A new "ejabberdctl start/status" confirmed that the process is running under the new node name.

What helped me was this post:
http://www.ejabberd.im/node/3964

Thank you all for the contribution. I learned a lot from reading the posts.

Steve

Syndicate content