processone / ejabberd-contrib

Growing and curated ejabberd contributions repository - PR or ask to join !
http://ejabberd.im
248 stars 137 forks source link

VCard search returns "No module is handling this query" #298

Closed jmorrey closed 3 years ago

jmorrey commented 3 years ago

I'm trying to enable VCard search on my ejabberd server, but haven't found much documentation on how to do that. My ejabberd.yml file has the following:

...
  mod_vcard:
    allow_return_all: true
    search: true
  mod_vcard_xupdate: {}
...

And I've created VCards for several users. For example:

workspace/ejabberd % /usr/local/sbin/ejabberdctl get_vcard gonzo localhost FN
Gonzo Muppet

However, the server returns a "No module is handling this query" error whenever I try to search for the VCard. For example:

          {2,
            {4690892439510816,
             {body,<<>>,[],
              [{xmlstreamelement,
                {xmlel,<<"iq">>,
                 [{<<"xml:lang">>,<<"en">>},
                  {<<"to">>,<<"jmorrey@localhost/45811583471273408681731">>},
                  {<<"from">>,<<"localhost">>},
                  {<<"type">>,<<"error">>},
                  {<<"id">>,<<"45976a2d-603f-48db-92a9-ec1881ff0825">>}],
                 [{xmlel,<<"query">>,
                   [{<<"xmlns">>,<<"jabber:iq:search">>}],
                   [{xmlel,<<"x">>,
                     [{<<"xmlns">>,<<"jabber:x:data">>},
                      {<<"type">>,<<"submit">>}],
                     [{xmlel,<<"field">>,
                       [{<<"type">>,<<"text-single">>},{<<"var">>,<<"fn">>}],
                       [{xmlel,<<"value">>,[],
                         [{xmlcdata,<<"Larry Lawnchair">>}]}]}]}]},
                  {xmlel,<<"error">>,
                   [{<<"code">>,<<"503">>},{<<"type">>,<<"cancel">>}],
                   [{xmlel,<<"service-unavailable">>,
                     [{<<"xmlns">>,<<"urn:ietf:params:xml:ns:xmpp-stanzas">>}],
                     []},
                    {xmlel,<<"text">>,
                     [{<<"xml:lang">>,<<"en">>},
                      {<<"xmlns">>,<<"urn:ietf:params:xml:ns:xmpp-stanzas">>}],
                     [{xmlcdata,
                       <<"No module is handling this query">>}]}]}]}}],
              0},
             nil,
             {4690892439510817,
              {body,<<>>,[],
               [{xmlstreamelement,
                 {xmlel,<<"r">>,[{<<"xmlns">>,<<"urn:xmpp:sm:2">>}],[]}}],
               0},
              nil,nil}}},
           {1,
            {4690892439510818,
             {{<0.544.0>,#Ref<0.577708194.3851943937.46740>},
              {body,<<>>,[],[],0}},
             nil,nil}},
           {{[],[]},0,1000},
           {{0,0,0,0,0,0,0,1},49691},
           2}

Any ideas?

prefiks commented 3 years ago

You probably need to change to attribute in iq to vjud.localhost

jmorrey commented 3 years ago

That worked! Thanks @prefiks!