[ejabberd] Migrating from another server with just the database spool dir

Jehan Pagès jehan.marmottard at gmail.com
Thu Feb 5 22:36:39 MSK 2009

Hi all,

I was telling that my below migration worked. And it is true... on the
surface. But deeply, I have a lot of S2S issues that I cannot understand.
With my account, I cannot connect to some MUC for instance. in ejabberd.log:

=INFO REPORT==== 2009-02-05 19:57:19 ===
I(<0.428.0>:ejabberd_s2s_out:1015) : Trying to open s2s connection:
zemarmot.net -> chat.jabberfr.org


=INFO REPORT==== 2009-02-05 20:00:21 ===
I(<0.428.0>:ejabberd_s2s_out:392) : wait_for_validation: zemarmot.net ->
chat.jabberfr.org (connection timeout)

And sometimes it works (I see several contacts of my rosters), but there are
a lot of timeout for many servers.

Note that I have many references to diallback when I add max debug logs (I
don't do it long because it overloads a lot my server but if you need
specific tests to help me, be welcome to ask me!):

=INFO REPORT==== 2009-02-03 01:20:41 ===
I(<0.428.0>:ejabberd_s2s_out:333): Closing s2s connection zemarmot.net ->
gmail.com (invalid dialback key)

=INFO REPORT==== 2009-02-03 01:20:50 ===
I(<0.428.0>:ejabberd_s2s_out:333): Closing s2s connection zemarmot.net ->
jabber.org (invalid dialback key)

So I would guess something is wrong in the diallback to my server?.. Other
server are maybe thinking I am a rogue server so refuse connection? I never
read in detail the diallback part of the RFC (because I don't develop server
programs until now), but it uses DNS. Is it possible that my DNS are still
not fully propagated (changed one week ago!!), so some servers still have
the info from my old IP? Or is it just the generated key which is wrong, and
if so, could it be related to the conversion I made of the ejabberd database
from one server to another?

Note that the "funniest" is that I can see sometimes some contacts, then I
lose them the other time (for instance I can see some gmail accounts, and 10
minutes after, I don't). Does anyone feel like giving me some hints or
helping me?
Thanks a lot because it is perturbating me a lot.


On Tue, Feb 3, 2009 at 3:13 AM, Jehan Pagès <jehan.marmottard at gmail.com>wrote:

> Hi,
> yes thanks... I figured it out as well after my email. The trick was indeed
> in the fact that I could start the node but not control it because it was
> not accessible anymore through the network! I understood it with this
> comments in the default etc/ejabberdctl.cfg:
> #   Erlang uses node name as is (so make sure that hostname is a real
> #   machine hostname or you'll not be able to control ejabberd)
> So I added the hostname of my old machine to the /etc/hosts, then I could
> start and control this old instance, therefore I have been able as well to
> make a backup, convert the backup to my new machine hostname, and restart
> it. Finally now all is perfect.
> Thanks for this quick answer anyway and sorry for the annoyance because
> finally I would not have needed to disturb you.
> Anyway maybe this "trick" could be added to the tutorial on ejabberd.im?..
> Bye and thanks all.
> Jehan
> On Tue, Feb 3, 2009 at 2:55 AM, Zhan Caibao <zhancaibao at gmail.com> wrote:
>> You can't use ejabberdctl stop and ejabberdctl status continues to tell me
>> "nodedown" for ejabberdctl can't connect to the node/hostname. Mayber you
>> could add info to hosts file.
>>  2009/2/3 Jehan Pagès <jehan.marmottard at gmail.com>
>>> Hi,
>>> I have migrated my server with ejabberd installed to another. For
>>> information, it was a 2.0.1, and I am reinstalling a 2.0.3. Unfortunately I
>>> did it fastly and simply saved the "Database spool dir" (the directory
>>> containing all the .DCD, .DCL, etc.). Then I read this:
>>> http://www.ejabberd.im/migrate-host . Apparently I needed to make a
>>> binary backup of my old database, which I haven't done and now I have no
>>> more any access to the old db.
>>> I tried anymore to start it with:
>>> /opt/sbin/ejabberdctl start --spool /the/path/to/my/spool/dir/
>>> But it failed with this error in the log:
>>> ------
>>> =ERROR REPORT==== 2009-02-03 01:13:11 ===
>>> E(<0.36.0>:ejabberd_config:278) : Error reading Mnesia database spool
>>> files:
>>> The Mnesia database couldn't read the spool file for the table 'config'.
>>> ejabberd needs read and write access in the directory:
>>>    /home/ejabberd/db
>>> Maybe the problem is a change in the computer hostname,
>>> or a change in the Erlang node name, which is currently:
>>>    ejabberd at ks34186
>>> Check the ejabberd guide for details about changing the
>>> computer hostname or Erlang node name.
>>> =INFO REPORT==== 2009-02-03 01:13:11 ===
>>>     application: ejabberd
>>>     exited: {bad_return,{{ejabberd_app,start,[normal,[]]},
>>>                          {'EXIT',"Error reading Mnesia database"}}}
>>>     type: temporary
>>> ------
>>> Indeed when I open the binary file CONFIG.DCL/DCD (and many others files
>>> in this dir), I can see some reference to the old node name:
>>> ejabberd at ks34186.
>>> So I tried to start changing the node name:
>>> /opt/sbin/ejabberdctl start --spool /the/path/to/my/spool/dir/ --node
>>> ejabberd at ks34186
>>> Then it fails according to the:
>>> -----
>>> ks34186 ejabberd # /opt/sbin/ejabberdctl status
>>> RPC failed on the node ejabberd at ks34186: nodedown
>>> =ERROR REPORT==== 3-Feb-2009::01:50:20 ===
>>> _atom,["ejabberd at ks36767
>>> "]},{dist_util,recv_challenge,1},{dist_util,handshake_we_started,1}]}
>>> -----
>>> But in fact, the server is well started because I can connect with my
>>> account, get my roster, speak with others, etc. And a ps gives me a beam
>>> process using my spool dir as mnesia dir, etc. So all seems perfect except
>>> that ejabberdctl status continues to tell me "nodedown" and so I have no
>>> control on my server instance.
>>> For instance, I cannot stop it properly (with ejabberdctl stop). I always
>>> need to kill the beam process.
>>> Moreover I wanted to try the binary backup: « ejabberd_ctl
>>> ejabberd at ks36767 backup /tmp/ejabberd.backup », this way I would have
>>> been able to change the node name, but it fails again with the same error
>>> "nodedown".
>>> As a conclusion, would anyone have a solution for me to get back a stable
>>> and "clean" ejabberd server? Apparently with this spool dir, I have
>>> everything to have a working server, so the database is full and intact.
>>> From this directory, I should be able to get a new and clean db, no?
>>> Thanks!
>>> Jehan
>>> _______________________________________________
>>> ejabberd mailing list
>>> ejabberd at jabber.ru
>>> http://lists.jabber.ru/mailman/listinfo/ejabberd
>> _______________________________________________
>> ejabberd mailing list
>> ejabberd at jabber.ru
>> http://lists.jabber.ru/mailman/listinfo/ejabberd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.jabber.ru/pipermail/ejabberd/attachments/20090205/43d1e253/attachment.htm>

More information about the ejabberd mailing list