ejabberd startup error after kernel update (reboot)

Sorry for the longish post but I couldnt find any file attachment option in this forum.

I installed ejabberd on a root server for our company employees some months ago. It worked well all the time. Due to a kernel security update I had to reboot the machine today. Since the reboot, ejabberd wont start any more.

We are running ubuntu hardy with ejabberd which ships the somewhat oldish version 1.1.4. No config changes have been made in the last months. There is no external database involved except a mysql db for authentication ({auth_method, odbc}).

When I start ejabberd by hand, I get this output:

root@jabber:~# su - ejabberd -c "/usr/sbin/ejabberd -noshell -s"

=INFO REPORT==== 19-Aug-2009::23:51:10 ===
    application: ejabberd
    exited: {bad_return,{{ejabberd_app,start,[normal,[]]},
                         {'EXIT',{{badmatch,{aborted,{no_exists,config}}},
                                  [{ejabberd_config,set_opts,1},
                                   {ejabberd_app,start,2},
                                   {application_master,start_it_old,4}]}}}}
    type: temporary

The jabber server port stays dead and the web frontent is unreachable as well.

These are the contents of sasl.log:

=PROGRESS REPORT==== 19-Aug-2009::23:51:08 ===
          supervisor: {local,sasl_safe_sup}
             started: [{pid,<0.44.0>},
                       {name,alarm_handler},
                       {mfa,{alarm_handler,start_link,[]}},
                       {restart_type,permanent},
                       {shutdown,2000},
                       {child_type,worker}]

=PROGRESS REPORT==== 19-Aug-2009::23:51:08 ===
          supervisor: {local,sasl_safe_sup}
             started: [{pid,<0.45.0>},
                       {name,overload},
                       {mfa,{overload,start_link,[]}},
                       {restart_type,permanent},
                       {shutdown,2000},
                       {child_type,worker}]

=PROGRESS REPORT==== 19-Aug-2009::23:51:08 ===
          supervisor: {local,sasl_sup}
             started: [{pid,<0.43.0>},
                       {name,sasl_safe_sup},
                       {mfa,
                           {supervisor,
                               start_link,
                               [{local,sasl_safe_sup},sasl,safe]}},
                       {restart_type,permanent},
                       {shutdown,infinity},
                       {child_type,supervisor}]

=PROGRESS REPORT==== 19-Aug-2009::23:51:08 ===
          supervisor: {local,sasl_sup}
             started: [{pid,<0.46.0>},
                       {name,release_handler},
                       {mfa,{release_handler,start_link,[]}},
                       {restart_type,permanent},
                       {shutdown,2000},
                       {child_type,worker}]

=PROGRESS REPORT==== 19-Aug-2009::23:51:08 ===
         application: sasl
          started_at: ejabberd@jabber

=PROGRESS REPORT==== 19-Aug-2009::23:51:08 ===
          supervisor: {local,kernel_safe_sup}
             started: [{pid,<0.50.0>},
                       {name,dets_sup},
                       {mfa,{dets_sup,start_link,[]}},
                       {restart_type,permanent},
                       {shutdown,1000},
                       {child_type,supervisor}]

=PROGRESS REPORT==== 19-Aug-2009::23:51:08 ===
          supervisor: {local,kernel_safe_sup}
             started: [{pid,<0.51.0>},
                       {name,dets},
                       {mfa,{dets_server,start_link,[]}},
                       {restart_type,permanent},
                       {shutdown,2000},
                       {child_type,worker}]

=PROGRESS REPORT==== 19-Aug-2009::23:51:08 ===
          supervisor: {local,mnesia_sup}
             started: [{pid,<0.59.0>},
                       {name,mnesia_event},
                       {mfa,{mnesia_sup,start_event,[]}},
                       {restart_type,permanent},
                       {shutdown,30000},
                       {child_type,worker}]

