Uploaded image for project: 'Jira Software Data Center'
  1. Jira Software Data Center
  2. JSWSERVER-14462

Data Truncation Error Should be More Descriptive

XMLWordPrintable

    • 1
    • We collect Jira feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      When attempting to Sync a GitHub respository with the DVCS connector the following stacktrace was seen:

      com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'MESSAGE' at row 1
      com.atlassian.activeobjects.internal.ActiveObjectsSqlException: There was a SQL exception thrown by the Active Objects library:
      Database:
      	- name:MySQL
      	- version:5.5.29-0ubuntu1
      	- minor version:5
      	- major version:5
      Driver:
      	- name:MySQL Connector Java
      	- version:mysql-connector-java-5.1.25 ( Revision: ${bzr.revision-id} )
      
      com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'MESSAGE' at row 1
      	at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.create(EntityManagedActiveObjects.java:105)
      	at com.atlassian.activeobjects.osgi.DelegatingActiveObjects.create(DelegatingActiveObjects.java:61)
      ...
      Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'MESSAGE' at row 1
      	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4185)
      	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4119)
      	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2570)
      	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2731)
      	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2815)
      	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155)
      	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2458)
      	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2375)
      	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2359)
      	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
      
      • Strict Mode did not do anything as well.
      • Ultimately changing the datatype to 'LONGTEXT' solved this issue.
      Workaround

      The problem here was that the length of the message in the repository was beyond what the datatype "text" could receive (64k), so making this bigger solved the issue.

      ALTER TABLE 'AO_E8B6CC_CHANGESET_MAPPING' MODIFY MESSAGE LONGTEXT;
      

      Can we make this error more descriptive or possibly output the value that is too long in the logs, or even the frontend for the customer to easily understand?

              Unassigned Unassigned
              cshim ChrisA
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: