com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'subject' at row 1

JIRA | wroot | 6 years ago
  1. 0

    Just done some more investigation of this and it's not so bad - just annoying. Steps to reproduce: 1. Start Openfire (tested with 3.6.4) 2. Create a MUC room and ensure it is set to be logged. Also ensure the service is set to log at regular intervals 3. Send a message using an IM client (I used PSi but any will do) but with a subject node following the body node (this is valid XMPP it seems). You'll probably need to send the raw XML itself depending on your client. 4. Tail your error log and watch it grow with SQL exceptions as Openfire tries to write that line to the conversation log every single time the flush interval comes up. It seems that any messages you send afterwards do get persisted though. I don't know how important people feel this is, it's just an annoyance for our ops team who like nice clean empty error logs. I guess a solution would be to truncate the subject deep down in the MUCPersistenceManager, possibly as the first line before saveConversationLogEntry is called. error example: {code} 2010.09.14 02:45:25 [org.jivesoftware.openfire.muc.spi.MUCPersistenceManager.saveConversationLogEnt ry(MUCPersistenceManager.java:991)] Error saving conversation log entry com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'subject' at row 1 at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2983) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723) at com.mysql.jdbc.Connection.execSQL(Connection.java:3283) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1332) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1604) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1519) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1504) at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.logicalcobwebs.proxool.ProxyStatement.invoke(ProxyStatement.java:100) at org.logicalcobwebs.proxool.ProxyStatement.intercept(ProxyStatement.java:57) at $java.sql.PreparedStatement$$EnhancerByProxool$$2d6807aa.executeUpdate(<generat ed>) at org.jivesoftware.openfire.muc.spi.MUCPersistenceManager.saveConversationLogEntr y(MUCPersistenceManager.java:987) at org.jivesoftware.openfire.muc.spi.MultiUserChatServiceImpl.logConversation(Mult iUserChatServiceImpl.java:415) at org.jivesoftware.openfire.muc.spi.MultiUserChatServiceImpl.access$100(MultiUser ChatServiceImpl.java:64) at org.jivesoftware.openfire.muc.spi.MultiUserChatServiceImpl$LogConversationTask. run(MultiUserChatServiceImpl.java:401) at java.util.TimerThread.mainLoop(Timer.java:512) at java.util.TimerThread.run(Timer.java:462) {code} Maybe it should write something into warn.log instead. Or maybe it should save or truncate such subjects on a batch save.

    Jive Software Open Source | 6 years ago | wroot
    com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'subject' at row 1
  2. 0

    Just done some more investigation of this and it's not so bad - just annoying. Steps to reproduce: 1. Start Openfire (tested with 3.6.4) 2. Create a MUC room and ensure it is set to be logged. Also ensure the service is set to log at regular intervals 3. Send a message using an IM client (I used PSi but any will do) but with a subject node following the body node (this is valid XMPP it seems). You'll probably need to send the raw XML itself depending on your client. 4. Tail your error log and watch it grow with SQL exceptions as Openfire tries to write that line to the conversation log every single time the flush interval comes up. It seems that any messages you send afterwards do get persisted though. I don't know how important people feel this is, it's just an annoyance for our ops team who like nice clean empty error logs. I guess a solution would be to truncate the subject deep down in the MUCPersistenceManager, possibly as the first line before saveConversationLogEntry is called. error example: {code} 2010.09.14 02:45:25 [org.jivesoftware.openfire.muc.spi.MUCPersistenceManager.saveConversationLogEnt ry(MUCPersistenceManager.java:991)] Error saving conversation log entry com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'subject' at row 1 at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2983) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723) at com.mysql.jdbc.Connection.execSQL(Connection.java:3283) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1332) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1604) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1519) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1504) at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.logicalcobwebs.proxool.ProxyStatement.invoke(ProxyStatement.java:100) at org.logicalcobwebs.proxool.ProxyStatement.intercept(ProxyStatement.java:57) at $java.sql.PreparedStatement$$EnhancerByProxool$$2d6807aa.executeUpdate(<generat ed>) at org.jivesoftware.openfire.muc.spi.MUCPersistenceManager.saveConversationLogEntr y(MUCPersistenceManager.java:987) at org.jivesoftware.openfire.muc.spi.MultiUserChatServiceImpl.logConversation(Mult iUserChatServiceImpl.java:415) at org.jivesoftware.openfire.muc.spi.MultiUserChatServiceImpl.access$100(MultiUser ChatServiceImpl.java:64) at org.jivesoftware.openfire.muc.spi.MultiUserChatServiceImpl$LogConversationTask. run(MultiUserChatServiceImpl.java:401) at java.util.TimerThread.mainLoop(Timer.java:512) at java.util.TimerThread.run(Timer.java:462) {code} Maybe it should write something into warn.log instead. Or maybe it should save or truncate such subjects on a batch save.

    JIRA | 6 years ago | wroot
    com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'subject' at row 1
  3. 0

    Just done some more investigation of this and it's not so bad - just annoying. Steps to reproduce: 1. Start Openfire (tested with 3.6.4) 2. Create a MUC room and ensure it is set to be logged. Also ensure the service is set to log at regular intervals 3. Send a message using an IM client (I used PSi but any will do) but with a subject node following the body node (this is valid XMPP it seems). You'll probably need to send the raw XML itself depending on your client. 4. Tail your error log and watch it grow with SQL exceptions as Openfire tries to write that line to the conversation log every single time the flush interval comes up. It seems that any messages you send afterwards do get persisted though. I don't know how important people feel this is, it's just an annoyance for our ops team who like nice clean empty error logs. I guess a solution would be to truncate the subject deep down in the MUCPersistenceManager, possibly as the first line before saveConversationLogEntry is called. error example: {code} 2010.09.14 02:45:25 [org.jivesoftware.openfire.muc.spi.MUCPersistenceManager.saveConversationLogEnt ry(MUCPersistenceManager.java:991)] Error saving conversation log entry com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'subject' at row 1 at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2983) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723) at com.mysql.jdbc.Connection.execSQL(Connection.java:3283) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1332) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1604) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1519) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1504) at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.logicalcobwebs.proxool.ProxyStatement.invoke(ProxyStatement.java:100) at org.logicalcobwebs.proxool.ProxyStatement.intercept(ProxyStatement.java:57) at $java.sql.PreparedStatement$$EnhancerByProxool$$2d6807aa.executeUpdate(<generat ed>) at org.jivesoftware.openfire.muc.spi.MUCPersistenceManager.saveConversationLogEntr y(MUCPersistenceManager.java:987) at org.jivesoftware.openfire.muc.spi.MultiUserChatServiceImpl.logConversation(Mult iUserChatServiceImpl.java:415) at org.jivesoftware.openfire.muc.spi.MultiUserChatServiceImpl.access$100(MultiUser ChatServiceImpl.java:64) at org.jivesoftware.openfire.muc.spi.MultiUserChatServiceImpl$LogConversationTask. run(MultiUserChatServiceImpl.java:401) at java.util.TimerThread.mainLoop(Timer.java:512) at java.util.TimerThread.run(Timer.java:462) {code} Maybe it should write something into warn.log instead. Or maybe it should save or truncate such subjects on a batch save.

    Jive Software Open Source | 6 years ago | wroot
    com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'subject' at row 1
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Problem with adding time (JDBC and Relational Databases forum at JavaRanch)

    coderanch.com | 1 year ago
    com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect datetime value: '25-apr-2013' for column 'Time' at row 1
  6. 0

    Hibernate 5 + Java 8 LocalDateTime

    Stack Overflow | 1 year ago | Asaak
    org.hibernate.exception.DataException: could not execute statement

  1. tvrmsmith 1 times, last 4 months ago
  2. mortalman7 1 times, last 4 months ago
  3. poroszd 1 times, last 7 months ago
  4. rp 2 times, last 7 months ago
  5. MrMonkey 2 times, last 9 months ago
13 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. com.mysql.jdbc.MysqlDataTruncation

    Data truncation: Data too long for column 'subject' at row 1

    at com.mysql.jdbc.MysqlIO.checkErrorPacket()
  2. MySQL jdbc
    PreparedStatement.executeUpdate
    1. com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2983)
    2. com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
    3. com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
    4. com.mysql.jdbc.Connection.execSQL(Connection.java:3283)
    5. com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1332)
    6. com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1604)
    7. com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1519)
    8. com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1504)
    8 frames
  3. Java RT
    GeneratedMethodAccessor11.invoke
    1. sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
    1 frame