java.lang.NullPointerException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • h3. Summary When attempting to upgrade to JIRA Service Desk 3.2.1, the exception as below is experienced. This is caused by entries in the {{nodeassociation}} table in JIRA referencing project Id's that do not exist. {noformat} java.lang.NullPointerException at java.util.Comparator.lambda$comparing$77a9974f$1(Comparator.java:469) at java.util.TimSort.countRunAndMakeAscending(TimSort.java:355) at java.util.TimSort.sort(TimSort.java:234) at java.util.Arrays.sort(Arrays.java:1512) at java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:348) at java.util.stream.Sink$ChainedReference.end(Sink.java:258) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) at com.atlassian.jira.scheme.AbstractSchemeManager.getProjects(AbstractSchemeManager.java:481) ... 3 filtered at java.lang.reflect.Method.invoke(Method.java:497) at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26) at com.sun.proxy.$Proxy551.getProjects(Unknown Source) ... 3 filtered at java.lang.reflect.Method.invoke(Method.java:497) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56) at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133) at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70) at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133) at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) at com.sun.proxy.$Proxy3179.getProjects(Unknown Source) at com.atlassian.servicedesk.bootstrap.upgrade.tasks.SyncUpgradeTaskMigrateAgentPermission.isPermissionSchemeUsedByServiceDeskProject(SyncUpgradeTaskMigrateAgentPermission.java:182) at com.atlassian.servicedesk.bootstrap.upgrade.tasks.SyncUpgradeTaskMigrateAgentPermission.getPermissionSchemesUsedByServiceDesk(SyncUpgradeTaskMigrateAgentPermission.java:173) at com.atlassian.servicedesk.bootstrap.upgrade.tasks.SyncUpgradeTaskMigrateAgentPermission.performUpgradeAgentPermission(SyncUpgradeTaskMigrateAgentPermission.java:128) at com.atlassian.servicedesk.bootstrap.upgrade.tasks.SyncUpgradeTaskMigrateAgentPermission.doUpgrade(SyncUpgradeTaskMigrateAgentPermission.java:86) at com.atlassian.servicedesk.bootstrap.upgrade.SyncUpgradeTaskServiceImpl.runTask(SyncUpgradeTaskServiceImpl.java:71) at com.atlassian.servicedesk.bootstrap.upgrade.SyncUpgradeTaskServiceImpl.runAll(SyncUpgradeTaskServiceImpl.java:48) at com.atlassian.servicedesk.bootstrap.lifecycle.PluginLifeCycle.runSyncUpgradeTasks(PluginLifeCycle.java:319) at com.atlassian.servicedesk.bootstrap.lifecycle.PluginLifeCycle.checkAndRunUpgrades(PluginLifeCycle.java:272) at com.atlassian.servicedesk.bootstrap.lifecycle.PluginLifeCycle.runPluginStartupSideEffectsImpl(PluginLifeCycle.java:183) at com.atlassian.servicedesk.bootstrap.lifecycle.LifecycleLock.writeImpl(LifecycleLock.java:97) at com.atlassian.servicedesk.bootstrap.lifecycle.LifecycleLock.runOnStartup(LifecycleLock.java:75) at com.atlassian.servicedesk.bootstrap.lifecycle.PluginLifeCycle.onPluginStarted(PluginLifeCycle.java:126) at com.atlassian.servicedesk.bootstrap.lifecycle.Launcher.onStartCompleted(Launcher.java:75) at com.atlassian.servicedesk.bootstrap.lifecycle.Launcher.access$000(Launcher.java:23) at com.atlassian.servicedesk.bootstrap.lifecycle.Launcher$1$1.run(Launcher.java:42) at com.atlassian.pocketknife.api.util.runners.SealedRunner.checkSeals(SealedRunner.java:111) at com.atlassian.pocketknife.api.util.runners.SealedRunner.breakSeal(SealedRunner.java:68) at com.atlassian.servicedesk.bootstrap.lifecycle.Launcher.onStart(Launcher.java:68) at com.atlassian.sal.core.lifecycle.DefaultLifecycleManager$4.consume(DefaultLifecycleManager.java:277) at com.atlassian.sal.core.lifecycle.DefaultLifecycleManager$4.consume(DefaultLifecycleManager.java:274) at com.atlassian.sal.core.lifecycle.DefaultLifecycleManager.notifyLifecyleAware(DefaultLifecycleManager.java:303) at com.atlassian.sal.core.lifecycle.DefaultLifecycleManager.notifyOnStartIfStartedAndEnabled(DefaultLifecycleManager.java:273) at com.atlassian.sal.core.lifecycle.DefaultLifecycleManager.access$300(DefaultLifecycleManager.java:49) at com.atlassian.sal.core.lifecycle.DefaultLifecycleManager$3.evaluate(DefaultLifecycleManager.java:235) at com.atlassian.sal.core.lifecycle.DefaultLifecycleManager$3.evaluate(DefaultLifecycleManager.java:232) at com.atlassian.sal.core.lifecycle.DefaultLifecycleManager.notifyLifecycleAwares(DefaultLifecycleManager.java:258) at com.atlassian.sal.core.lifecycle.DefaultLifecycleManager.notifyStartableLifecycleAwares(DefaultLifecycleManager.java:231) at com.atlassian.sal.core.lifecycle.DefaultLifecycleManager.startIfApplicationSetup(DefaultLifecycleManager.java:219) at com.atlassian.sal.core.lifecycle.DefaultLifecycleManager.start(DefaultLifecycleManager.java:210) at com.atlassian.sal.jira.lifecycle.JiraLifecycleManager.onJiraStart(JiraLifecycleManager.java:64) ... 3 filtered at java.lang.reflect.Method.invoke(Method.java:497) at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:36) at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$1$1.run(AsynchronousAbleEventDispatcher.java:48) at com.google.common.util.concurrent.MoreExecutors$DirectExecutorService.execute(MoreExecutors.java:299) at com.atlassian.event.internal.AsynchronousAbleEventDispatcher.dispatch(AsynchronousAbleEventDispatcher.java:107) at com.atlassian.event.internal.EventPublisherImpl.invokeListeners(EventPublisherImpl.java:160) at com.atlassian.event.internal.EventPublisherImpl.publish(EventPublisherImpl.java:79) at com.atlassian.plugin.event.impl.DefaultPluginEventManager.broadcast(DefaultPluginEventManager.java:73) at com.atlassian.jira.upgrade.PluginUpgradeLauncher.start(PluginUpgradeLauncher.java:30) at com.atlassian.jira.startup.ActiveServicesLauncher.start(ActiveServicesLauncher.java:51) at com.atlassian.jira.startup.DefaultJiraLauncher.lambda$postTenantArrived$4(DefaultJiraLauncher.java:178) at com.atlassian.jira.startup.DefaultInstantUpgradeManager$StartupTask.run(DefaultInstantUpgradeManager.java:139) at com.atlassian.jira.startup.DefaultInstantUpgradeManager.runTask(DefaultInstantUpgradeManager.java:55) at com.atlassian.jira.startup.DefaultInstantUpgradeManager.doNowOrWhenInstanceBecomesActive(DefaultInstantUpgradeManager.java:42) at com.atlassian.jira.startup.DefaultJiraLauncher.postTenantArrived(DefaultJiraLauncher.java:171) at com.atlassian.jira.startup.DefaultJiraLauncher.lambda$postDBActivated$3(DefaultJiraLauncher.java:159) at com.atlassian.jira.tenancy.DefaultTenantManager.doNowOrWhenTenantArrives(DefaultTenantManager.java:55) at com.atlassian.jira.startup.DefaultJiraLauncher.postDBActivated(DefaultJiraLauncher.java:156) at com.atlassian.jira.startup.DefaultJiraLauncher.lambda$postDbLaunch$2(DefaultJiraLauncher.java:145) at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrEnqueue(DatabaseConfigurationManagerImpl.java:298) at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrWhenDatabaseActivated(DatabaseConfigurationManagerImpl.java:194) at com.atlassian.jira.startup.DefaultJiraLauncher.postDbLaunch(DefaultJiraLauncher.java:135) at com.atlassian.jira.startup.DefaultJiraLauncher.lambda$start$0(DefaultJiraLauncher.java:101) at com.atlassian.jira.util.devspeed.JiraDevSpeedTimer.run(JiraDevSpeedTimer.java:31) at com.atlassian.jira.startup.DefaultJiraLauncher.start(DefaultJiraLauncher.java:99) at com.atlassian.jira.startup.LauncherContextListener.initSlowStuff(LauncherContextListener.java:149) at java.lang.Thread.run(Thread.java:745) {noformat} h3. Environment An instance that is being upgraded to JIRA Service Desk 7.2.1 (Service Desk 3.2.1). h3. Steps to Reproduce Using an XML backup that contains unexpected data in the nodeassoication table. h3. Expected Results The Upgrade Task should be able to avoid this situation. h3. Actual Results The upgrade fails and the JIRA Service Desk instance upgrade is blocked. h3. Notes It is recommended that you work with [Atlassian Support|https://support.atlassian.com/] to determine the best path forward with this solution at this stage. To workaround this issue, attempt to detect the entries causing this issue. {code} SELECT n.* FROM nodeassociation n WHERE n.sink_node_entity = 'PermissionScheme' AND source_node_id NOT IN ( SELECT id FROM project ); {code} If this is the case, test removing these entries from an XML Backup (these entries will look like: {{<NodeAssocation sourceNodeId=...}}) and restore this data to the instance.
    via by Matt Jones [Atlassian],
  • NPE in HivePageSink
    via GitHub by electrum
    ,
    • java.lang.NullPointerException at java.util.Comparator.lambda$comparing$77a9974f$1(Comparator.java:469) at java.util.TimSort.countRunAndMakeAscending(TimSort.java:355) at java.util.TimSort.sort(TimSort.java:234) at java.util.Arrays.sort(Arrays.java:1512) at java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:348) at java.util.stream.Sink$ChainedReference.end(Sink.java:258) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) at com.atlassian.jira.scheme.AbstractSchemeManager.getProjects(AbstractSchemeManager.java:481)

    Users with the same issue

    Unknown visitor
    Unknown visitor1 times, last one,
    tvrmsmithtvrmsmith
    1 times, last one,
    serious2monkeysserious2monkeys
    21 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    aidoanaidoan
    6 times, last one,