ejabberd - Comments for "Using mod_pubsub via console" https://www.ejabberd.im/forum/28713/using-modpubsub-console en Okay, so i just figured out https://www.ejabberd.im/forum/28713/using-modpubsub-console#comment-67391 <p>Okay, so i just figured out in get_items/2 case:<br /> The args type in the ejabberd_commands declaration must be binary: </p> <div class="codeblock"><code>args = [{host, binary}, {node, binary}],</code></div> <p>And a native call for get_items/2 looks like this: </p> <div class="codeblock"><code>mod_pubsub:get_items(&lt;&lt;&quot;pubsub.mydomain&quot;&gt;&gt;, &lt;&lt;&quot;NodeName&quot;&gt;&gt;)</code></div> <p>If the node got string instead of binary, it wont run in error or warning, just simply will not found the node.</p> Thu, 30 Mar 2017 12:08:50 +0000 Dywel comment 67391 at https://www.ejabberd.im Yea i got this idea too, but https://www.ejabberd.im/forum/28713/using-modpubsub-console#comment-67390 <p>Yea i got this idea too, but after compile pubsub (either without changes) the ejabberd wont start and return with this error:</p> <div class="codeblock"><code>[critical] &lt;0.38.0&gt;@gen_mod:start_module:162 Problem starting the module mod_pubsub for host &lt;&lt;&quot;myhost.hu&quot;&gt;&gt; <br /> options: [{access_createnode,all},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {ignore_pep_from_offline,true},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {last_item_cache,false},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {plugins,[&lt;&lt;&quot;flat&quot;&gt;&gt;,&lt;&lt;&quot;hometree&quot;&gt;&gt;,&lt;&lt;&quot;pep&quot;&gt;&gt;]}]<br /> error: undef<br />[{gen_mod,start_child,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [mod_pubsub,&lt;&lt;&quot;myhost.hu&quot;&gt;&gt;,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [{access_createnode,all},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {ignore_pep_from_offline,true},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {last_item_cache,false},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {plugins,[&lt;&lt;&quot;flat&quot;&gt;&gt;,&lt;&lt;&quot;hometree&quot;&gt;&gt;,&lt;&lt;&quot;pep&quot;&gt;&gt;]}]],<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; []},<br /> {gen_mod,start_module,3,[{file,&quot;src/gen_mod.erl&quot;},{line,154}]},<br /> {lists,foreach,2,[{file,&quot;lists.erl&quot;},{line,1337}]},<br /> {ejabberd_app,start,2,[{file,&quot;src/ejabberd_app.erl&quot;},{line,77}]},<br /> {application_master,start_it_old,4,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [{file,&quot;application_master.erl&quot;},{line,273}]}]<br />2017-03-29 07:05:33.466 [critical] &lt;0.38.0&gt;@gen_mod:maybe_halt_ejabberd:170 ejabberd initialization was aborted because a module start failed.</code></div> <p>I found the same error in forums with other modules, but can't solve this problem. And this is not a priority problem for me.</p> Wed, 29 Mar 2017 11:12:22 +0000 Dywel comment 67390 at https://www.ejabberd.im > a native erlang call https://www.ejabberd.im/forum/28713/using-modpubsub-console#comment-67388 <p>&gt; a native erlang call example for get_items/2 and create_node/5.</p> <p>You can know what arguments, and in what format they are expected, if you add some debug lines like this one, recompile, install, then trigger the code with a normal client, and see the log lines in the ejabberd log:</p> <pre> --- a/src/mod_pubsub.erl +++ b/src/mod_pubsub.erl @@ -2137,6 +2137,7 @@ get_items(Host, Node, From, SubId, SMaxItems, ItemIds, RSM) -&gt; end. get_items(Host, Node) -&gt; + ?INFO_MSG("get_items, Host: ~p, Node: ~p.", [Host, Node]), Action = fun (#pubsub_node{type = Type, id = Nidx}) -&gt; node_call(Host, Type, get_items, [Nidx, service_jid(Host), undefined]) end, </pre> Wed, 29 Mar 2017 09:51:58 +0000 badlop comment 67388 at https://www.ejabberd.im