esl / MongooseIM

MongooseIM is Erlang Solutions' robust, scalable and efficient XMPP server, aimed at large installations. Specifically designed for enterprise purposes, it is fault-tolerant and can utilise the resources of multiple clustered machines.
Other
1.67k stars 427 forks source link

MAM v0.3+ support? #1106

Closed apparition47 closed 7 years ago

apparition47 commented 7 years ago

MongooseIM version: 2.0.0-beta.1 Installed from: source (detached from 2.0.0beta1) 2392a08 Merge pull request #870 from esl/rel-2.0 Erlang/OTP version: 18

I'm sending the following stanza below but I'm getting a 500. I had this result with 1.6.2 as well. I believe this is due to MongooseIM only supporting v0.2 MAM. Is there any support for v0.3 or newer MAM stanzas? Or is there something I'm missing. Any guidance would be helpful! Thanks!

Sent:

<iq xmlns="jabber:client" type="set" id="e2dc65c2-9d90-451b-84d0-1320926d5e14">
   <query xmlns="urn:xmpp:mam:0" queryid="e2dc65c2-9d90-451b-84d0-1320926d5e14">
      <set xmlns="http://jabber.org/protocol/rsm">
         <max>40</max>
      </set>
      <x xmlns="jabber:x:data" type="submit">
         <field var="FORM_TYPE">
            <value>urn:xmpp:mam:0</value>
         </field>
      </x>
   </query>
</iq>

Server response:

<iq xmlns="jabber:client" from="user@example.com" to="user@example.com/274EF8788A50DFF0148171669111576" id="e2dc65c2-9d90-451b-84d0-1320926d5e14" type="error">
   <error code="500" type="wait">
      <internal-server-error xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
   </error>
</iq>
fenek commented 7 years ago

MongooseIM supports MAM versions 0.2, 0.3 and 0.4. This error could indicate that MAM is misconfigured. Can you please share your ejabberd.cfg with us or at least a slice with MAM config?

apparition47 commented 7 years ago

Thanks for your input. This is my ejabberd.cfg.txt.

michalwski commented 7 years ago

