ejabberd 17.11 issue with mod_muc

Hello ,

I have installed ejabberd 17.11 from binary and configured with postgres. While starting i get an error starting mod_muc. If i comment the mod_muc, then it comes.

mod_muc config:

  mod_muc:
    ## host: "conference.@HOST@"
    access:
      - allow
    access_admin:
      - allow: admin
    access_create: muc_create
    access_persistent: muc_create

Could you please advice / share best configs for mod muc + 17.11. ? Uncommenting Host did not work as well.
Thank you very much in advance.

Anand

Anand XMPP wrote: While

Anand XMPP wrote:

While starting i get an error starting mod_muc.

Can you show the error that you get?

Thanks Badlop for getting

Thanks Badlop for getting back on my query. When we are doing change in the configuration for multiuser chat, then this problem occurs. To recover, we have to delete the multiuser tables & then Ejabberd starts.

Below are the Error Logs:
---------------------------------------

2017-12-22 07:32:47.738 [debug] <0.311.0>@ejabberd_sql:sql_query_internal:586 SQL: "select name, opts from muc_room where host='conference.mycompany.com'"
2017-12-22 07:32:47.739 [debug] <0.312.0>@ejabberd_sql:sql_query_internal:586 SQL: "select room, jid, nick, nodes from muc_room_subscribers where host='conference.mycompany.com'"
2017-12-22 07:32:47.740 [error] <0.390.0>@mod_muc:-opts_to_binary/1-fun-2-:826 CRASH REPORT Process <0.390.0> with 0 neighbours exited with reason: bad argument in call to erlang:iolist_to_binary([{text,<<>>,<<"Friday">>}]) in mod_muc:'-opts_to_binary/1-fun-2-'/1 line 826
2017-12-22 07:32:47.741 [critical] <0.239.0>@gen_mod:start_module:212 Problem starting the module mod_muc for host mycompany.com
options: [{db_type,sql},
{access,[{allow,[all]}]},
{access_admin,[{allow,[{acl,admin}]}]},
{access_create,muc_create},
{access_persistent,muc_create},
{max_user_conferences,100}]
error: {error,{{badarg,[{erlang,iolist_to_binary,
[[{text,<<>>,<<"Friday">>}]],
[]},
{mod_muc,'-opts_to_binary/1-fun-2-',1,
[{file,"src/mod_muc.erl"},{line,826}]},
{lists,map,2,[{file,"lists.erl"},{line,1239}]},
{lists,map,2,[{file,"lists.erl"},{line,1239}]},
{mod_muc_sql,'-get_rooms/2-fun-7-',4,
[{file,"src/mod_muc_sql.erl"},
{line,188}]},
{lists,map,2,[{file,"lists.erl"},{line,1239}]},
{lists,map,2,[{file,"lists.erl"},{line,1239}]},
{mod_muc,load_permanent_rooms,6,
[{file,"src/mod_muc.erl"},{line,633}]}]},
{child,undefined,'mod_muc_mycompany.com',
{gen_server,start_link,
[{local,'mod_muc_mycompany.com'},
mod_muc,
[<<"mycompany.com">>,
[{db_type,sql},
{access,[{allow,[all]}]},
{access_admin,[{allow,[{acl,admin}]}]},
{access_create,muc_create},
{access_persistent,muc_create},
{max_user_conferences,100}]],
[]]},
transient,60000,worker,
[mod_muc]}}}
[{gen_mod,start_module,4,[{file,"src/gen_mod.erl"},{line,203}]},
{lists,foreach,2,[{file,"lists.erl"},{line,1338}]},
{gen_mod,start_link,0,[{file,"src/gen_mod.erl"},{line,79}]},
{supervisor,do_start_child,2,[{file,"supervisor.erl"},{line,365}]},
{supervisor,start_children,3,[{file,"supervisor.erl"},{line,348}]},
{supervisor,init_children,2,[{file,"supervisor.erl"},{line,314}]},
{gen_server,init_it,6,[{file,"gen_server.erl"},{line,328}]},
{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]
2017-12-22 07:32:47.741 [critical] <0.239.0>@gen_mod:maybe_halt_ejabberd:294 ejabberd initialization was aborted because a module start failed.

More Info: I also observe

More Info:
I also observe that the destroyed rooms are copied into DB again.

Looking at the error text, it

Looking at the error text, it seems that a room has some option with an unexpected type of value. How do you create and configure the rooms: using a Jabber/XMPP client, or using ejabberdctl commands, or modifying the database directly?

Thanks for your reply...I am

Thanks for your reply...I am modifying (toggling) only this parameters for muc configuration.

{allow_private_messages,true},
{allow_private_messages_from_visitors,anyone},
{allow_visitor_status,true},
{allow_visitor_nickchange,true},
{public,false},
{anonymous,false},

This problem is not seen with mnesia database. Only when we have sql databases (postgres ) & while restarting we get this issue. Without restart, it continues to work. To recover from this issue, deleting the tables on the database , then restart ejabberdctl works.

Thanks
Anand

Full schema table below:
-------------------------------------
[{title,<<>>},
{description,<<>>},
{allow_change_subj,true},
{allow_query_users,true},
{allow_private_messages,true},
{allow_private_messages_from_visitors,anyone},
{allow_visitor_status,true},
{allow_visitor_nickchange,true},
{public,false},
{public_list,true},
{persistent,true},
{moderated,true},
{members_by_default,true},
{members_only,true},
{allow_user_invites,false},
{password_protected,false},
{captcha_protected,false},
{password,<<>>},
{anonymous,false},
{logging,false},
{max_users,200},
{allow_voice_requests,true},
{allow_subscription,false},
{mam,true},
{presence_broadcast,[moderator,participant,visitor]},
{voice_request_min_interval,1800},
{vcard,<<>>},
{captcha_whitelist,[]},
{affiliations,[{{<<"+91123456789">>,<<"mycompany.com">>,<<>>},{owner,<<>>}}]},
{subject,[]},
{subject_author,<<>>}]

The error text says the crash

The error text says the crash occurs when reading the muc_room database table, and converting the room options to erlag format, and mentions a text friday.

I asked you how do you create and configure the rooms, and you didn't reply.

It would also help to know: get from your SQL database the item that makes ejabberd crash. Maybe it has some subject set, or some title or description?

Thanks Badlop for your

Thanks Badlop for your response.

We are using android client APIs to write to server.

More update on the issue:
----------------------------------------
If we manually overwrite the mysql database with empty table contents for "subject & subject_author", then ejabberd starts without any issue.
Sample Below:
{subject,[]},
{subject_author,<<>>}]

Notworking with the below contents:
{subject,[{text,<<>>,<<"group chat">>}]},
{subject_author,<<"+911234567890">>}]

Is this a ejabberd-17.11 bug ?

Thanks
Anand

I confirm in older releases

I confirm in older releases it was like {subject,<<>>}, and in 17.12 it's {subject,[{text,<<>>,<<"group chat">>}]},

I have tested with 17.12, and a room with subject is recreated correctly after server start. So it seems a bug in 17.11, probably fixed with https://github.com/processone/ejabberd/commit/a57c694f218294812f9c228f47...

Thanks badlop for your

Thanks badlop for your update. Will try 17.12

Syndicate content