Legacy Knowledge Base
Published Jun. 30, 2025

Upgrade to 7.4 fails trying to insert records into table DDMFieldAttribute

Written By

Sorin Pop

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • I am performing an upgrade to 7.4 and it fails with errors like these:
    com.liferay.portal.kernel.log.LogSanitizerException: com.liferay.portal.kernel.upgrade.UpgradeException: java.sql.BatchUpdateException: 
    Batch entry 155 insert into DDMFieldAttribute (mvccVersion, ctCollectionId, fieldAttributeId, companyId, fieldId, storageId, attributeName, languageId,
    largeAttributeValue, smallAttributeValue)
    values (0, 0, 221906, 10108, 197794, 15585405, '', '',
    NULL, 'Optimized by JPEGmini 3.18.2.210033067-TBTBLN 0xa358ba22Optimized by JPEGmini 3.18.2.210033067-TBTBLN 0xa358ba22_')
    was aborted:
    ERROR: invalid byte sequence for encoding "UTF8": 0x00 Call getNextException to see other errors in the batch. [Sanitized]

Environment

  • Upgrades to 7.4+

Resolution

  • The problem is that in your database there are some (or there is a) record with the data containing the "\u0000" literal string (e.g. findable with a command like SELECT * FROM DDMContent WHERE data_ like '%\\u0000%'). Such records cause that error at upgrade.
  • As of writing this article, no deeper root cause has been determined yet: e.g. how these parts, these characters are added to the database with normal operation
  • This can be handled through a groovy script that needs to be run in your original pre-upgrade database. The script will scan the DDMContent table and remove any instances of the "\u0000" literal string (note: It does not remove the entire DDMContent, it just removes the "\u0000" string from the DDMContent's data).
  • You can find the script RemoveUnicodeNullValuesFromDDMContentData.groovy for 7.2 attached in this article (it should work for 7.3 too).

To summarize:

  1. Get back to your original database (or a copy of it). You can drop the one on which you ran the failed upgrade script.
  2. Make sure to have a backup of it.
  3. Run the groovy script on it. (from the UI, in Server Administration/Script)
  4. Then try to run again the upgrade.sh on this database.

Since the offending characters have been removed by the script (step 3), the upgrade should not run anymore into this issue.

Additional Information

Did this article resolve your issue ?

Legacy Knowledge Base