"notificationSchemeManager.defaultSchemeObject must not be null" error when running a migration plan in JCMA

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server 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

Problem summary

When running a migration plan with JCMA, it may fail with the error below:

2022-05-18 18:29:56,740-0700 pool-33-thread-2 ERROR <user name> 1086x891x1 gyj156 111.111.111.111 /rest/migration/latest/check/xxo4hfu5h6jdjsg5itlgt59072ba66989e [c.a.j.m.export.framework.DefaultExportFailureHandler] xxo4hfu5h6jdjsg5itlgt59072ba66989e: Exporting entity Project <PROJECT KEY> failed
java.lang.NullPointerException: notificationSchemeManager.defaultSchemeObject must not be null
	at com.atlassian.jira.migration.export.core.project.ProjectExporter.mapNotificationSchemeOrDefault(ProjectExporter.kt:346)
	at com.atlassian.jira.migration.export.core.project.ProjectExporter.exportData(ProjectExporter.kt:143)
	at com.atlassian.jira.migration.export.core.project.ProjectExporter.exportData(ProjectExporter.kt:72)
	at com.atlassian.jira.migration.export.framework.ExportService$exportJiraEntity$1$1.invoke(ExportService.kt:291)
	at com.atlassian.jira.migration.export.framework.ExportService$exportJiraEntity$1$1.invoke(ExportService.kt:290)
	at com.atlassian.jira.migration.metrics.TimingMetrics.time(TimingMetrics.kt:22)
	at com.atlassian.jira.migration.export.framework.ExportService.exportJiraEntity-0E7RQCE(ExportService.kt:290)
	at com.atlassian.jira.migration.export.framework.ExportService.exportByEntityImpl(ExportService.kt:234)
	at com.atlassian.jira.migration.export.framework.ExportService.exportByEntityImpl$default(ExportService.kt:213)
	at com.atlassian.jira.migration.export.framework.ExportService.exportOrThrow(ExportService.kt:114)
	at com.atlassian.jira.migration.export.framework.ExportService.exportOrThrow$default(ExportService.kt:108)
	at com.atlassian.jira.migration.export.ExportFacade.exportProjectReportData(ExportFacade.kt:217)
	at com.atlassian.jira.migration.preflight.reports.PreMigrationReportsService$gatherReportsDataFromProject$1$1.invoke(PreMigrationReportsService.kt:142)
	at com.atlassian.jira.migration.preflight.reports.PreMigrationReportsService$gatherReportsDataFromProject$1$1.invoke(PreMigrationReportsService.kt:141)
	at com.atlassian.jira.migration.jiraservice.JiraExtensionsKt.wrap(JiraExtensions.kt:17)
	at com.atlassian.jira.migration.preflight.reports.PreMigrationReportsService.gatherReportsDataFromProject(PreMigrationReportsService.kt:141)
	at com.atlassian.jira.migration.preflight.reports.PreMigrationReportsService.generateReportData(PreMigrationReportsService.kt:97)
	at com.atlassian.jira.migration.preflight.reports.PreMigrationReportsService.generateReportDataAsync$lambda-0(PreMigrationReportsService.kt:59)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1736)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)

Affected products

  • Jira Server/DC (any version compatible with JCMA → 7.6.0 and higher)
  • JCMA 1.6.9 (Notification Schemes migration is supported by JCMA as of this version)

Why?

Jira applications are pre-packaged with a notification scheme called Default Notification Scheme:

  • This Scheme is associated with all new projects by default. This means that if you have an outgoing (SMTP) mail server set up, email notifications will be sent as soon as there is any activity (e.g. issues created) in the new project.
  • You can disassociate this Notification Scheme from the project via the Project Summary page, as described here.
  • You can modify this scheme, or create other Notification Schemes for particular projects.

Solution

Keep in mind that the projects will need to have a Notification Scheme associated with them in order to be migrated by JCMA.

Otherwise, it may fail with the error above.

SQL check

You can also confirm which projects do not have a Notification Scheme associated with them via a database SELECT query.

Compatible with PostgreSQL, Oracle, MySQL, MSSQL Server
SELECT DISTINCT p.id       AS "Project ID"
     , p.pkey              AS "Project Key"
     , ns.id               AS "Notification Scheme ID"
     , COALESCE(ns.name, 'Notification Scheme NOT found') AS "Notification Scheme Name"
  FROM project p
  LEFT JOIN nodeassociation na ON (p.id = na.source_node_id AND na.source_node_entity = 'Project' AND na.sink_node_entity = 'NotificationScheme')
  LEFT JOIN notification n ON (n.id = na.sink_node_id)
  LEFT JOIN notificationscheme ns ON (ns.id = n.scheme);

If you're affected by that error, make sure to check if the project has a Notification Scheme associated with it.

If not, associate a Notification Scheme with the project and try a new migration plan.

Reference links


Last modified on Jul 26, 2022

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.