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

Eric Chamberlain eric at ringfree.com
Fri May 20 02:19:54 MSD 2011


On May 19, 2011, at 3:00 AM, Badlop wrote:

> Maybe you are not running exactly my script:
> check that the username is written using UTF-8 in your local file.
> 
> I use this dirty way to check the encoding:
> $ mv register.py register.py.txt
> $ firefox register.py.txt
> Then I go in the browser menus, and I select Character Encoding: Unicode (UTF-8)
> And the username is displayed correctly, so I know the python script
> contains it in the correct encoding.

This is definitely an encoding issue, but I'm still trying to track down where.

I can register this user with the web interface and from the command line using ejabberdctl.


Using that script you sent, I've tried:

# -*- coding: utf-8 -*-
...
params["user"] = u'الخبراني'

and:

params["user"] = u'\u0627\u0644\u062e\u0628\u0631\u0627\u0646\u064a'

and:

params["user"] = '\xd8\xa7\xd9\x84\xd8\xae\xd8\xa8\xd8\xb1\xd8\xa7\xd9\x86\xd9\x8a'

All produce identical errors in ejabberd.log.


The xmlrpc register request user value is encoded as:

 <value><string>\xd8\xa7\xd9\x84\xd8\xae\xd8\xa8\xd8\xb1\xd8\xa7\xd9\x86\xd9\x8a</string></value>

Which does match (when converted to decimal) what you sent me before:

jlib:nodeprep([216,167,217,132,216,174,216,168,216,177,216,167,217,134,217,138]).
[216,167,217,132,216,174,216,168,216,177,216,167,217,134,217,138]

but does not match the stringprep results in the error log:

=ERROR REPORT==== 2011-05-19 17:56:49 ===
{xmlrpc_http,153,
    {ejabberd_xmlrpc,handler,
        {'EXIT',
            {badarg,
                [{erlang,port_control,
                     [stringprep_port,2,
                      [1575,1604,1582,1576,1585,1575,1606,1610]]},
                 {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}]}}}}


Could you rerun your script with:

server = xmlrpclib.Server(server_url,verbose=True)

And send me the output?  I want to confirm that what my xmlrpclib is sending to ejabberd is the same as what yours is sending.

If the xmlrpc register request user values match, could the problem be with the CentOS erlang-xmlrpc package?

Installed Packages
Name       : erlang-xmlrpc
Arch       : i386
Version    : 1.13
Release    : 2.el5
Size       : 110 k
Repo       : installed
Summary    : HTTP 1.1 compliant XML-RPC library for Erlang
URL        : http://github.com/rwbr/exmlrpc
License    : BSD
Description: HTTP 1.1 compliant XML-RPC library for Erlang.

--
Eric Chamberlain


More information about the ejabberd mailing list