powered by Jive Software

Unparseable date

I was going to launch my bot which was perfectly working no longer ago but it seems to be broken now… I don’t understand :

Connected to *****************

Logged in as @********/Smack

java.text.ParseException: Unparseable date: “200852T13:31:28”

at java.text.DateFormat.parse(DateFormat.java:335)

at org.jivesoftware.smackx.provider.DelayInformationProvider.parseExtension(DelayI nformationProvider.java:66)

at org.jivesoftware.smack.util.PacketParserUtils.parsePacketExtension(PacketParser Utils.java:378)

at org.jivesoftware.smack.util.PacketParserUtils.parsePresence(PacketParserUtils.j ava:204)

at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:278)

at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:44)

at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:76)

Any Idea ? Thanks.

I have had the same problem. Yesterday, and again today, my bot generated 2000+ lines of error codes (twice), with the following exception repeated again and again:

java.text.ParseException: Unparseable date: “200856T2:39:3”

at java.text.DateFormat.parse(DateFormat.java:337)

at org.jivesoftware.smackx.provider.DelayInformationProvider.parseExtension(DelayI nformationProvider.java:66)

at org.jivesoftware.smack.util.PacketParserUtils.parsePacketExtension(PacketParser Utils.java:378)

at org.jivesoftware.smack.util.PacketParserUtils.parsePresence(PacketParserUtils.j ava:204)

at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:278)

at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:44)

at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:76)

java.text.ParseException: Unparseable date: “200856T2:39:3”

at java.text.DateFormat.parse(DateFormat.java:337)

at org.jivesoftware.smackx.provider.DelayInformationProvider.parseExtension(DelayI nformationProvider.java:66)

at org.jivesoftware.smack.util.PacketParserUtils.parsePacketExtension(PacketParser Utils.java:378)

at org.jivesoftware.smack.util.PacketParserUtils.parsePresence(PacketParserUtils.j ava:204)

at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:278)

at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:44)

at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:76)

The date changes every few entries, but everything else stays the same.

Any ideas?

Today it works… I’ve changed nothing.

The bug is still here !!!

java.text.ParseException: Unparseable date: “200861T16:33:47”

at java.text.DateFormat.parse(DateFormat.java:335)

at org.jivesoftware.smackx.provider.DelayInformationProvider.parseExtension(DelayI nformationProvider.java:66)

at org.jivesoftware.smack.util.PacketParserUtils.parsePacketExtension(PacketParser Utils.java:378)

at org.jivesoftware.smack.util.PacketParserUtils.parsePresence(PacketParserUtils.j ava:204)

at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:278)

at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:44)

at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:76)

Help ! It’s important !

It also came back today for me.

Maxime, what server are you connecting to? I’m connecting to gmail.com. Perhaps it has something to do with how they are reporting dates or something?

Michael

If you look at the faulty date

"200861T16:33:47"

The “T” in there seems wrong to me. I think they use a format of yyyyMd"T"kk:mm:ss - the “T” is the separator between the date and time. That said, this format is very buggy, only one digit for month and day without leading zeroes, this can be hard to parse.

You’ll have to look at gTalks specifications (which aren’t XMPP compliant), if that’s who you are trying to connect to.

My bot is running on a MUC using Openfire 3.5.1 as server.

And who/what sent the packet with the faulty date? There you might be able to pin-point the bug…

I don’t know, the bot is working now…

I am having the same problem here with gtalk gateway. I need to stop and restart the service but after a few hours it is back. any ideas on a resolution?

The bug still appears sometimes. It’s really a problem for a bot who must be connected h24!

How can I catch the packet ? The only thing I know is that it’s only related to the date when the message is sent.

Plus, as you can see, the error is raised by Smack itself, I don’t know what can I do !! And if the date is malformed, the packet is sent by psi to openfire and openfire send it to my bot. So the problem concern openfire if the problem is an invalid date format.

Oh !!! I’ve found something !!! I know how to crash my bot !

If I send :

<message id=“IbXQi-45” type=“groupchat” to="main@conference.myserver.fr">

<body>(test)</body>

<x xmlns=“jabber:x:delay” stamp=“200868T09:16:20” from="mylogin@myserver.fr"/>

</message>

My bot quit. And there nothing I can do if the packet is handled by Smack… Please, you have to do something. Maybe Openfire shouldn’t send malformed packets ?

After a reconnection on the room, I can see that my packet has been rewriten like this : (and the bot accepts it there…)

<message id=“IbXQi-45” type=“groupchat” to="mylogin@myserver.fr/MyClient" from="main@conference.myserver.fr/Max">

<body>(test)</body>

<x xmlns=“jabber:x:delay” stamp=“200868T09:16:20” from="mylogin@myserver.fr"/>

<x xmlns=“jabber:x:delay” stamp=“20080608T07:18:48” from="mylogin@myserver.fr/MyClient"/>

</message>

I don’t think it is an open-fire specific issue, since I get the same problem with gchat. And I don’t think it is related to MUC either, since my bot is not doing anything with MUC. It is something wrong with Smack. I think it only happens during the first few days of the month, when the packets are dated with mdyyyy instead of mmddyyyy.

Michael

This bug also concerns Spark because Spark use Smack.

It’s really easy to kick off someone who use Spark !!! Just send this :

<message to="victim@hisserver.fr/spark" type=“chat” id=“1345”>

<body>plop</body>

<x xmlns=“jabber:x:delay” stamp=“200868T09:16:20” from="mylogin@monserver.fr"/>

<thread>9gOp44</thread>

</message>

And bye bye victim.

I hope this security issue will be fixed soon !!!

Another similar old bug report SMACK-207

Daniel (in Live Chat) is saying he was fixing that in Openfire trunk. He says it must be an Openfire bug, not smack. Btw, you are testing only with Openfire server? Anyway, please test that with next version of Openfire and then report back.

My bot is running on gchat. Google aren’t using OpenFire, are they?

Michael

Yes, Openfire shouldn’t relay invalid packets, nevertheless Smack shouldn’t hang up when it receives a bad paquet ! The packet should be ignored.

I’ll try as soon as possible with the next release.

According to what Daniel says it’s not Smack that hangs up, but Openfire is closing Smack’s connection upon getting that packet.

Well, i dont really want to install some other xmpp server to test that Can somebody test that with say ejabberd + Spark?

No ! It’s not the one who send an invalid packet who is kicked off ! It’s the ones who can’t parse it correctly and it’s not openfire which kick’em off, reread my first post.

The problem is simple :

An invalid packet is sent to a client. If the client can handle it (like gajim/psi etc), there is no problem. But if the client uses Smack to deal with xmpp, smack crash/bug and the client is disconnected.

So there is two things :

  • Openfire relay packets without checking them correctly. I can understand this choice anyway.

  • Smack receives a packet, can’t parse it and disconnect the client. => Smack should ignore it.