=PROGRESS REPORT==== 19-Aug-2009::23:51:08 ===
          supervisor: {local,mnesia_kernel_sup}
             started: [{pid,<0.61.0>},
                       {name,mnesia_monitor},
                       {mfa,{mnesia_monitor,start,[]}},
                       {restart_type,permanent},
                       {shutdown,3000},
                       {child_type,worker}]

=PROGRESS REPORT==== 19-Aug-2009::23:51:08 ===
          supervisor: {local,mnesia_kernel_sup}
             started: [{pid,<0.62.0>},
                       {name,mnesia_subscr},
                       {mfa,{mnesia_subscr,start,[]}},
                       {restart_type,permanent},
                       {shutdown,3000},
                       {child_type,worker}]

=PROGRESS REPORT==== 19-Aug-2009::23:51:08 ===
          supervisor: {local,mnesia_kernel_sup}
             started: [{pid,<0.63.0>},
                       {name,mnesia_locker},
                       {mfa,{mnesia_locker,start,[]}},
                       {restart_type,permanent},
                       {shutdown,3000},
                       {child_type,worker}]

=PROGRESS REPORT==== 19-Aug-2009::23:51:08 ===
          supervisor: {local,mnesia_kernel_sup}
             started: [{pid,<0.64.0>},
                       {name,mnesia_recover},
                       {mfa,{mnesia_recover,start,[]}},
                       {restart_type,permanent},
                       {shutdown,180000},
                       {child_type,worker}]

=PROGRESS REPORT==== 19-Aug-2009::23:51:08 ===
          supervisor: {local,kernel_safe_sup}
             started: [{pid,<0.69.0>},
                       {name,disk_log_sup},
                       {mfa,{disk_log_sup,start_link,[]}},
                       {restart_type,permanent},
                       {shutdown,1000},
                       {child_type,supervisor}]

=PROGRESS REPORT==== 19-Aug-2009::23:51:08 ===
          supervisor: {local,kernel_safe_sup}
             started: [{pid,<0.70.0>},
                       {name,disk_log_server},
                       {mfa,{disk_log_server,start_link,[]}},
                       {restart_type,permanent},
                       {shutdown,2000},
                       {child_type,worker}]

=PROGRESS REPORT==== 19-Aug-2009::23:51:09 ===
          supervisor: {local,inet_gethost_native_sup}
             started: [{pid,<0.78.0>},{mfa,{inet_gethost_native,init,[[]]}}]

=PROGRESS REPORT==== 19-Aug-2009::23:51:09 ===
          supervisor: {local,kernel_safe_sup}
             started: [{pid,<0.77.0>},
                       {name,inet_gethost_native_sup},
                       {mfa,{inet_gethost_native,start_link,[]}},
                       {restart_type,temporary},
                       {shutdown,1000},
                       {child_type,worker}]

=PROGRESS REPORT==== 19-Aug-2009::23:51:09 ===
          supervisor: {local,kernel_safe_sup}
             started: [{pid,<0.92.0>},
                       {name,timer_server},
                       {mfa,{timer,start_link,[]}},
                       {restart_type,permanent},
                       {shutdown,1000},
                       {child_type,worker}]

=PROGRESS REPORT==== 19-Aug-2009::23:51:09 ===
          supervisor: {local,mnesia_kernel_sup}
             started: [{pid,<0.65.0>},
                       {name,mnesia_tm},
                       {mfa,{mnesia_tm,start,[]}},
                       {restart_type,permanent},
                       {shutdown,30000},
                       {child_type,worker}]

=PROGRESS REPORT==== 19-Aug-2009::23:51:09 ===
          supervisor: {local,mnesia_kernel_sup}
             started: [{pid,<0.93.0>},
                       {name,mnesia_checkpoint_sup},
                       {mfa,{mnesia_checkpoint_sup,start,[]}},
                       {restart_type,permanent},
                       {shutdown,infinity},
                       {child_type,supervisor}]

=PROGRESS REPORT==== 19-Aug-2009::23:51:09 ===
          supervisor: {local,mnesia_kernel_sup}
             started: [{pid,<0.94.0>},
                       {name,mnesia_snmp_sup},
                       {mfa,{mnesia_snmp_sup,start,[]}},
                       {restart_type,permanent},
                       {shutdown,infinity},
                       {child_type,supervisor}]

