JCMA Project Migration: Handling NullPointerException

Platform Notice: Cloud and Data Center - This article applies equally to both cloud and data center platforms.

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

The following article assists in identifying the NullPointerException error during project migration and provides guidance for resolving the issue.

Solution

Overview

When the project is migrated from the server to the cloud using JCMA, it encounters an error NullPointerException: No message. The following error is logged in the migration error logs:

1 ERROR <project_key> project-import We couldn't import Permission Scheme '<Permission_Scheme_name>'. Reason: NullPointerException: No message.

And, below error is logged in the cloud logs:

1 2 3 4 5 6 7 8 9 10 11 12 13 stack: java.lang.NullPointerException at com.atlassian.jira.notification.type.ProjectRoleSecurityAndNotificationType.getArgumentDisplay(ProjectRoleSecurityAndNotificationType.java:181) at com.atlassian.jira.permission.management.ManagedPermissionSchemeHelperImpl.getParameterDisplayValue(ManagedPermissionSchemeHelperImpl.java:394) at com.atlassian.jira.permission.management.ManagedPermissionSchemeHelperImpl.buildGrants(ManagedPermissionSchemeHelperImpl.java:365) at com.atlassian.jira.permission.management.ManagedPermissionSchemeHelperImpl.lambda$generatePermissionSchemeBean$3(ManagedPermissionSchemeHelperImpl.java:263) at com.google.common.collect.Iterators$6.transform(Iterators.java:829) at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:52) at com.google.common.collect.Iterators.addAll(Iterators.java:367) at com.google.common.collect.Lists.newArrayList(Lists.java:146) at com.google.common.collect.Lists.newArrayList(Lists.java:132) at com.atlassian.jira.permission.management.ManagedPermissionSchemeHelperImpl.generatePermissionSchemeBean(ManagedPermissionSchemeHelperImpl.java:278) at com.atlassian.jira.permission.management.ManagedPermissionSchemeHelperImpl.getManagedPermissionScheme(ManagedPermissionSchemeHelperImpl.java:122) at com.atlassian.jira.permission.management.ManagedPermissionSchemeHelperImpl.addManagedPermissionSchemeGrants(ManagedPermissionSchemeHelperImpl.java:205)

The error indicates that the permission builder is failing due to an invalid argument. This situation can occur when the permission scheme refers to a stale project role, which could mean a configuration without an ID or a role with an ID but no corresponding display name.

Fix NullPointerException error

  1. Run the following query to verify if the configuration without an ID or name is linked in the permission scheme. If the query yields empty IDs, proceed to step 3. Otherwise, proceed with step 2.

    1 2 3 4 5 6 select distinct perm_parameter , perm_type from schemepermissions where scheme = (select id from permissionscheme where name = 'replace_permission_scheme name');
  2. Once the IDs have been obtained, execute the following SQL queries to ensure that the roles utilized in permission schemes possess valid names.

    1 2 3 select * from projectrole where id in (<IDs>) --replace the IDs obtained from above sql query
  3. Alternatively, execute the following SQL query to identify all roles associated with the permission scheme, and then locate the role without an ID.

    1 2 3 4 5 6 7 8 9 10 11 select project.id , project.pkey , ps.name , sp.* from project join nodeassociation na on na.source_node_id = project.id join permissionscheme ps on na.sink_node_id = ps.id join schemepermissions sp on sp.scheme = ps.id where association_type = 'ProjectScheme' and sink_node_entity = 'PermissionScheme' and project.pkey = '<pkey>'; --replace the project key obtained from above sql query
  4. Once the configuration has been located, proceed to the permission scheme in the UI and remove the roles identified during the above process.

Updated on April 17, 2025

Still need help?

The Atlassian Community is here for you.