Failure on acl after hostname change

I'm on a virtual server (FreeBSD) that has a new DNS entry. I changed the ejabberd.conf file to reflect this, as well as the hostname command, but upon running the ejabberd.sh script I get this failure in the acl reporter in the log:

=CRASH REPORT==== 9-Sep-2005::21:26:16 ===
crasher:
pid: <0.35.0>
registered_name: []
error_info: "invalid return value from ejabberd_app:start(normal,[]) -> {'EX
IT',\n {{badmatch,{aborted,{no_exists,acl}}}
,\n [{ejabberd_config,set_opts,1},\n
{ejabberd_app,start,2},\n
{application_master,start_it_old,4}]}}"

Check this page for a tip

The error is similar or the same that this. Try with different -sname values. If you find the solution, please post it here.

No joy... how do I re-init Mnesia?

I tried the following -sname's without success:

ejabberd@localhost
ejabberd@oldhostname
ejabberd@newhostname

How do I reinitialize Mnesia so I can start over?
(There were no registered users anyway.)

Remove the mnesia spool dir

There may be other ways, but this one is quite simple: stop ejabberd, delete the mnesia spool dir on disk, start ejabberd. The tables will be regenerated

Same failure after rm -rf /var/spool/ejabberd

I got the same "no_exists,acl" error after the following commands (sh -x to echo the commands being executed):

root@teamtibet /var/spool : rm -rf ejabberd
root@teamtibet /var/spool : cd ~ejabberd
root@teamtibet ~ejabberd : ls
.erlang.cookie
root@teamtibet ~ejabberd : pwd
/usr/home/ejabberd
root@teamtibet ~ejabberd : /usr/local/etc/rc.d/ejabberd.sh start
+ PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
+ EJABBERD=/usr/local/bin/ejabberd
+ EJABBERDCTL=/usr/local/bin/ejabberdctl
+ EJABBERDUSER=ejabberd
+ NAME=ejabberd
+ DESC=ejabberd
+ test -f /usr/local/bin/ejabberd
+ test -f /usr/local/bin/ejabberdctl
+ [ -f /usr/local/etc/ejabberd.defaults ]
+ . /usr/local/etc/ejabberd.defaults
+ set -e
+ echo -n Starting ejabberd:
Starting ejabberd: + status
+ hostname -s
+ su ejabberd -c /usr/local/bin/ejabberdctl ejabberd@teamtibet status >/dev/null
+ start
+ su ejabberd -c /usr/local/bin/ejabberd -noshell -detached
+ [ -r /var/run/ejabberd/.erlang.cookie ]
+ [ -f /usr/local/etc/ejabberd.defaults ]
+ . /usr/local/etc/ejabberd.defaults
+ CONFIG=/usr/local/etc/ejabberd.cfg
+ LOG=/var/log/ejabberd/ejabberd.log
+ SASL_LOG=/var/log/ejabberd/sasl.log
+ SPOOL=/var/spool/ejabberd
+ ARGS=
+ [ 2 -ne 0 ]
+ PARAM=-noshell
+ shift
+ ARGS= -noshell
+ [ 1 -ne 0 ]
+ PARAM=-detached
+ shift
+ ARGS= -noshell -detached
+ [ 0 -ne 0 ]
+ exec erl -sname ejabberd -s ejabberd -ejabberd config "/usr/local/etc/ejabberd.cfg" log_path "/var/log/ejabberd/ejabberd.log" -sasl sasl_error_logger {file,"/var/log/ejabberd/sasl.log"} -mnesia dir "/var/spool/ejabberd" -noshell -detached
+ echo ejabberd.
ejabberd.
+ exit 0

There may be other ways, but

There may be other ways, but this one is quite simple: stop ejabberd, delete the mnesia spool dir on disk, start ejabberd. The tables will be regenerated

I had the same problem on Ubuntu 7.04 (feisty). After renaming the host name, ejabberd refused to restart.

I stopped ejabberd; /etc/init.d/ejabberd stop was not enough, I also had to manually kill epmd and beam.

Removed /var/lib/ejabberd/*

Then started back ejabberd: /etc/init.d/ejabberd start

Everything ok.

ejabberd is based on the

ejabberd is based on the distributed Mnesia database. Being distributed, Mnesia enforce consistency of its file and store the name of the Erlang node in it.
If you need to change the name of the Erlang node, you need to export / import the database on a fresh new data structure.

--
Mickaël Rémond
Process-one

Other possible reason: Mnesia dir not writeable On an

I make an experiment:

  • On an Erlang node with ejabberd running correctly, I get the expected response:
    (ejabberd2@atenea)2> mnesia:dirty_all_keys(acl).
    [{local,global},{badlop1,global},{admin,global}]
  • But on an Erlang node without ejabberd, without Mnesia and without the 'acl' Mnesia table:
    $ erl
    Erlang (BEAM) emulator version 5.4.9 [source] [hipe] [kernel-poll]
    
    Eshell V5.4.9  (abort with ^G)
    1> mnesia:dirty_all_keys(acl).
    ** exited: {aborted,{no_exists,acl}} **
    2>

In this case, the 'acl' table does not exists because Mnesia was not started. If you remove the Mnesia spool dir, the tables should be created at the very beginning of ejabberd start. Check the permissions to read, write and execute that directory: maybe Erlang can't write the required Mnesia backup files there.

Correcting permissions fixed the problem

That was the problem. The jabber user needed to be a member of group 'wheel' and the spool directory made group writable. I'm not sure if this violates any FreeBSD security standards or not. I'll look more closely at the issue later.

Syndicate content