Issue
- When upgrading to Liferay DXP 7.4 or Quarterly Releases there are some warnings in upgrade.log with below stacktrace
WARN [main][DDMFieldUpgradeProcess:626] Unable to get dynamic data mapping form field value type for content ID 1924622
java.lang.NullPointerException: null
at com.liferay.dynamic.data.mapping.storage.DDMFormFieldValue.getType(DDMFormFieldValue.java:131) ~[?:?]
Environment
- Liferay DXP 7.4, 2023.Q3, 2023.Q4
Resolution
Explanation:
- Those NullPointerExceptions are benign. Basically, they occur when there are Form submissions for a Form, which include a field that no longer exists in the Form.
- This typically happens if the Form is published, and then users submit entries to the Form, and then later the Form is modified to remove a field(s) from it. These NullPointerExceptions don't cause any data issues, nor do they stop the upgrade from completing successfully.
- It just means that those specific fields (the ones that no longer exist in the Form definition) could not be migrated successfully. But this should be OK since the fields no longer exist in the Form definition in the first place.
Mitigation:
- To prevent this WARN happening, You could look up the specific pieces of content in your pre-upgrade database backup to see why you might be triggering this error. For example, you could run a query like:
SELECT * FROM DDMContent WHERE contentId = 1924622
- After that you could examine the "data_" column of the returned DDMContent. If it is blank, then you can delete this entry using product API
DDMContentLocalServiceUtil.deleteDDMContent(contentId)
in the pre-upgrade database.
NOTE: Be sure to take a backup of your database prior to making any changes. Always test the changes in a lower environment before making changes in production.
Making manual changes to the database is not recommended, and should be carefully assessed based on your own business needs and risk factors. Any such operation is performed at the sole discretion of your own team.