XML Backup of Crowd database fails with NullPointerException

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

Performing an XML backup of the Crowd instance can fail with a java.lang.NullPointerException error.

Environment

Crowd Server and Data Center

Diagnosis

Within the application log, check for the following NPE exception:

1 2 3 4 5 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.

Cause

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.

Solution

Verify if there's a null value for either of these columns in the CWD_MEMBERSHIP table:

1 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

1 delete from CWD_MEMBERSHIP where child_id = null OR parent_id = null;

Startup Crowd and perform the XML backup again.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.