<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Database cleanup assistance</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=43172513" />
  <subtitle>Database cleanup assistance</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=43172513</id>
  <updated>2026-06-13T12:15:08Z</updated>
  <dc:date>2026-06-13T12:15:08Z</dc:date>
  <entry>
    <title>RE: Database cleanup assistance</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=43184942" />
    <author>
      <name>David Harding</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=43184942</id>
    <updated>2014-09-25T18:35:27Z</updated>
    <published>2014-09-25T18:35:27Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Thank you for the quick response.&lt;br&gt;&lt;br&gt;This line:&lt;br&gt;group = group.getParentGroup();&lt;br&gt;is where the group ends up null.&lt;br&gt;This is caused by the parentGroupId of the original group being set to 0. This happened when the migration process was unable to find the missing layout.&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;
		if (group.isLayout()) {
			group = group.getParentGroup();
		}

		int trashEntriesMaxAge = PrefsPropsUtil.getInteger(
			group.getCompanyId(), PropsKeys.TRASH_ENTRIES_MAX_AGE,
			PropsValues.TRASH_ENTRIES_MAX_AGE);
&lt;/code&gt;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>David Harding</dc:creator>
    <dc:date>2014-09-25T18:35:27Z</dc:date>
  </entry>
  <entry>
    <title>RE: Database cleanup assistance</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=43182172" />
    <author>
      <name>David H Nebinger</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=43182172</id>
    <updated>2014-09-25T18:01:44Z</updated>
    <published>2014-09-25T18:01:44Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Fix the invalid layout record.&lt;br&gt;&lt;br&gt;Basically the line of code is this:&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;		int trashEntriesMaxAge = PrefsPropsUtil.getInteger(
			group.getCompanyId(), PropsKeys.TRASH_ENTRIES_MAX_AGE,
			PropsValues.TRASH_ENTRIES_MAX_AGE);
&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;Not sure what the NPE is coming from, group can't be null or it would have triggered an NPE somewhere else, PropsKeys.TRASH_ENTRIES_MAX_AGE is a string constant, the PropsValues one is pulled from the properties, but it uses code which is typically hardened against NPEs.&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>David H Nebinger</dc:creator>
    <dc:date>2014-09-25T18:01:44Z</dc:date>
  </entry>
  <entry>
    <title>Database cleanup assistance</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=43172512" />
    <author>
      <name>David Harding</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=43172512</id>
    <updated>2014-09-25T15:10:25Z</updated>
    <published>2014-09-25T15:10:25Z</published>
    <summary type="html">We are seeing the following error when the Trash task runs:&lt;br /&gt;&lt;br /&gt;java.lang.NullPointerException&lt;br /&gt;	at com.liferay.portlet.trash.util.TrashImpl.getMaxAge(TrashImpl.java:225)&lt;br /&gt;	at com.liferay.portlet.trash.util.TrashUtil.getMaxAge(TrashUtil.java:80)&lt;br /&gt;	at com.liferay.portlet.trash.service.impl.TrashEntryLocalServiceImpl.getMaxAge(TrashEntryLocalServiceImpl.java:391)&lt;br /&gt;......&lt;br /&gt;&lt;br /&gt;We know that in the past some direct manipulation was done against the database (running Liferay 5.2.3), we do not know exactly what they did as it pre-dates the current team.  The data has since been migrated to Liferay 6.2 EE.&lt;br /&gt;&lt;br /&gt;The stack trace is because there is a Group record with a classPk that points to a Layout record that doesn&amp;#39;t exist.&lt;br /&gt;Does anyone have any suggestions for how to go about cleaning this up?</summary>
    <dc:creator>David Harding</dc:creator>
    <dc:date>2014-09-25T15:10:25Z</dc:date>
  </entry>
</feed>
