[ejabberd] Help me diagnose this error when registering over xmlrpc

Eric Chamberlain eric at ringfree.com
Thu May 19 04:06:51 MSD 2011


On May 18, 2011, at 12:32 PM, Badlop wrote:

> Now I try a full experiment. I write this file:
> --------------------------------------
> !/usr/bin/python
> # vim: set fileencoding=utf-8:
> import xmlrpclib
> server_url = 'http://127.0.0.1:4560';
> server = xmlrpclib.Server(server_url);
> params = {}
> params["user"] = "ﺎﻠﺨﺑﺭﺎﻨﻳ"
> params["host"] = "localhost"
> params["password"] = "pas123"
> result = server.register(params)
> print result
> --------------------------------------
> 
> Then execute it:
> $ python ./register.py
> {'res': 0, 'text': u'User
> \u0627\u0644\u062e\u0628\u0631\u0627\u0646\u064a at localhost
> successfully registered'}

When I run your script (our port and host) I still get the 500 error for non-ascii users.  Why would the script work on your setup and not mine?  We are running python 2.6.5.

Our test script:

#!/usr/bin/python
# vim: set fileencoding=utf-8:
import xmlrpclib
server_url = 'http://127.0.0.1:4561';
server = xmlrpclib.Server(server_url);
params = {}
params["user"] = "ﺎﻠﺨﺑﺭﺎﻨﻳ"
params["host"] = "rf.com"
params["password"] = "pas123"
result = server.register(params)
print result

Traceback (most recent call last):
  File "register2.py", line 10, in <module>
    result = server.register(params)
  File "/usr/lib/python2.6/xmlrpclib.py", line 1199, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.6/xmlrpclib.py", line 1489, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.6/xmlrpclib.py", line 1243, in request
    headers
xmlrpclib.ProtocolError: <ProtocolError for 127.0.0.1:4561/RPC2: 500 Internal Server Error>

And ejabberd.log:

=ERROR REPORT==== 2011-05-18 19:54:59 ===
{xmlrpc_http,153,
    {ejabberd_xmlrpc,handler,
        {'EXIT',
            {badarg,
                [{erlang,port_control,
                     [stringprep_port,2,
                      [65166,65248,65192,65169,65197,65166,65256,65267]]},
                 {stringprep,control,2},
                 {jlib,nodeprep,1},
                 {ejabberd_auth_internal,is_user_exists,2},
                 {ejabberd_auth,'-is_user_exists/2-fun-0-',3},
                 {lists,any,2},
                 {ejabberd_auth,try_register,3},
                 {ejabberd_admin,register,3}]}}}}





More information about the ejabberd mailing list