=PROGRESS REPORT==== 19-Aug-2009::23:51:09 ===
          supervisor: {local,mnesia_kernel_sup}
             started: [{pid,<0.95.0>},
                       {name,mnesia_controller},
                       {mfa,{mnesia_controller,start,[]}},
                       {restart_type,permanent},
                       {shutdown,3000},
                       {child_type,worker}]

=PROGRESS REPORT==== 19-Aug-2009::23:51:09 ===
          supervisor: {local,mnesia_kernel_sup}
             started: [{pid,<0.96.0>},
                       {name,mnesia_late_loader},
                       {mfa,{mnesia_late_loader,start,[]}},
                       {restart_type,permanent},
                       {shutdown,3000},
                       {child_type,worker}]

=PROGRESS REPORT==== 19-Aug-2009::23:51:09 ===
          supervisor: {local,mnesia_sup}
             started: [{pid,<0.60.0>},
                       {name,mnesia_kernel_sup},
                       {mfa,{mnesia_kernel_sup,start,[]}},
                       {restart_type,permanent},
                       {shutdown,infinity},
                       {child_type,supervisor}]

=PROGRESS REPORT==== 19-Aug-2009::23:51:09 ===
         application: mnesia
          started_at: ejabberd@jabber

=PROGRESS REPORT==== 19-Aug-2009::23:51:09 ===
          supervisor: {local,crypto_sup}
             started: [{pid,<0.104.0>},
                       {name,crypto_server},
                       {mfa,{crypto_server,start_link,[]}},
                       {restart_type,permanent},
                       {shutdown,2000},
                       {child_type,worker}]

=PROGRESS REPORT==== 19-Aug-2009::23:51:09 ===
         application: crypto
          started_at: ejabberd@jabber

=PROGRESS REPORT==== 19-Aug-2009::23:51:09 ===
          supervisor: {local,ssl_sup}
             started: [{pid,<0.110.0>},
                       {name,ssl_server},
                       {mfa,{ssl_server,start_link,[]}},
                       {restart_type,permanent},
                       {shutdown,2000},
                       {child_type,worker}]

=PROGRESS REPORT==== 19-Aug-2009::23:51:09 ===
          supervisor: {local,ssl_sup}
             started: [{pid,<0.111.0>},
                       {name,ssl_broker_sup},
                       {mfa,{ssl_broker_sup,start_link,[]}},
                       {restart_type,permanent},
                       {shutdown,2000},
                       {child_type,supervisor}]

=PROGRESS REPORT==== 19-Aug-2009::23:51:09 ===
         application: ssl
          started_at: ejabberd@jabber

=PROGRESS REPORT==== 19-Aug-2009::23:51:09 ===
          supervisor: {local,stringprep_sup}
             started: [{pid,<0.114.0>},
                       {name,stringprep},
                       {mfa,{stringprep,start_link,[]}},
                       {restart_type,permanent},
                       {shutdown,brutal_kill},
                       {child_type,worker}]

