[ejabberd] I think I really messed up my mnesia database

Badlop badlop at gmail.com
Fri Jul 24 01:10:49 MSD 2009

2009/7/23 Wijnand Wiersma <wijnand at videre.net>:
> I made a mess of my ejabberd server by using the webinterface to set the
> table type to disk_only for config.
> The ejabberd server started to fall apart and now it won't start anymore.

> =CRASH REPORT==== 23-Jul-2009::21:11:15 ===
>  crasher:
>    pid: <0.258.0>
>    registered_name: ejabberd_system_monitor
>    exception exit: {badarg,[{ets,lookup,[config,hosts]},
>                             {ejabberd_config,get_global_option,1},
>                             {ejabberd_system_monitor,init,1},
>                             {gen_server,init_it,6},
>                             {proc_lib,init_p,5}]}
> Anyone with a good suggestion on how to fix?

Apparently the only problem is in a Mnesia table called 'config'.
You only need to tell Mnesia that it is of type 'disc_copies'.
Of course, right now you can't use ejabberd's WebAdmin to do that.
There is another method:

1. Start ejabberd in interactive mode:
$ sudo ejabberdctl live

2. An Erlang node with a shell is started, and ejabberd attempts to start.
You get the reports and the error:
=CRASH REPORT==== 23-Jul-2009::22:58:24 ===
    initial call: ejabberd_system_monitor:init/1
    pid: <0.231.0>
    registered_name: []
    exception exit: {badarg,[{ets,lookup,[config,hosts]},

3. Now execute this in the Erlang shell:
mnesia:change_table_copy_type(config, node(), disc_copies).

4. You get:

5. Stop that node:

6. Start ejabberd as usual, now it should not complain anymore.

> This is also the perfect day to find out my backups are not usable so I
> can't rely on those either :-(

You are so lucky: you have another opportunity to verify your backup system
before a catastrophic event happens, and you didn't lose any data this time :)


More information about the ejabberd mailing list