Ejabberd service won't start

Hello everyone,
my ejabberd service always says it’s stopped. When i checked the logs for ejabberd it says:

E(<0.36.0>:ejabberd_config:556) : Error reading Mnesia database spool files: ejabberd needs read and write access in the directory: /var/lib/ejabberd/spool ejabberd@office Check the ejabberd guide for details about changing the application: ejabberd exited: {bad_return,{{ejabberd_app,start,[normal,[]]}, E(<0.36.0>:ejabberd_config:556) : Error reading Mnesia database spool files: ejabberd needs read and write access in the directory: /var/lib/ejabberd/spool ejabberd@office Check the ejabberd guide for details about changing the application: ejabberd exited: {bad_return,{{ejabberd_app,start,[normal,[]]}, E(<0.36.0>:ejabberd_config:556) : Error reading Mnesia database spool files: ejabberd needs read and write access in the directory: /var/lib/ejabberd/spool ejabberd@office Check the ejabberd guide for details about changing the application: ejabberd exited: {bad_return,{{ejabberd_app,start,[normal,[]]},

I can’t seem to figure out what’s the problem other than permission for access but shouldn’t it be working by default?

Also where it says ejabberd@office it should probably be ejabberd@office.example.com

It seem a corrupted db, you can safely remove it:

service ejabberd stop
rm -rf /var/lib/ejabberd/spool/*
service ejabberd start
1 Like

This is what i get:

[root@office /]# service ejabberd stop
Shutting down ejabberd: already stopped [WARNING]
[root@office /]# rm -rf /var/lib/ejabberd/spool/*
[root@office /]# service ejabberd start
Starting ejabberd: \nERROR: The node ‘ejabberd@office’ is already running.
[FAILED]

Make sure to kill all ejabber related process.
You can find it using this command: ps aux | grep ejabber

Otherwise use a quickest fix: reboot the machine :open_mouth:

1 Like

Sorry for the trouble but i’m a bit frustrated at the moment. What is it that i should stop? These are the results of the command you mentioned:

[root@office /]# ps aux | grep ejabber ejabberd 2064 0.0 0.0 10828 608 ? S 17:49 0:00 /usr/lib64/erlang/erts-5.8.5/bin/epmd -daemon ejabberd 2108 0.0 2.1 265108 41736 ? Sl 17:49 0:01 /usr/lib64/erlang/erts-5.8.5/bin/beam.smp -K true -P 250000 -- -root /usr/lib64/erlang -progname erl -- -home /var/lib/ejabberd/spool -- -sname ejabberd@office -noshell -noinput -noshell -noinput -pa /usr/lib64/ejabberd/ebin -mnesia dir "/var/lib/ejabberd/spool" -s ejabberd -sasl sasl_error_logger {file,"/var/log/ejabberd/erlang.log"} -smp auto start ejabberd 2117 0.0 0.0 10792 536 ? Ss 17:49 0:00 inet_gethost 4 ejabberd 2118 0.0 0.0 17120 804 ? S 17:49 0:00 inet_gethost 4 root 6832 0.0 0.0 103316 880 pts/0 S+ 18:16 0:00 grep ejabber

EDIT: I disabled ejabber through the chat server module and then the commands worked perfectly. I’m now trying to figure out why it won’t connect…

You must kill all erlang processes:

kill 2064
kill 2108
kill 2117
kill 2118

My advise: remove all data and reboot the system, it’s much easier :wink:

Not sure if i should continue asking here or create a new post…

The service is running fine now but i can’t connect to the server. Pidgin says unable to connect.

EDIT: When i connect to office.example.com:5222/admin i get this:

<?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='1199996250' from='pav-security.gr' version='1.0'><stream:error><xml-not-well-formed xmlns='urn:ietf:params:xml:ns:xmpp-streams'/></stream:error></stream:stream>

Ok so in case anyone comes in this post. I managed to fix it by changing the ejabberd configuration in /etc/ejabberd/ and adding office.example.com. It only had example.com by default.

1 Like