I see you want to keep archive in cassandra. This was broken in 2.0.0beta1. We are working on restoring support for cassandra (see #1098). Also you can use version 1.6.2. I'd recommend trying the PR first as this is going to be merged to the master branch and included in 2.0.1 sometime in January.

apparition47 commented 7 years ago

Thanks. I'll try that PR first. 1.6.2 won't work for us because according to your docs, it only has MAM v0.2 support.

apparition47 commented 7 years ago

Having issues with that PR.

2016-12-08 15:19:23.618 [debug] <0.219.0>@exometer_admin:handle_call:277 _Other = {false,false}
2016-12-08 15:19:23.622 [debug] <0.219.0>@exometer_admin:handle_call:277 _Other = {false,false}
2016-12-08 15:19:23.622 [debug] <0.219.0>@exometer_admin:handle_call:277 _Other = {false,false}
2016-12-08 15:19:23.623 [debug] <0.219.0>@exometer_admin:handle_call:277 _Other = {false,false}
2016-12-08 15:19:23.623 [debug] <0.219.0>@exometer_admin:handle_call:277 _Other = {false,false}
2016-12-08 15:19:23.623 [debug] <0.231.0>@gen_mod:start_module:87 Module mod_roster started for <<"example.com">>.
2016-12-08 15:19:23.627 [debug] <0.231.0>@gen_mod:start_module:87 Module mod_sic started for <<"example.com">>.
2016-12-08 15:19:23.637 [debug] <0.219.0>@exometer_admin:handle_call:277 _Other = {false,false}
2016-12-08 15:19:23.637 [debug] <0.219.0>@exometer_admin:handle_call:277 _Other = {false,false}
2016-12-08 15:19:23.637 [debug] <0.219.0>@exometer_admin:handle_call:277 _Other = {false,false}
2016-12-08 15:19:23.644 [debug] <0.219.0>@exometer_admin:handle_call:277 _Other = {false,false}
2016-12-08 15:19:23.644 [debug] <0.219.0>@exometer_admin:handle_call:277 _Other = {false,false}
2016-12-08 15:19:23.645 [debug] <0.366.0> Supervisor ejabberd_sup started mod_vcard:start_link(<<"example.com">>, [{allow_return_all,true},{search_all_hosts,true}]) at pid <0.597.0>
2016-12-08 15:19:23.645 [debug] <0.231.0>@gen_mod:start_module:87 Module mod_vcard started for <<"example.com">>.
2016-12-08 15:19:23.662 [debug] <0.366.0> Supervisor ejabberd_sup started ejabberd_tmp_sup:start_link(ejabberd_mod_bosh_socket_sup, mod_bosh_socket) at pid <0.621.0>
2016-12-08 15:19:23.662 [debug] <0.231.0>@gen_mod:start_module:87 Module mod_bosh started for <<"example.com">>.
2016-12-08 15:19:23.667 [critical] <0.231.0>@gen_mod:start_module:97 Problem starting the module mod_websockets for host <<"example.com">>
 options: []
 error: undef
[{mod_websockets,start,[<<"example.com">>,[]],[]},
 {gen_mod,start_module,3,[{file,"src/gen_mod.erl"},{line,86}]},
 {lists,foreach,2,[{file,"lists.erl"},{line,1337}]},
 {ejabberd_app,start,2,[{file,"src/ejabberd_app.erl"},{line,69}]},
 {application_master,start_it_old,4,
                     [{file,"application_master.erl"},{line,273}]}]
2016-12-08 15:19:23.667 [critical] <0.231.0>@gen_mod:start_module:102 ejabberd initialization was aborted because a module start failed.
The trace is [{mod_websockets,start,[<<"example.com">>,[]],[]},{gen_mod,start_module,3,[{file,"src/gen_mod.erl"},{line,86}]},{lists,foreach,2,[{file,"lists.erl"},{line,1337}]},{ejabberd_app,start,2,[{file,"src/ejabberd_app.erl"},{line,69}]},{application_master,start_it_old,4,[{file,"application_master.erl"},{line,273}]}].

Crash dump is being written to: erl_crash.dump...done
Problem starting the module mod_websockets for host <<"example.com">>
 options: []
 error: undef
[{mod_websockets,start,[<<"example.com">>,[]],[]},
 {gen_mod,start_module,3,[{file,"src/gen_
fenek commented 7 years ago

Remove mod_websockets from your modules section in config file. mod_websockets is no longer an actual module.

apparition47 commented 7 years ago

That worked but I'm now having issues with Cassandra (which I'm using for archive).

at pid <0.557.0>
2016-12-08 16:46:35.360 [debug] <0.212.0>@gen_mod:start_module:87 Module mod_bosh started for <<"example.com">>.
2016-12-08 16:46:35.360 [debug] <0.326.0> Supervisor ejabberd_sup started ejabberd_tmp_sup:start_link(ejabberd_mod_bosh_socket_sup, mod_bosh_socket) at pid <0.581.0>
2016-12-08 16:46:35.366 [debug] <0.212.0>@gen_mod:start_module:87 Module mod_carboncopy started for <<"example.com">>.
2016-12-08 16:46:35.383 [critical] <0.212.0>@gen_mod:start_module:97 Problem starting the module mod_mam_con_ca_arch for host <<"example.com">>
 options: [{pm,true},
           {cassandra_config,[{servers,[{"10.134.21.58",9042,1}]}]},
           {keyspace,"mam"},
           {credentials,[{"username","username"},
                         {"password","password"}]}]
 error: undef
[{mod_mam_con_ca_arch,start,
     [<<"example.com">>,
      [{pm,true},
       {cassandra_config,[{servers,[{"10.134.21.58",9042,1}]}]},
       {keyspace,"mam"},
       {credentials,
           [{"username","username"},{"password","password"}]}]],
     []},
 {gen_mod,start_module,3,[{file,"src/gen_mod.erl"},{line,86}]},
 {lists,foreach,2,[{file,"lists.erl"},{line,1337}]},
 {ejabberd_app,start,2,[{file,"src/ejabberd_app.erl"},{line,69}]},
 {application_master,start_it_old,4,
     [{file,"application_master.erl"},{line,273}]}]
2016-12-08 16:46:35.384 [critical] <0.212.0>@gen_mod:start_module:102 ejabberd initialization was aborted because a module start failed.
The trace is [{io_lib_pretty,cind_tag_tuple,7,[{file,"io_lib_pretty.erl"},{line,637}]},{io_lib_pretty,cind_element,7,[{file,"io_lib_pretty.erl"},{line,726}]},{io_lib_pretty,cind_tail,8,[{file,"io_lib_pretty.erl"},{line,709}]},{io_lib_pretty,cind_element,7,[{file,"io_lib_pretty.erl"},{line,726}]},{io_lib_pretty,cind_tail,8,[{file,"io_lib_pretty.erl"},{line,709}]},{io_lib_pretty,cind_element,7,[{file,"io_lib_pretty.erl"},{line,726}]},{io_lib_pretty,cind_tail,8,[{file,"io_lib_pretty.erl"},{line,709}]},{io_lib_pretty,cind_element,7,[{file,"io_lib_pretty.erl"},{line,726}]}].

Crash dump is being written to: erl_crash.dump...done
Problem starting the module mod_mam_con_ca_arch for host <<"example.com">>
 options: [{pm,true},
           {cassandra_config,[{servers,[{"10.134.21.58",9042,1}]}]},
           {keyspace,"mam"},
[root@maux etc]# 
 at pid <0.557.0>
2016-12-08 16:46:35.360 [debug] <0.212.0>@gen_mod:start_module:87 Module mod_bosh started for <<"example.com">>.
2016-12-08 16:46:35.360 [debug] <0.326.0> Supervisor ejabberd_sup started ejabberd_tmp_sup:start_link(ejabberd_mod_bosh_socket_sup, mod_bosh_socket) at pid <0.581.0>
2016-12-08 16:46:35.366 [debug] <0.212.0>@gen_mod:start_module:87 Module mod_carboncopy started for <<"example.com">>.
2016-12-08 16:46:35.383 [critical] <0.212.0>@gen_mod:start_module:97 Problem starting the module mod_mam_con_ca_arch for host <<"example.com">>
 options: [{pm,true},
           {cassandra_config,[{servers,[{"10.134.21.58",9042,1}]}]},
           {keyspace,"mam"},
           {credentials,[{"username","username"},
                         {"password","password"}]}]
 error: undef
[{mod_mam_con_ca_arch,start,
     [<<"example.com">>,
      [{pm,true},
       {cassandra_config,[{servers,[{"10.134.21.58",9042,1}]}]},
       {keyspace,"mam"},
       {credentials,
           [{"username","username"},{"password","password"}]}]],
     []},
 {gen_mod,start_module,3,[{file,"src/gen_mod.erl"},{line,86}]},
 {lists,foreach,2,[{file,"lists.erl"},{line,1337}]},
 {ejabberd_app,start,2,[{file,"src/ejabberd_app.erl"},{line,69}]},
 {application_master,start_it_old,4,
     [{file,"application_master.erl"},{line,273}]}]
2016-12-08 16:46:35.384 [critical] <0.212.0>@gen_mod:start_module:102 ejabberd initialization was aborted because a module start failed.
The trace is [{io_lib_pretty,cind_tag_tuple,7,[{file,"io_lib_pretty.erl"},{line,637}]},{io_lib_pretty,cind_element,7,[{file,"io_lib_pretty.erl"},{line,726}]},{io_lib_pretty,cind_tail,8,[{file,"io_lib_pretty.erl"},{line,709}]},{io_lib_pretty,cind_element,7,[{file,"io_lib_pretty.erl"},{line,726}]},{io_lib_pretty,cind_tail,8,[{file,"io_lib_pretty.erl"},{line,709}]},{io_lib_pretty,cind_element,7,[{file,"io_lib_pretty.erl"},{line,726}]},{io_lib_pretty,cind_tail,8,[{file,"io_lib_pretty.erl"},{line,709}]},{io_lib_pretty,cind_element,7,[{file,"io_lib_pretty.erl"},{line,726}]}].

Crash dump is being written to: erl_crash.dump...done
Problem starting the module mod_mam_con_ca_arch for host <<"example.com">>
 options: [{pm,true},
           {cassandra_config,[{servers,[{"10.134.21.58",9042,1}]}]},
           {keyspace,"mam"},
{mod_mam_con_ca_arch, [
    pm,
    {cassandra_config, [
        {servers, [ {"69.69.69.69", 9042, 1} ]}
    ]},
    {keyspace, "mam"},
    {credentials, [{"username", "username"}, {"password", "password"}]}
]},
{mod_mam_muc_ca_arch, [
    {host, "muc.@HOST"},
    {cassandra_config, [
        {servers, [ {"69.69.69.69", 9042, 1} ]}
    ]},
    {keyspace, "mam"},
    {credentials, [{"username", "username"}, {"password", "password"}]}
]},
{mod_mam_odbc_user, [muc]},

{mod_mam, []},
{mod_mam_muc, []}
fenek commented 7 years ago

In this PR, Cassandra archivers are called mod_mam_cassandra_arch and mod_mam_muc_cassandra_arch, not mod_mam_con_ca_arch and mod_mam_muc_ca_arch.

rslota commented 7 years ago

Please note that the entire cassandra's configuration format has been changed. It's no longer configurable in 'module' section. Instead Now is't a full–fledged backed, so you need to provide general Cassandra backend configuration as '{cassandra_servers, [...]}' config entry. For examples please see current config template

Also there have been some changes in database schema in order to provide better archive filters. Therefore if you already have some data in yours cassandra MAM backend, those will not be compatible with current version.

michalwski commented 7 years ago

@apparition47 any update on this?

apparition47 commented 7 years ago

Sorry for the late update--we ended up moving to the official 2.0 release with MySQL. MAM works as expected.

Thanks for your help.