Sunday, October 31, 2010

Googled this one yet? "Data truncated for column 'createDate' at row 1"

This is an interesting case study.

So you're facing a problem in your Liferay 5.2 install (running on Apache Tomcat) where you can't add threads to the message boards, reply to threads, add or edit WIki pages... nada. Everytime you try you get the error message saying the portlet is temporarily unavailable.

Looking in the Catalina.out log you see that an error was logged, preceding a series of exceptions. The error: "Data truncated for column 'createDate' at row 1"

The createDate field in question is in the table SocialActivity in the lportal database.

The backstory:

A Liferay 5.2.3 portal site was to be upgraded to Liferay 6. The new portal was configured to point to the old portal database and the upgrade process began. For whatever reason the upgrade failed so the old 5.2 portal was restarted until the problem could be fixed. Mysteriously, people could suddenly no longer add any social content, like message board threads or Wiki pages.

Here's the problem. In Liferay 5.2 the SocialActivity table's createDate column is a DATETIME field. In Liferay 6 it's a BIGINT. When the upgrade process was running it changed the column type. By going back to Liferay 5.2 and trying to add social content, we're asking the portal to store a DATETIME value into a BIGINT field.


So that field type needs to be changed back to DATETIME or a backup of the database needs to be restored. (You did backup the database, right?)

No comments:

Post a Comment