userImportExport bug?

Hi, i was importing some files to create new users from a xml file, and i noticed two issues:

  • Some usernames that have the structure: user@somethingelse.com in tags were not loaded into the database and the process was terminated immediately showing a blank screen.

  • Some jid’'s from the roster that have the structure: +1122334455@hotmail.com or something so (mobile contacts) were not loaded into the database and the process was terminated immediately showing a blank screen

I dont know if the problem is in the plugin or in org.jivesoftware.wildfire.user. or .roster for parsing these symbols (+ and @) .

I had these issues with Wildfire 3.1.1 and userImportExport plugin 2.0.4

Regards.

Omar Lara Salazar

Message was edited by: chito

Hi Omar,

Thank you for the feedback.

For the first issue, "user@somethingelse.co" would be considered a JID, not a username. But in either case, you shouldn’‘t get a blank screen if there were problems, I’‘ll see what’'s going on and figure out a fix.

For the second issue, I just tried an importing a user with the roster item that had a jid of "+1122334455@hotmail.com" and didn’'t have any problems. Would you be able to provide me with a sample the file that you were trying to import?

Thanks,

Ryan

Sorry, the case i had problems with the second issue, was with +1122334455@msn.mydomain.com: i.e.

and so on .

concerning to the first issue, i had some users that were registered as user@domain.com as Username because i needed to distinguish between a user@domain.com and user@domain2.com just for testing because i didnt find multidomain support in wildfire.

Regards,

Omar Lara

Hi Omar,

Sorry, the case i had problems with the second issue, was with +1122334455@msn.mydomain.com: i.e.

  <Item jid="+349760586@msn.mydomain.com" askstatus="-1" recvstatus="-1" substatus="3">

and so on .

Hmm… I didn’'t have any problems importing this one either. Are you seeing any errors in your logs that look like they might be related? What database are you using.

concerning to the first issue, i had some users that were registered as user@domain.com as Username because i needed to distinguish between a user@domain.com and user@domain2.com just for testing because i didnt find multidomain support in wildfire.

Ah, gotcha. As you said Wildfire does not currently have mutli-domain support but an issue for it has been filled, JM-919 (be sure to vote for it to raise its priority). Once multi-domain support is added the plugin will probably have be reworked somewhat. If I had to guess I would suspect that the domain portion will probably be broken out into a seperate field in the Wildfire database so the import file will probably end up looking something like:

<User>
    <Username>JavaDood</Username>
    <Domain>example.com</Domain>
    <Password>iluvth3java</Password>
    ...

Thanks,

Ryan

My database is MySQL 5 and here is a sample:

&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;Wildfire&gt;
  &lt;User&gt;
    &lt;Username&gt;username@somedomain.com&lt;/Username&gt;
    &lt;Password&gt;thepassword&lt;/Password&gt;
    &lt;Email/&gt;
    &lt;Name/&gt;
    &lt;CreationDate&gt;1167174326470&lt;/CreationDate&gt;
    &lt;ModifiedDate/&gt;
    &lt;Roster&gt;
      &lt;Item jid="otheruser@mydomain.com" askstatus="-1" recvstatus="-1" substatus="3"&gt;
        &lt;Group/&gt;
      &lt;/Item&gt;
      &lt;Item jid="anotheruser@mydomain.com" askstatus="-1" recvstatus="-1" substatus="3"&gt;
        &lt;Group/&gt;
      &lt;/Item&gt;
      &lt;Item jid="userone%hotmail.com@msn.mydomain.com" askstatus="-1" recvstatus="-1" substatus="3"&gt;
        &lt;Group/&gt;
      &lt;/Item&gt;
      &lt;Item jid="usertwo%hotmail.com@msn.mydomain.com" askstatus="-1" recvstatus="-1" substatus="3"&gt;
        &lt;Group/&gt;
      &lt;/Item&gt;
      &lt;Item jid="userthree%hotmail.com@msn.mydomain.com" askstatus="-1" recvstatus="-1" substatus="3"&gt;
        &lt;Group/&gt;
      &lt;/Item&gt;
      &lt;Item jid="userfour%hotmail.com@msn.mydomain.com" askstatus="-1" recvstatus="-1" substatus="3"&gt;
        &lt;Group/&gt;
      &lt;/Item&gt;
      &lt;Item jid="userfive%yahoo.es@msn.mydomain.com" askstatus="-1" recvstatus="-1" substatus="3"&gt;
        &lt;Group/&gt;
      &lt;/Item&gt;
      &lt;Item jid="usersix%hotmail.com@msn.mydomain.com" askstatus="-1" recvstatus="-1" substatus="3"&gt;
        &lt;Group/&gt;
      &lt;/Item&gt;
      &lt;Item jid="userseven%hotmail.com@msn.mydomain.com" askstatus="-1" recvstatus="-1" substatus="3"&gt;
        &lt;Group/&gt;
      &lt;/Item&gt;
      &lt;Item jid="+34666308292@msn.mydomain.com" askstatus="-1" recvstatus="-1" substatus="3"&gt;
        &lt;Group/&gt;
      &lt;/Item&gt;
      &lt;Item jid="usereight%hotmail.com@msn.mydomain.com" askstatus="-1" recvstatus="-1" substatus="3"&gt;
        &lt;Group/&gt;
      &lt;/Item&gt;
      &lt;Item jid="+503462782890@msn.mydomain.com" askstatus="-1" recvstatus="-1" substatus="3"&gt;
        &lt;Group/&gt;
      &lt;/Item&gt;
      &lt;Item jid="+349497329@msn.mydomain.com" askstatus="-1" recvstatus="-1" substatus="3"&gt;
        &lt;Group/&gt;
      &lt;/Item&gt;
    &lt;/Roster&gt;
  &lt;/User&gt;