=CRASH REPORT==== 19-Aug-2009::23:51:10 ===
  crasher:
    pid: <0.35.0>
    registered_name: []
    error_info: {bad_return,{{ejabberd_app,start,[normal,[]]},
                              {'EXIT',{{badmatch,{aborted,{no_exists,config}}},
                                       [{ejabberd_config,set_opts,1},
                                        {ejabberd_app,start,2},
                                        {application_master,start_it_old,
                                                            4}]}}}}
    initial_call: {application_master,
                     init,
                     [<0.5.0>,
                      <0.34.0>,
                      {appl_data,
                          ejabberd,
                          [ejabberd,
                           ejabberd_sup,
                           ejabberd_auth,
                           ejabberd_router,
                           ejabberd_sm,
                           ejabberd_s2s,
                           ejabberd_local,
                           ejabberd_listeners,
                           ejabberd_iq_sup,
                           ejabberd_service_sup,
                           ejabberd_s2s_out_sup,
                           ejabberd_s2s_in_sup,
                           ejabberd_c2s_sup,
                           ejabberd_mod_roster,
                           ejabberd_mod_echo,
                           ejabberd_mod_pubsub,
                           ejabberd_mod_irc,
                           ejabberd_mod_muc,
                           ejabberd_offline,
                           random_generator],
                          undefined,
                          {ejabberd_app,[]},
                          [acl,
                           configure,
                           cyrsasl,
                           cyrsasl_digest,
                           cyrsasl_plain,
                           ejabberd,
                           ejabberd_app,
                           ejabberd_auth,
                           ejabberd_c2s,
                           ejabberd_config,
                           ejabberd_listener,
                           ejabberd_logger_h,
                           ejabberd_local,
                           ejabberd_router,
                           ejabberd_s2s,
                           ejabberd_s2s_in,
                           ejabberd_s2s_out,
                           ejabberd_service,
                           ejabberd_sm,
                           ejabberd_sup,
                           ejabberd_tmp_sup,
                           gen_iq_handler,
                           gen_mod,
                           jd2ejd,
                           jlib,
                           mod_configure,
                           mod_disco,
                           mod_echo,
                           mod_last,
                           mod_offline,
                           mod_private,
                           mod_register,
                           mod_roster,
                           mod_stats,
                           mod_time,
                           mod_vcard,
                           mod_version,
                           randoms,
                           sha,
                           shaper,
                           translate,
                           xml,
                           xml_stream],
                          [],
                          infinity,
                          infinity},
                      normal]}
    ancestors: [<0.34.0>]
    messages: [{'EXIT',<0.36.0>,normal}]
    links: [<0.34.0>,<0.5.0>]
    dictionary: []
    trap_exit: true
    status: running
    heap_size: 987
    stack_size: 21
    reductions: 2041
  neighbours:

Admittedly I fail to get any sort of hint about what happened from these logs but may be you are able to enlighten me...

Any hint and suggestion would be greatly appreciated!

kind regards, bilton

How to fix schema.DAT?

Ok, I came a step forward by making a backup copy of /var/lib/ejabberd and then deleting all files in that directory. Then I restarted ejabberd and it recreated most of the files and did not crash on start any more.

Now I went along and copied all the old configs back file-by-file and restarted ejabberd every time. This way I found out that the file "schema.DAT" was the cause for the crash above. My life would have been a lot simpler in the last hours if ejabberd had proper log reporting.

Anyway I have a running ejabberd now - BUT:
The users page in the webfrontend has become unusable, it is completely empty. I presume this would go back to normal if I could manage to fix schema.DAT and put it back in place.

Can anyone give me hints on the file format and what I could do about it? Or any other way to get my user table back into the web frontend?

> The users page in the

> The users page in the webfrontend has become unusable, it is completely empty.

Can users login correctly: do they have their contacts, vcards, etc? If so, then maybe it isn't worth the effort to investigate that further, and better keep it as it is now.

Maybe your original problem is caused by a change in the erlang node name. See:
http://svn.process-one.net/ejabberd/trunk/doc/guide.html#nodename
http://svn.process-one.net/ejabberd/trunk/doc/guide.html#changeerlangnod...

If that's the case, a solution could be:

  1. What is the new node name? Start ejabberd with empty DB and you will see it:
    =PROGRESS REPORT==== 24-Aug-2009::14:02:57 ===
             application: ejabberd                
              started_at: ejabberd@localhost   
  2. What is the old node name? Maybe if you can find old logs, you can find that information.
  3. Are both node names identical? I imagine no.
  4. In that case, put back the old database and let's attempt to start ejabberd with it.
  5. Edit the script that starts ejabberd. It will have a line similar to: erl -noinput -detached -sname aaa@bbb ...
  6. Replace aaa@bbb with the old node name.
  7. Start ejabberd. Now mnesia should start correctly.
Syndicate content