ejabberd - Comments for "privacy_set in ejabberdctl error" https://www.ejabberd.im/node/4737 en If your users login to https://www.ejabberd.im/node/4737#comment-57842 <p>If your users login to accounts of the domain "mydomain.com", and you send XMLRPC queries to the domain "localhost", then obviously you need to have both domains in the Hosts option.</p> Sun, 18 Sep 2011 10:59:51 +0000 mfoss comment 57842 at https://www.ejabberd.im The solution mentioned https://www.ejabberd.im/node/4737#comment-57837 <p>The solution mentioned above:</p> <p>{hosts, ["mydomain.com"]}.<br /> If there was only this entry, i've get error.</p> <p>So, a have change this to:<br /> {hosts, ["localhost"]}.</p> <p>And yours script works! But i can't connect to server in my domain.</p> <p>So, a changed to:<br /> {hosts, ["localhost", "mydomain.com"]}.</p> <p>could resolve the problem, I presume this is a bug of ejabberd. Had this been fixed? in which version?</p> Fri, 16 Sep 2011 03:28:22 +0000 elvistest4 comment 57837 at https://www.ejabberd.im Hi guys, I have exactly the https://www.ejabberd.im/node/4737#comment-57832 <p>Hi guys,</p> <p>I have exactly the same problem with ejabberd 2.1.8, Can you tell me how can I solve this problem?? Thanks.</p> <p>The purpose of me is to clear the privacy list of "public", so I use the below command:</p> <p><code> ejabberdctl privacy_set 22 hzs-t61-elou &quot;&lt;query xmlns=&#039;jabber:iq:privacy&#039;&gt;&lt;list name=&#039;public&#039;&gt;&lt;/list&gt;&lt;/query&gt;&quot; </code></p> <p>But error was observed at ejabberd log:</p> <p>=INFO REPORT==== 2011-09-15 14:39:57 ===</p> <div class="codeblock"><code>D(&lt;0.478.0&gt;:ejabberd_commands:314) : Executing command mod_admin_extra:privacy_set with Args=[&quot;66&quot;,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs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=ERROR REPORT==== 2011-09-15 14:39:57 ===<br /> {xmlrpc_http,156,<br /> {ejabberd_xmlrpc,handler,<br /> {'EXIT',<br /> {{badmatch,<br /> {error,<br /> {xmlelement,"error",<br /> [{"code","501"},{"type","cancel"}],<br /> [{xmlelement,"feature-not-implemented",<br /> [{"xmlns",<br /> "urn:ietf:params:xml:ns:xmpp-stanzas"}],<br /> []}]}}},<br /> [{mod_admin_extra,privacy_set,3},<br /> {ejabberd_xmlrpc,do_command,6},<br /> {ejabberd_xmlrpc,try_do_command,6},<br /> {xmlrpc_http,eval_payload,6},<br /> {tcp_serv,start_session,3},<br /> {proc_lib,init_p,5}]}}}}</p> <p>Can you tell me how I can resolve the problem? thanks.</p> Thu, 15 Sep 2011 08:22:26 +0000 elvistest4 comment 57832 at https://www.ejabberd.im Your second call says https://www.ejabberd.im/node/4737#comment-57721 <p>Your second call says something about: active. mod_admin_extra didn't support that. I've updated it in SVN, and now it should work. Update SVN and try again.</p> Wed, 10 Aug 2011 16:36:09 +0000 mfoss comment 57721 at https://www.ejabberd.im Hmmm I've found some problem https://www.ejabberd.im/node/4737#comment-57715 <p>Hmmm I've found some problem with this.<br /> I used your's script to make privacy list and set it default and active, but on try to set active it returns error:</p> <div class="codeblock"><code>Traceback (most recent call last):<br />&nbsp; File &quot;pritest.py&quot;, line 11, in &lt;module&gt;<br />&nbsp;&nbsp;&nbsp; result = ejabberdctl(&#039;privacy_set&#039;, {&#039;user&#039;:&#039;43824&#039;, &#039;host&#039;:&#039;domain.eu&#039;, &#039;xmlquery&#039;:&quot;&lt;query xmlns=&#039;jabber:iq:privacy&#039;&gt;&lt;active name=&#039;blocked&#039;/&gt;&lt;/query&gt;&quot;})<br />&nbsp; File &quot;pritest.py&quot;, line 8, in ejabberdctl<br />&nbsp;&nbsp;&nbsp; return fn(data)<br />&nbsp; File &quot;/usr/lib/python2.6/xmlrpclib.py&quot;, line 1199, in __call__<br />&nbsp;&nbsp;&nbsp; return self.__send(self.__name, args)<br />&nbsp; File &quot;/usr/lib/python2.6/xmlrpclib.py&quot;, line 1489, in __request<br />&nbsp;&nbsp;&nbsp; verbose=self.__verbose<br />&nbsp; File &quot;/usr/lib/python2.6/xmlrpclib.py&quot;, line 1243, in request<br />&nbsp;&nbsp;&nbsp; headers<br />xmlrpclib.ProtocolError: &lt;ProtocolError for 127.0.0.1:4560/RPC2: 500 Internal Server Error&gt;</code></div> <p>In pritest.py I have:</p> <div class="codeblock"><code>import xmlrpclib <p>server_url = &#039;http://127.0.0.1:4560&#039;<br />server = xmlrpclib.ServerProxy(server_url)</p> <p>def ejabberdctl(command, data):<br />&nbsp;&nbsp;&nbsp; fn = getattr(server, command)<br />&nbsp;&nbsp;&nbsp; return fn(data)</p> <p>result = ejabberdctl(&#039;privacy_set&#039;, {&#039;user&#039;:&#039;43824&#039;, &#039;host&#039;:&#039;domain.eu&#039;, &#039;xmlquery&#039;:&quot;&lt;query xmlns=&#039;jabber:iq:privacy&#039;&gt;&lt;list name=&#039;blocked&#039;&gt;&lt;item type=&#039;jid&#039; value=&#039;44108@domain.eu&#039; action=&#039;deny&#039; order=&#039;1&#039;&gt;&lt;/item&gt;&lt;/list&gt;&lt;/query&gt;&quot;})<br />result = ejabberdctl(&#039;privacy_set&#039;, {&#039;user&#039;:&#039;43824&#039;, &#039;host&#039;:&#039;domain.eu&#039;, &#039;xmlquery&#039;:&quot;&lt;query xmlns=&#039;jabber:iq:privacy&#039;&gt;&lt;active name=&#039;blocked&#039;/&gt;&lt;/query&gt;&quot;})<br />result = ejabberdctl(&#039;privacy_set&#039;, {&#039;user&#039;:&#039;43824&#039;, &#039;host&#039;:&#039;domain.eu&#039;, &#039;xmlquery&#039;:&quot;&lt;query xmlns=&#039;jabber:iq:privacy&#039;&gt;&lt;default name=&#039;blocked&#039;/&gt;&lt;/query&gt;&quot;})</p> <p>print result</p></code></div> <p>Whats wrong?</p> Wed, 10 Aug 2011 09:15:22 +0000 rysi3k comment 57715 at https://www.ejabberd.im Ok, svn version works great https://www.ejabberd.im/node/4737#comment-57446 <p>Ok, svn version works great :)</p> Wed, 08 Jun 2011 11:23:04 +0000 rysi3k comment 57446 at https://www.ejabberd.im rysi3k wrote: In my opinion https://www.ejabberd.im/node/4737#comment-57443 <div class="quote-msg"> <div class="quote-author"><em>rysi3k</em> wrote:</div> <p>In my opinion something is wrong with this, it should work with any "hosts" configuration.</p></div> <p>Ah, right. I've found the bug in mod_admin_extra.erl, fixed it and committed to SVN.</p> <p>Please update and check it works correctly now.</p> Tue, 07 Jun 2011 21:39:01 +0000 mfoss comment 57443 at https://www.ejabberd.im Yes!! Works, but i think i've https://www.ejabberd.im/node/4737#comment-57440 <p>Yes!! Works, but i think i've found bug :)<br /> Problem was line i ejabberd.cfg:<br /> <code>{hosts, [&quot;mydomain.com&quot;]}.</code><br /> If there was only this entry, i've get error.</p> <p>So, a have change this to:<br /> <code>{hosts, [&quot;localhost&quot;]}.</code></p> <p>And yours script works! But i can't connect to server in my domain.</p> <p>So, a changed to:<br /> <code>{hosts, [&quot;localhost&quot;, &quot;mydomain.com&quot;]}.</code></p> <p>And everything works fine, script, privacy_set and connection to server.<br /> In my opinion something is wrong with this, it should work with any "hosts" configuration.</p> Tue, 07 Jun 2011 13:06:52 +0000 rysi3k comment 57440 at https://www.ejabberd.im I get your same error when I https://www.ejabberd.im/node/4737#comment-57439 <p>I get your same error when I remove mod_privacy of my ejabberd.cfg</p> <p>Do you have mod_privacy enabled in ejabberd.cfg ?</p> <p>Also, check in WebAdmin -&gt; Nodes -&gt; your node -&gt; Modules, if mod_privacy is enabled.</p> <p>Do you see any error when ejabberd starts?</p> <p>More ideas: if you changed a lot of times ejabberd.cfg, or experimented a otwith privacy lists, you can try this: put the default ejabberd.cfg and change it only to add xmlrpc. Also delete the Mnesia spool files, and crete new accounts.</p> Tue, 07 Jun 2011 11:45:36 +0000 mfoss comment 57439 at https://www.ejabberd.im With your's code i https://www.ejabberd.im/node/4737#comment-57436 <p>With your's code i get:</p> <div class="codeblock"><code>python pritest.py<br />Traceback (most recent call last):<br />&nbsp; File &quot;pritest.py&quot;, line 10, in &lt;module&gt;<br />&nbsp;&nbsp;&nbsp; result = ejabberdctl(&#039;privacy_set&#039;, {&#039;user&#039;:&#039;1&#039;, &#039;host&#039;:&#039;localhost&#039;, &#039;xmlquery&#039;:&quot;&lt;query xmlns=&#039;jabber:iq:privacy&#039;&gt;&lt;list name=&#039;blocked&#039;&gt;&lt;item type=&#039;jid&#039; value=&#039;user2@domain.com&#039; action=&#039;allow&#039; order=&#039;1&#039;&gt;&lt;/item&gt;&lt;/list&gt;&lt;/query&gt;&quot;})<br />&nbsp; File &quot;pritest.py&quot;, line 8, in ejabberdctl<br />&nbsp;&nbsp;&nbsp; return fn(data)<br />&nbsp; File &quot;/usr/lib/python2.6/xmlrpclib.py&quot;, line 1199, in __call__<br />&nbsp;&nbsp;&nbsp; return self.__send(self.__name, args)<br />&nbsp; File &quot;/usr/lib/python2.6/xmlrpclib.py&quot;, line 1489, in __request<br />&nbsp;&nbsp;&nbsp; verbose=self.__verbose<br />&nbsp; File &quot;/usr/lib/python2.6/xmlrpclib.py&quot;, line 1243, in request<br />&nbsp;&nbsp;&nbsp; headers<br />xmlrpclib.ProtocolError: &lt;ProtocolError for 127.0.0.1:4560/RPC2: 500 Internal Server Error&gt;</code></div> <p>and in ejabberd.log:</p> <div class="codeblock"><code>D(&lt;0.705.0&gt;:ejabberd_commands:314) : Executing command mod_admin_extra:privacy_set with Args=[&quot;1&quot;,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;localhost&quot;,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;&lt;query xmlns=&#039;jabber:iq:privacy&#039;&gt;&lt;list name=&#039;blocked&#039;&gt;&lt;item type=&#039;jid&#039; value=&#039;user2@domain.com&#039; action=&#039;allow&#039; order=&#039;1&#039;&gt;&lt;/item&gt;&lt;/list&gt;&lt;/query&gt;&quot;] <p>=ERROR REPORT==== 2011-06-07 09:14:53 ===<br />{xmlrpc_http,153,<br />&nbsp;&nbsp;&nbsp; {ejabberd_xmlrpc,handler,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {&#039;EXIT&#039;,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {{badmatch,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {error,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {xmlelement,&quot;error&quot;,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [{&quot;code&quot;,&quot;501&quot;},{&quot;type&quot;,&quot;cancel&quot;}],<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [{xmlelement,&quot;feature-not-implemented&quot;,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [{&quot;xmlns&quot;,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;urn:ietf:params:xml:ns:xmpp-stanzas&quot;}],<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; []}]}}},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [{mod_admin_extra,privacy_set,3},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {ejabberd_xmlrpc,do_command,6},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {ejabberd_xmlrpc,try_do_command,6},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {xmlrpc_http,eval_payload,6},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {tcp_serv,start_session,3},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {proc_lib,init_p_do_apply,3}]}}}}</p></code></div> <p>Please help, i really need it...</p> Tue, 07 Jun 2011 07:16:51 +0000 rysi3k comment 57436 at https://www.ejabberd.im Thanks for your reply. I https://www.ejabberd.im/node/4737#comment-57431 <p>Thanks for your reply.<br /> I tested your code and have the same issue, still i get 500 internal server error ;/<br /> I have ejabberd 2.1.6, maybe there is some error ?</p> Mon, 06 Jun 2011 10:03:08 +0000 rysi3k comment 57431 at https://www.ejabberd.im Maybe you're seeing a problem https://www.ejabberd.im/node/4737#comment-57429 <p>Maybe you're seeing a problem related to this: <a href="http://www.ejabberd.im/node/4739" title="http://www.ejabberd.im/node/4739">http://www.ejabberd.im/node/4739</a><br /> Check my comment there.</p> Mon, 06 Jun 2011 09:15:25 +0000 mfoss comment 57429 at https://www.ejabberd.im I think the problem is in https://www.ejabberd.im/node/4737#comment-57423 <p>I think the problem is in spaces in the shell. I don't know how you can provide a parameter in the shell that has arguments. Any idea?</p> <p>Instead of ejabberdctl, I installed ejabberd_xmlrpc, the xmlrpc erlang library, and then created the file priset.py with this content:</p> <pre> import xmlrpclib server_url = 'http://127.0.0.1:4560' server = xmlrpclib.ServerProxy(server_url) def ejabberdctl(command, data): fn = getattr(server, command) return fn(data) result = ejabberdctl('privacy_set', {'user':'badlop', 'host':'localhost', 'xmlquery':"&lt;query xmlns= 'jabber:iq:privacy'&gt;&lt;list name='blocked'&gt;&lt;item type='jid' value='user2@domain.com' action= 'allow' order='1'&gt;&lt;/item&gt;&lt;/list&gt;&lt;/query&gt;"}) print result </pre><p>This gets a correct result, and the list is set correctly.</p> <pre> $ python priset.py {'res': 0} </pre> Sat, 04 Jun 2011 10:54:09 +0000 mfoss comment 57423 at https://www.ejabberd.im