Projects tigase _server tigase-muc Issues #130
MysqlDataTruncation: Data truncation: Incorrect datetime value: "1969-12-31 16:00:00" (#130)
wojciech.kapcia@tigase.net opened 5 years ago
<presence to="ivan@vucica.net/mobile" from="tigase@muc.tigase.org/fireglow">
    <show>xa</show>
    <x xmlns="http://jabber.org/protocol/muc#user">
        <item nick="fireglow" role="participant" affiliation="member"/>
    </x>
</presence>

Log:

[2020-03-20 07:23:15:290] [FINEST  ] [              in_3-muc ] JDBCHistoryProvider.getHistoryMessages(): Using SINCE selector: roomJID=tigase@muc.tigase.org, since=0 (Wed Dec 31 16:00:00 PST 1969)
[2020-03-20 07:23:15:292] [FINEST  ] [              in_3-muc ] CIDConnections.sendPacket()      : Packet: from=null, to=null, DATA=<presence to="ivan@vucica.net/mobile" from="tigase@muc.tigase.org/fireglow"><show>xa</show><x xmlns="http://jabber.org/protocol/muc#user"><item nick="fireglow" role="participant" affiliation="member"/></x></presence>, SIZE=216, XMLNS=jabber:client, PRIORITY=PRESENCE, PERMISSION=NONE, TYPE=null, STABLE_ID=null sent over connection: CID: muc.tigase.org@vucica.net, null, type: connect, Socket: TLS: nullSocket[addr=/146.185.142.133,port=5269,localport=52428], jid: null, authenticated: true
[2020-03-20 07:23:15:293] [SEVERE  ] [              in_3-muc ] JDBCHistoryProvider.getHistoryMessages(): Can&apos;t get history
com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect datetime value: &apos;1969-12-31 16:00:00&apos; for column &apos;_since&apos; at row 1
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3976)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3914)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2530)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2683)
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2495)
	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1903)
	at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2011)
	at com.mysql.jdbc.CallableStatement.executeQuery(CallableStatement.java:872)
	at jdk.internal.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
	at tigase.db.jdbc.PreparedStatementInvocationHandler.invoke(PreparedStatementInvocationHandler.java:38)
	at com.sun.proxy.$Proxy35.executeQuery(Unknown Source)
	at tigase.muc.history.JDBCHistoryProvider.getMessagesSince(JDBCHistoryProvider.java:284)
	at tigase.muc.history.JDBCHistoryProvider.getHistoryMessages(JDBCHistoryProvider.java:137)
	at jdk.internal.reflect.GeneratedMethodAccessor64.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
	at tigase.stats.StatisticsInvocationHandler.invoke(StatisticsInvocationHandler.java:75)
	at com.sun.proxy.$Proxy45.getHistoryMessages(Unknown Source)
	at tigase.muc.history.HistoryProviderMDBean.getHistoryMessages(HistoryProviderMDBean.java:102)
	at tigase.muc.modules.PresenceModuleImpl.sendHistoryToUser(PresenceModuleImpl.java:821)
	at tigase.muc.modules.PresenceModuleImpl.processEntering(PresenceModuleImpl.java:618)
	at tigase.muc.modules.PresenceModuleImpl.process(PresenceModuleImpl.java:353)
	at tigase.component.modules.StanzaProcessor.process(StanzaProcessor.java:164)
	at tigase.component.modules.StanzaProcessor.processPacket(StanzaProcessor.java:85)
	at tigase.component.AbstractKernelBasedComponent.processPacket(AbstractKernelBasedComponent.java:81)
	at tigase.muc.MUCComponent.processPacket(MUCComponent.java:122)
	at tigase.muc.cluster.MUCComponentClustered.processPacket(SourceFile:87)
	at tigase.server.AbstractMessageReceiver$QueueListener.run(AbstractMessageReceiver.java:1401)
Andrzej Wójcik (Tigase) commented 5 years ago

The issue only appears when user send since attribute evaluated to negative timestamp in local time zone. Normally we should not seen any timestamp like that with exception to 1970-01-01 00:00 which is evaluated to 0 in the UTC time zone. I've added a simple check to fix this issue.

Please wait...
Page is in error, reload to recover