Issue: Data truncation - Data too long for column 'activityLogs' error in Release when archiving

Issue

Multiple occurrences of the following error in the logs:

ERROR c.x.x.s.ArchivingScheduleService - Could not archive release [Folder39fd9bf12f754af2ad45dde1
f235a2e8/Releasebc182ebea06d43279486041d2ba97951]: PreparedStatementCallback; SQL [UPDATE
RELEASES
SET
releaseJson = ?,
activityLogs = ?,
preArchived = ?
WHERE releaseId = ?]; Data truncation: Data too long for column 'activityLogs' at row 1; nested
exception is com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column
'activityLogs' at row 1
org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [UPDATE
RELEASES
SET
releaseJson = ?,
activityLogs = ?,
preArchived = ?
WHERE releaseId = ?]; Data truncation: Data too long for column 'activityLogs' at row 1; nested
exception is com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column
'activity Logs' at row 1
at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLException
Translator.java:104)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallback
SQLExceptionTranslator.java:70)

Affected Products & Versions

Release - All versions

Cause

ActivityLogs size is more than 16MB.

By default, the ActivityLogs column is of medium blob type i.e. 16 Mb, which should be sufficient in our opinion.

Workaround/Resolution Action

  • Delete the releases whose activityLogs size is more than 16Mb
  • Try to understand why the activity logs are going beyond 16Mb and see if it can be reduced. We think mediumblob should be sufficient enough to store JSON up to 16,777,215 bytes(16 Mb) keeping performance in mind. 
  • Increase the size of the column by changing the mediumblob type to longblob. Please check with your DBA on how to do this. One of the concerns with respect to this is that, in the future, if we do any changes in column size, it may break.

Considerations

  • Why does this message keep appearing repeatedly in the logs?

The application will try to archive the release(s) per the archiving policy. If a release cannot be archived by the application, it will throw an error indicating that. As long as the release is not archived, it will keep trying to archive it; hence, the errors will be displayed multiple times in the logs. This is considered to be the correct behavior. The application should always throw the error when an archive fails. If multiple releases cannot be archived, it should indicate all of those in the logs.

 

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.