ejabberd v2.1.11 mod_muc_odbc not working

Previous running Ubuntu distribution package ejabberd v2.1.10 on Ubuntu 12.04 (Precise) with mysql database supporting all the *_odbc. ejabberd running without any problem.

I have just upgraded to ejabberd v2.1.11 (source build) and performed the following updates:
source build with parameters: $ sudo ./configure –-exec_prefix=/usr -–enable-pam --enable-odbc –-enable-user=ejabberd

a. Upgrade the mysql database by importing the new table structure for v2.1.11 pertaining to new odbc support.
b. Edit the ejabberd.cfg to enable all the new mod_xxx_odbc support in 2.1.11 including mod_muc_odbc etc.

The setting in ejabberd.cfg for mod_muc_odbc is as follow:
-----------------------------------------------------------
{mod_muc_odbc, [ %%{host, "conference.@HOST@"},
{access, muc_access},
{access_create, muc_access},
{access_persistent, muc_access},
{access_admin, muc_admin},
{max_users, 500},
{default_room_options,
[
{allow_private_messages, true},
{anonymous, false},
{public, false},
{public_list, false},
{max_users, 10},
{persistent, false}
]}
]},
--------------------------------------------------

However when execute with $sudo /etc/init.d/ejabberd live, following error message appears:

usr_crypto@cryptoserver:$ sudo /etc/init.d/ejabberd live
*******************************************************
* To quit, press Ctrl-g then enter q and press Return *
*******************************************************

Erlang R14B04 (erts-5.8.5) [source] [64-bit] [rq:1] [async-threads:0] [kernel-poll:false]

Eshell V5.8.5 (abort with ^G)
(ejabberd@cryptoserver)1>
=INFO REPORT==== 14-May-2012::10:29:56 ===
I(<0.40.0>:cyrsasl_digest:44) : FQDN used to check DIGEST-MD5 SASL authentication: "cryptoserver"

=ERROR REPORT==== 14-May-2012::10:29:57 ===
E(<0.331.0>:mod_muc_odbc:537) : {badarg,
[{erlang,phash,[{1336,962597,40216},0]},
{ejabberd_odbc_sup,get_random_pid,1},
{ejabberd_odbc,sql_call,2},
{mod_muc_odbc,load_permanent_rooms,5},
{mod_muc_odbc,init,1},
{gen_server,init_it,6},
{proc_lib,init_p_do_apply,3}]}

=INFO REPORT==== 14-May-2012::10:29:57 ===
I(<0.448.0>:ejabberd_listener:166) : Reusing listening port for 5222

=INFO REPORT==== 14-May-2012::10:29:57 ===
I(<0.449.0>:ejabberd_listener:166) : Reusing listening port for 5223

=INFO REPORT==== 14-May-2012::10:29:57 ===
I(<0.450.0>:ejabberd_listener:166) : Reusing listening port for 5269

=INFO REPORT==== 14-May-2012::10:29:57 ===
I(<0.451.0>:ejabberd_listener:166) : Reusing listening port for 5280

=INFO REPORT==== 14-May-2012::10:29:57 ===
I(<0.40.0>:ejabberd_app:72) : ejabberd 2.1.11 is started in the node ejabberd@cryptoserver

=============================

If I modified parametr "mod_muc_odbc" to just "mod_muc" in ejabberd.cfg and re-run ejabberd; there is no error pertaining to mod_muc, and the ejabberd xmpp server is up and running.

Any help is appreciated for problem on mod_muc_odbc support.

First, I must say that I'm

First, I must say that I'm not competent in this area. I don't use this module, neither do I use ODBC. The following is speculation based on source and logs only.

The problem appears in the following sequence of calls:
mod_muc_odbc:load_permanent_rooms(... Serverhost...) -> ejabberd_odbc:sql_query(LServer, ...) -> sql_call(Host ...) -> ejabberd_odbc_sup:get_random_pid(Host) -> get_pids(Host). The last call returns empty result, thus the next call to erlang:phash(now(), length(Pids)) is executed as erlang:phash(now(), 0), and this is naturally a badarg (see phash).

The problem may be either some bug (then developers will hopefully fix it), or some sort of misconfiguration on your part: something could have gone wrong when you created the ODBC structure for 2.1.11; or you have remnants of a Host in your config that is absent from the ODBC...

You could try to narrow down the specific Host that causes this, by inserting
?ERROR_MSG("~p", [LServer]),
between lines 536 and 537 of mod_muc_odbc.erl. Then the host name would appear before the abovementioned error.

HTH.

Hi, Thanks. I changed the

Hi,

Thanks. I changed the ejabberd.cfg file i.e. uncomment the "%%host..." statement as below, then the problem is resolved. It is my configuration file error.

{mod_muc_odbc, [{host, "conference.@HOST@"},

nice work! guys, where can I

nice work!
guys, where can I find the link for mod_muc_odbc and mysql-schema for this?
I have mod_muc_odbc but I haven't Mysql tables.
old versions had two Mysql tables: muc_registered and muc_room, so they are always empty...

Syndicate content