Cannot export Mnesia tables on server to files on output directory

ejabberdctl ejabberd@localhost export2odbc localhost /tmp/2
Trying to export Mnesia table 'last' on server 'localhost' to file '/tmp/2/last.txt'
Trying to export Mnesia table 'offline' on server 'localhost' to file '/tmp/2/offline.txt'
Trying to export Mnesia table 'passwd' on server 'localhost' to file '/tmp/2/passwd.txt'
Trying to export Mnesia table 'private_storage' on server 'localhost' to file '/tmp/2/private_storage.txt'
Trying to export Mnesia table 'roster' on server 'localhost' to file '/tmp/2/roster.txt'
Trying to export Mnesia table 'vcard' on server 'localhost' to file '/tmp/2/vcard.txt'
Trying to export Mnesia table 'vcard_search' on server 'localhost' to file '/tmp/2/vcard_search.txt'

all files are almost empty (nothing except [ begin;commit; ]):

ls -l
total 28
-rw-r--r-- 1 ejabberd ejabberd 14 2008-02-21 13:47 last.txt
-rw-r--r-- 1 ejabberd ejabberd 14 2008-02-21 13:47 offline.txt
-rw-r--r-- 1 ejabberd ejabberd 14 2008-02-21 13:47 passwd.txt
-rw-r--r-- 1 ejabberd ejabberd 14 2008-02-21 13:47 private_storage.txt
-rw-r--r-- 1 ejabberd ejabberd 14 2008-02-21 13:47 roster.txt
-rw-r--r-- 1 ejabberd ejabberd 14 2008-02-21 13:47 vcard_search.txt
-rw-r--r-- 1 ejabberd ejabberd 14 2008-02-21 13:47 vcard.txt

I have ejabberd-1.1.4-1.fc7

I have tried both genuine ejabberdctl module and SVN version.

ODBC is compiled in

[root@venus ebin]# pwd
/usr/lib/ejabberd-1.1.4/ebin

[root@venus ebin]# ls *odbc*
ejabberd_auth_odbc.beam ejabberd_odbc_sup.beam mod_last_odbc.beam mod_roster_odbc.beam odbc_queries.beam
ejabberd_odbc.beam ejd2odbc.beam mod_offline_odbc.beam mod_vcard_odbc.beam

Can't get

Hi
I'm using Version 1.1.4
i try to get the Moudle mod_ctlextra from SVN with this command
svn co https://svn.process-one.net/ejabberd-modules/mod_ctlextra/branches/ejabb...

But nothing happens

Gonen

Try new mod_ctlextra in SVN: it shows result

I've updated mod_ctlextra in ejabberd-modules SVN: it now shows the result of each attempt to export a table.

For example, I first tried it and got this:

$ sudo ejabberdctl export2odbc localhost /tmp/2
Trying to export Mnesia table 'last' on server 'localhost' to file '/tmp/2/last.txt'
  Result: {aborted,{undef,[{ejabberd_odbc,escape,["badlop"]},
                           {ejd2odbc,'-export_last/2-fun-0-',2},
                           {ejd2odbc,'-export_common/4-fun-0-',5},
                           {lists,foldl,3},
                           {mnesia,do_foldl,8},
                           {mnesia,foldl,6},
                           {ejd2odbc,'-export_common/4-fun-1-',4},
                           {mnesia_tm,apply_fun,3}]}}
Trying to export Mnesia table 'offline' on server 'localhost' to file '/tmp/2/offline.txt'
  Result: {atomic,ok}
Trying to export Mnesia table 'passwd' on server 'localhost' to file '/tmp/2/passwd.txt'
  Result: {aborted,{undef,[{ejabberd_odbc,escape,["badlop"]},
                           {ejd2odbc,'-export_passwd/2-fun-0-',2},
                           {ejd2odbc,'-export_common/4-fun-0-',5},
                           {lists,foldl,3},
                           {mnesia,do_foldl,8},
                           {mnesia,foldl,6},
                           {ejd2odbc,'-export_common/4-fun-1-',4},
                           {mnesia_tm,apply_fun,3}]}}
Trying to export Mnesia table 'private_storage' on server 'localhost' to file '/tmp/2/private_storage.txt'
  Result: {atomic,ok}
Trying to export Mnesia table 'roster' on server 'localhost' to file '/tmp/2/roster.txt'
  Result: {aborted,{undef,[{ejabberd_odbc,escape,["badlop"]},
                           {ejd2odbc,'-export_roster/2-fun-0-',2},
                           {ejd2odbc,'-export_common/4-fun-0-',5},
                           {lists,foldl,3},
                           {mnesia,do_foldl,8},
                           {mnesia,foldl,6},
                           {ejd2odbc,'-export_common/4-fun-1-',4},
                           {mnesia_tm,apply_fun,3}]}}
Trying to export Mnesia table 'vcard' on server 'localhost' to file '/tmp/2/vcard.txt'
  Result: {atomic,ok}
Trying to export Mnesia table 'vcard_search' on server 'localhost' to file '/tmp/2/vcard_search.txt'
  Result: {atomic,ok}

The files were almost empty, as you described.

In my case, the problem was that I compiled ejabberd without odbc.

I solved it this way:

$ ./configure --enable-odbc
$ make
$ sudo make install
$ cd /var/lib/ejabberd/ebin/; ls *odbc*
ejabberd_auth_odbc.beam  ejd2odbc.beam          mod_privacy_odbc.beam  mod_vcard_odbc.beam
ejabberd_odbc.beam       mod_last_odbc.beam     mod_private_odbc.beam  odbc_queries.beam
ejabberd_odbc_sup.beam   mod_offline_odbc.beam  mod_roster_odbc.beam

Now I get a good result:

$ sudo ejabberdctl export2odbc localhost /tmp/2
Trying to export Mnesia table 'last' on server 'localhost' to file '/tmp/2/last.txt'
  Result: {atomic,ok}
Trying to export Mnesia table 'offline' on server 'localhost' to file '/tmp/2/offline.txt'
  Result: {atomic,ok}
Trying to export Mnesia table 'passwd' on server 'localhost' to file '/tmp/2/passwd.txt'
  Result: {atomic,ok}
Trying to export Mnesia table 'private_storage' on server 'localhost' to file '/tmp/2/private_storage.txt'
  Result: {atomic,ok}
Trying to export Mnesia table 'roster' on server 'localhost' to file '/tmp/2/roster.txt'
  Result: {atomic,ok}
Trying to export Mnesia table 'vcard' on server 'localhost' to file '/tmp/2/vcard.txt'
  Result: {atomic,ok}
Trying to export Mnesia table 'vcard_search' on server 'localhost' to file '/tmp/2/vcard_search.txt'
  Result: {atomic,ok}

And the generated files have content.

Try the new mod_ctlextra, maybe it provides interesting information to find the reason of your problem :)

Syndicate content