XML Backup of Crowd database fails with NullPointerException
プラットフォームについて: Server と Data Center のみ - この記事は、サーバーおよびデータセンター プラットフォームのアトラシアン製品にのみ適用されます。
要約
Performing an XML backup of the Crowd instance can fail with a java.lang.NullPointerException error.
環境
Crowd Server and Data Center
診断
Within the application log, check for the following NPE exception:
Stack trace :
java.lang.NullPointerException
at com.atlassian.crowd.migration.MembershipMapper.addMembershipToXml(MembershipMapper.java:124)
at com.atlassian.crowd.migration.MembershipMapper.exportXml(MembershipMapper.java:87)
at com.atlassian.crowd.migration.XmlMigrator.exportXml(XmlMigrator.java:36)
If the stack trace for this null pointer exception references the addition of memberships to the XML like the one indicated above, follow the Solution from this article.
原因
This can occur if users or groups were deleted from the Crowd instance in the past but the membership entry did not get deleted from the database. In this case, a child_id or parent_id value in the CWD_MEMBERSHIP table is updated with a null.
ソリューション
Verify if there's a null value for either of these columns in the CWD_MEMBERSHIP table:
select * from CWD_MEMBERSHIP where child_id = null OR parent_id = null;
If results are returned, delete the problematic entry:
Before proceeding, make sure that you have:
* Shutdown Crowd
* Have the most recent, full backup of your Crowd database
delete from CWD_MEMBERSHIP where child_id = null OR parent_id = null;
Startup Crowd and perform the XML backup again.