processone / ejabberd

Robust, Ubiquitous and Massively Scalable Messaging Platform (XMPP, MQTT, SIP Server)
https://www.process-one.net/en/ejabberd/
Other
6.01k stars 1.5k forks source link

Hook pubsub_publish_item crashed when running mod_private:pubsub_publish_item/6 #4092

Closed licaon-kter closed 9 months ago

licaon-kter commented 9 months ago

Environment

Configuration (only if needed)

Which section?

Errors from error.log/crash.log

[error] <0.689.0>@ejabberd_hooks:safe_apply/4:324 Hook pubsub_publish_item crashed when running mod_private:pubsub_publish_item/6:
** exception error: no function clause matching 
                  mod_private:err_ret({result,
                                       {pubsub,undefined,undefined,undefined,
                                        {ps_publish,
                                         <<"urn:xmpp:bookmarks:1">>,
                                         [{ps_item,<<>>,
                                           <<"mucname@muc.otherdomain.tld">>,[],
                                           <<>>,<<>>}]},
                                        undefined,undefined,undefined,
                                        undefined,undefined,undefined,
                                        undefined,undefined,undefined,
                                        undefined,undefined,undefined}},
                                      {result,
                                       {pubsub,undefined,undefined,undefined,
                                        {ps_publish,
                                         <<"urn:xmpp:bookmarks:1">>,
                                         [{ps_item,<<>>,
                                           <<"othermuc@conference.randomnomain.tld">>,
                                           [],<<>>,<<>>}]},
                                        undefined,undefined,undefined,
                                        undefined,undefined,undefined,
                                        undefined,undefined,undefined,
                                        undefined,undefined,undefined}}) (/source/ejabberd/src/mod_private.erl, line 380)
   in function  mod_private:'-publish_pep_xmpp_bookmarks/2-fun-1-'/5 (/source/ejabberd/src/mod_private.erl, line 345)
   in call from lists:foldl_1/3 (lists.erl, line 1599)
   in call from mod_private:publish_pep_xmpp_bookmarks/2 (/source/ejabberd/src/mod_private.erl, line 332)
   in call from ejabberd_hooks:safe_apply/4 (/source/ejabberd/src/ejabberd_hooks.erl, line 320)
   in call from ejabberd_hooks:run1/3 (/source/ejabberd/src/ejabberd_hooks.erl, line 287)
   in call from mod_pubsub:publish_item/8 (/source/ejabberd/src/mod_pubsub.erl, line 1893)
   in call from mod_pubsub:iq_sm/1 (/source/ejabberd/src/mod_pubsub.erl, line 1103)
** Arg 1 = <<"mydomain.tld">>
** Arg 2 = <<"storage:bookmarks">>
** Arg 3 = {jid,<<"username">>,<<"mydomain.tld">>,<<"Conversations.XXXX">>,
                <<"username">>,<<"mydomain.tld">>,<<"Conversations.XXXX">>}
** Arg 4 = {jid,<<"username">>,<<"mydomain.tld">>,<<>>,<<"username">>,
                <<"mydomain.tld">>,<<>>}
** Arg 5 = <<"current">>
** Arg 6 = [{xmlel,<<"storage">>,
                [{<<"xmlns">>,<<"storage:bookmarks">>}],
                [{xmlel,<<"conference">>,
                     [{<<"name">>,<<"Name">>},
                      {<<"jid">>,<<"mucname@domain.tld">>},
                      {<<"autojoin">>,<<"false">>}],
                     [{xmlel,<<"nick">>,[],[{xmlcdata,<<"MyNickName">>}]}]},
                ...snip all my other bookmarks 8<------8<-----

@prefiks did I miss any upgrade steps from "old" bookmarks to "new" bookmarks?

prefiks commented 9 months ago

Commit a63d3bf0d6a05715de374ca438b2d3f23927bf7e should fix this, did miss one case when tried to make dialyzer checker happy...

licaon-kter commented 9 months ago

Given that bookmarks are fine, this is not an issue and no corruption has occured, yes?