Error when reading /var/lib/ejabberd/spool/.erlang.cookie: eacces

My ejabberd 2.1.3 server has been humming along nicely for a few days, when suddenly today I got disconnected from it, and I couldn't reconnect.

So I restarted the server, but still couldn't connect. I did "service ejabberd status" to see if it was really running, and got this instead:

{error_logger,{{2010,4,18},{1,21,8}},std_error,"File operation error: eacces. Target: /etc/ejabberd/inetrc. Function: get_file. Process: kernel_sup."}
{error_logger,{{2010,4,18},{1,21,8}},"inet_config: file ~s not found~n",["/etc/ejabberd/inetrc"]}
{error_logger,{{2010,4,18},{1,21,8}},{error,"Error when reading /var/lib/ejabberd/spool/.erlang.cookie: eacces"},[]}
{error_logger,{{2010,4,18},{1,21,8}},crash_report,[[{initial_call,{auth,init,['Argument__1']}},{pid,<0.20.0>},{registered_name,[]},{error_info,{exit,{{error,"Error when reading /var/lib/ejabberd/spool/.erlang.cookie: eacces"},[{auth,init_cookie,0},{auth,init,1},{gen_server,init_it,6},{proc_lib,init_p_do_apply,3}]},[{gen_server,init_it,6},{proc_lib,init_p_do_apply,3}]}},{ancestors,[net_sup,kernel_sup,<0.9.0>]},{messages,[]},{links,[<0.18.0>]},{dictionary,[]},{trap_exit,true},{status,running},{heap_size,610},{stack_size,24},{reductions,366}],[]]}
{error_logger,{{2010,4,18},{1,21,8}},supervisor_report,[{supervisor,{local,net_sup}},{errorContext,start_error},{reason,{{error,"Error when reading /var/lib/ejabberd/spool/.erlang.cookie: eacces"},[{auth,init_cookie,0},{auth,init,1},{gen_server,init_it,6},{proc_lib,init_p_do_apply,3}]}},{offender,[{pid,undefined},{name,auth},{mfa,{auth,start_link,[]}},{restart_type,permanent},{shutdown,2000},{child_type,worker}]}]}
{error_logger,{{2010,4,18},{1,21,8}},supervisor_report,[{supervisor,{local,kernel_sup}},{errorContext,start_error},{reason,shutdown},{offender,[{pid,undefined},{name,net_sup},{mfa,{erl_distribution,start_link,[]}},{restart_type,permanent},{shutdown,infinity},{child_type,supervisor}]}]}
{error_logger,{{2010,4,18},{1,21,8}},std_info,[{application,kernel},{exited,{shutdown,{kernel,start,[normal,[]]}}},{type,permanent}]}
{"Kernel pid terminated",application_controller,"{application_start_failure,kernel,{shutdown,{kernel,start,[normal,[]]}}}"}
Kernel pid terminated (application_controller) ({application_start_failure,kernel,{shutdown,{kernel,start,[normal,[]]}}})

And in my /var/log/ejabberd/ejabberd.log I have a few errors about the time I got disconnected:

=ERROR REPORT==== 2010-04-17 21:11:45 ===
Mnesia(ejabberd@beijing): ** ERROR ** (could not write core file: eacces)
** FATAL ** {error,{"Cannot rename disk_log file",latest_log,
                     "/var/lib/ejabberd/spool/PREVIOUS.LOG",
                     {log_header,trans_log,"4.3","4.4.13",ejabberd@beijing,
                                 {1271,560305,94365}},
                     eacces}}

=ERROR REPORT==== 2010-04-17 21:11:55 ===
Mnesia(ejabberd@beijing): ** ERROR ** mnesia_event got unexpected event: {'EXIT',
                                                                          <0.63.0>,
                                                                          killed}

=INFO REPORT==== 2010-04-17 21:11:55 ===
    application: mnesia
    exited: killed
    type: permanent

=ERROR REPORT==== 2010-04-17 21:11:55 ===
    application_master: shutdown_error
    ejabberd_app: {prep_stop,[[]]}
    error_info: {badarg,[{ets,lookup,[config,hosts]},
                         {ejabberd_config,get_global_option,1},
                         {ejabberd_app,stop_modules,0},
                         {ejabberd_app,prep_stop,1},
                         {application_master,prep_stop,2},
                         {application_master,loop_it,4}]}

=INFO REPORT==== 2010-04-17 21:11:56 ===
I(<0.38.0>:ejabberd_app:86) : ejabberd 2.1.3 is stopped in the node ejabberd@beijing

What's going on?

It's a disk read permission,

It's a disk read permission, see the documentation:

eacces

    Missing permission for reading the file, or for searching one of the parent directories.

In your case, it seems to affect the /var/lib/ejabberd/spool/ dir.

Thanks for pointing me in the

Thanks for pointing me in the right direction, but it turned out to be /var/log/ejabberd/ejabberd.log that was the trouble. I compared everything to another server that is working, and that file was chmod 644 instead of 640, as it should be.

I'm faced the same error, but

I'm faced the same error, but turns to be a permission error in /var/lib/ejabberd/PREVIOUS.LOG which was owned by root (?)
I just chown it to ejabberd:ejabberd and things went back to normality.

Syndicate content