&lt;/Wildfire&gt;

Where mydomain.com is the domain configured in the wildfire and msn.mydomain.com is the subdomain for the MSN transport with PyMSNt via external component.

I was looking for a log on error.log and i got:

2007.01.18 17:35:31 [org.jivesoftware.wildfire.container.PluginServlet.service(PluginServlet.java:104)]
java.lang.IllegalArgumentException: Invalid username: username@somedomain.com
at org.jivesoftware.wildfire.user.UserManager.createUser(UserManager.java:128)
at org.jivesoftware.wildfire.plugin.ImportExportPlugin.importUsers(ImportExportPlugin.java:239)
at org.jivesoftware.wildfire.plugin.ImportExportPlugin.importUserData(ImportExportPlugin.java:103)
at org.jivesoftware.wildfire.plugin.userImportExport.import_002duser_002ddata_jsp._jspService(import_002duser_002ddata_jsp.j
ava:84)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at org.jivesoftware.wildfire.container.PluginServlet.handleJSP(PluginServlet.java:234)
at org.jivesoftware.wildfire.container.PluginServlet.service(PluginServlet.java:92)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:830)
at org.jivesoftware.admin.PluginFilter.doFilter(PluginFilter.java:69)
at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
at org.jivesoftware.admin.AuthCheckFilter.doFilter(AuthCheckFilter.java:98)
at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
at org.jivesoftware.util.LocaleFilter.doFilter(LocaleFilter.java:65)
at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
at org.jivesoftware.util.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:41)
at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
at org.jivesoftware.admin.PluginFilter.doFilter(PluginFilter.java:69)
at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
at org.jivesoftware.admin.AuthCheckFilter.doFilter(AuthCheckFilter.java:98)
at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:471)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
at org.mortbay.http.HttpServer.service(HttpServer.java:909)
at org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:982)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
Caused by: org.jivesoftware.stringprep.StringprepException: Contains prohibited code points.
at org.jivesoftware.stringprep.Stringprep.nodeprep(Stringprep.java:120)
at org.jivesoftware.wildfire.user.UserManager.createUser(UserManager.java:125)
... 37 more

Concerning the second issue is correct i have verified and i dont have any problem, but i found that if i add a jid with’’:’’ the following error is displayed in error.log:

i.e.:

I dont know why there is a jid like that but i have found some users with that contacts, i have written a tool for migrate rosters from jabberd 1.4 to wildfire, and for that reason is that i noticed all these issues

The error i got when tried to insert some contact like that was:

2007.01.18 18:02:29 org.jivesoftware.wildfire.container.PluginServlet.service(PluginServlet.java:104 )

java.lang.IllegalArgumentException: Illegal JID: tel:+34635331610@msn.mydomain.com

at org.xmpp.packet.JID.init(JID.java:401)

at org.xmpp.packet.JID.(JID.java:257)

at org.jivesoftware.wildfire.plugin.ImportExportPlugin.importUsers(ImportExportPlu gin.java:227)

at org.jivesoftware.wildfire.plugin.ImportExportPlugin.importUserData(ImportExport Plugin.java:103)

at org.jivesoftware.wildfire.plugin.userImportExport.import_002duser_002ddata_jsp. _jspService(import_002duser_002ddata_jsp.java:84)

at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)

at org.jivesoftware.wildfire.container.PluginServlet.handleJSP(PluginServlet.java: 234)

at org.jivesoftware.wildfire.container.PluginServlet.service(PluginServlet.java:92 )

at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)

at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)

at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplica tionHandler.java:830)

at org.jivesoftware.admin.PluginFilter.doFilter(PluginFilter.java:69)

at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplica tionHandler.java:821)

at org.jivesoftware.admin.AuthCheckFilter.doFilter(AuthCheckFilter.java:98)

at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplica tionHandler.java:821)

at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:11 8)

at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)

at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplica tionHandler.java:821)

at org.jivesoftware.util.LocaleFilter.doFilter(LocaleFilter.java:65)

at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplica tionHandler.java:821)

at org.jivesoftware.util.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingF ilter.java:41)

at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplica tionHandler.java:821)

at org.jivesoftware.admin.PluginFilter.doFilter(PluginFilter.java:69)

at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplica tionHandler.java:821)

at org.jivesoftware.admin.AuthCheckFilter.doFilter(AuthCheckFilter.java:98)

at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplica tionHandler.java:821)

at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler. java:471)

at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)

at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)

at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.ja va:633)

at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)

at org.mortbay.http.HttpServer.service(HttpServer.java:909)

at org.mortbay.http.HttpConnection.service(HttpConnection.java:816)

at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:982)

at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)

at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)

at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)

at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)

Caused by: org.jivesoftware.stringprep.StringprepException: Contains prohibited code points.

at org.jivesoftware.stringprep.Stringprep.nodeprep(Stringprep.java:120)

at org.xmpp.packet.JID.init(JID.java:350)

… 38 more

It is good to know that there is an open issue for adding multi-domain support, i will vote for it

Thanks in advance,

Omar Lara

Message was edited by: chito