Uploaded image for project: 'Jira Software Data Center'
  1. Jira Software Data Center
  2. JSWSERVER-8703

Attempting to Index with JIRA Agile(GreenHopper) enabled throws a UndeclaredThrowableException or a NullPointerException

XMLWordPrintable

      Summary

      Attempting to index JIRA throws an exception when JIRA Agile (GreenHopper) is enabled.

      Steps to Reproduce

      1. Restore a "broken" data-set using the database backup (as XML restore fixes this).
      2. Index JIRA.

      Expected Results

      It completes without error.

      Actual Results

      The index fails with the below exception:

      java.util.concurrent.ExecutionException: java.lang.reflect.UndeclaredThrowableException
      Task completed in 12 seconds with unexpected error.
      Started Today 2:32 PM.
      Finished Today 2:32 PM.
      java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.reflect.UndeclaredThrowableException
      	at com.atlassian.jira.index.FutureResult.await(FutureResult.java:35)
      	at com.atlassian.jira.index.CompositeResultBuilder$CompositeResult.await(CompositeResultBuilder.java:82)
      	at com.atlassian.jira.issue.index.DefaultIndexManager.doIndexIssuesInBatchMode(DefaultIndexManager.java:855)
      	at com.atlassian.jira.issue.index.DefaultIndexManager.doStopTheWorldReindex(DefaultIndexManager.java:825)
      	at com.atlassian.jira.issue.index.DefaultIndexManager.reIndexAll(DefaultIndexManager.java:335)
      	at com.atlassian.jira.issue.index.DefaultIndexManager.reIndexAll(DefaultIndexManager.java:301)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at com.atlassian.util.profiling.object.ObjectProfiler.profiledInvoke(ObjectProfiler.java:81)
      	at com.atlassian.jira.config.component.SwitchingInvocationHandler.invoke(SwitchingInvocationHandler.java:28)
      	at $Proxy157.reIndexAll(Unknown Source)
      	at com.atlassian.jira.util.index.CompositeIndexLifecycleManager.reIndexAll(CompositeIndexLifecycleManager.java:54)
      	at com.atlassian.jira.web.action.admin.index.ReIndexAsyncIndexerCommand.doReindex(ReIndexAsyncIndexerCommand.java:28)
      	at com.atlassian.jira.web.action.admin.index.AbstractAsyncIndexerCommand.call(AbstractAsyncIndexerCommand.java:54)
      	at com.atlassian.jira.web.action.admin.index.ReIndexAsyncIndexerCommand.call(ReIndexAsyncIndexerCommand.java:16)
      	at com.atlassian.jira.web.action.admin.index.AbstractAsyncIndexerCommand.call(AbstractAsyncIndexerCommand.java:23)
      	at com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:366)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      	at com.atlassian.multitenant.impl.DefaultMultiTenantManager.runForTenant(DefaultMultiTenantManager.java:61)
      	at com.atlassian.multitenant.juc.MultiTenantExecutors$WrappedRunnable.run(MultiTenantExecutors.java:160)
      	at com.atlassian.jira.task.ForkedThreadExecutor$ForkedRunnableDecorator.run(ForkedThreadExecutor.java:249)
      	at java.lang.Thread.run(Thread.java:662)
      Caused by: java.util.concurrent.ExecutionException: java.lang.reflect.UndeclaredThrowableException
      	at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
      	at java.util.concurrent.FutureTask.get(FutureTask.java:83)
      	at com.atlassian.jira.index.FutureResult.await(FutureResult.java:31)
      	... 27 more
      Caused by: java.lang.reflect.UndeclaredThrowableException
      	at $Proxy1775.getSprint(Unknown Source)
      	at com.atlassian.greenhopper.customfield.sprint.SprintCFType.convertDbValueToType(SprintCFType.java:271)
      	at com.atlassian.greenhopper.customfield.sprint.SprintCFType.convertDbValueToType(SprintCFType.java:42)
      	at com.atlassian.jira.issue.customfields.impl.AbstractMultiCFType.convertDbObjectToTypes(AbstractMultiCFType.java:232)
      	at com.atlassian.jira.issue.customfields.impl.AbstractMultiCFType.getValueFromIssue(AbstractMultiCFType.java:160)
      	at com.atlassian.greenhopper.customfield.sprint.SprintCFType.getValueFromIssue(SprintCFType.java:231)
      	at com.atlassian.greenhopper.customfield.sprint.SprintCFType.getValueFromIssue(SprintCFType.java:42)
      	at com.atlassian.jira.issue.fields.CustomFieldImpl.getValue(CustomFieldImpl.java:384)
      	at com.atlassian.greenhopper.customfield.sprint.SprintHistoryEntryFactory.getSprintChangeHistoryForIssue(SprintHistoryEntryFactory.java:133)
      	at com.atlassian.greenhopper.customfield.sprint.SprintHistoryEntryFactory.getSprintChangeHistory(SprintHistoryEntryFactory.java:42)
      	at com.atlassian.greenhopper.customfield.sprint.SprintCustomFieldIndexer.addDocumentFields(SprintCustomFieldIndexer.java:45)
      	at com.atlassian.greenhopper.customfield.sprint.SprintCustomFieldIndexer.addDocumentFieldsSearchable(SprintCustomFieldIndexer.java:30)
      	at com.atlassian.jira.issue.index.indexers.impl.AbstractCustomFieldIndexer.addIndex(AbstractCustomFieldIndexer.java:46)
      	at com.atlassian.jira.issue.index.IssueDocument.getDocument(IssueDocument.java:40)
      	at com.atlassian.jira.issue.index.DefaultIssueDocumentFactory.get(DefaultIssueDocumentFactory.java:15)
      	at com.atlassian.jira.issue.index.DefaultIssueDocumentFactory.get(DefaultIssueDocumentFactory.java:11)
      	at com.atlassian.jira.issue.index.DefaultIssueIndexer$IssueLockDocumentCreationStrategy$2.get(DefaultIssueIndexer.java:598)
      	at com.atlassian.jira.issue.index.DefaultIssueIndexer$IssueLockDocumentCreationStrategy$2.get(DefaultIssueIndexer.java:593)
      	at com.atlassian.util.concurrent.ManagedLocks$ManagedLockImpl.withLock(ManagedLocks.java:315)
      	at com.atlassian.jira.issue.index.DefaultIssueIndexer$IssueLockDocumentCreationStrategy.get(DefaultIssueIndexer.java:592)
      	at com.atlassian.jira.issue.index.DefaultIssueIndexer$IndexIssuesOperation.perform(DefaultIssueIndexer.java:446)
      	at com.atlassian.jira.issue.index.DefaultIssueIndexer$4$1.get(DefaultIssueIndexer.java:284)
      	at com.atlassian.jira.issue.index.DefaultIssueIndexer$4$1.get(DefaultIssueIndexer.java:280)
      	at com.atlassian.jira.index.SimpleIndexingStrategy.get(SimpleIndexingStrategy.java:9)
      	at com.atlassian.jira.index.SimpleIndexingStrategy.get(SimpleIndexingStrategy.java:5)
      	at com.atlassian.jira.index.MultiThreadedIndexingStrategy$1.call(MultiThreadedIndexingStrategy.java:38)
      	at com.atlassian.jira.index.MultiThreadedIndexingStrategy$1.call(MultiThreadedIndexingStrategy.java:35)
      	at com.atlassian.jira.util.concurrent.BoundedExecutor$2.call(BoundedExecutor.java:70)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      	at com.atlassian.multitenant.impl.DefaultMultiTenantManager.runForTenant(DefaultMultiTenantManager.java:61)
      	at com.atlassian.multitenant.juc.MultiTenantExecutors$WrappedRunnable.run(MultiTenantExecutors.java:160)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      	... 1 more
      Caused by: java.lang.reflect.InvocationTargetException
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at com.atlassian.activeobjects.tx.TransactionalProxy.invoke(TransactionalProxy.java:79)
      	at com.atlassian.activeobjects.tx.TransactionalProxy.invoke(TransactionalProxy.java:39)
      	... 35 more
      Caused by: com.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.NullPointerException
      	at com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:152)
      	at com.atlassian.util.concurrent.LazyReference.get(LazyReference.java:115)
      	at com.atlassian.util.concurrent.ResettableLazyReference.get(ResettableLazyReference.java:89)
      	at com.atlassian.greenhopper.service.sprint.SprintManagerImpl.getSprint(SprintManagerImpl.java:68)
      	... 41 more
      Caused by: java.lang.NullPointerException
      	at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:187)
      	at com.google.common.collect.SingletonImmutableList.<init>(SingletonImmutableList.java:41)
      	at com.google.common.collect.ImmutableList.of(ImmutableList.java:80)
      	at net.java.ao.DatabaseProvider.renderAction(DatabaseProvider.java:244)
      	at net.java.ao.schema.SchemaGenerator$1.apply(SchemaGenerator.java:117)
      	at net.java.ao.schema.SchemaGenerator$1.apply(SchemaGenerator.java:114)
      	at com.google.common.collect.Iterators$8.next(Iterators.java:782)
      	at net.java.ao.schema.SchemaGenerator.migrate(SchemaGenerator.java:92)
      	at net.java.ao.EntityManager.migrate(EntityManager.java:133)
      	at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.migrate(EntityManagedActiveObjects.java:43)
      	at com.atlassian.activeobjects.internal.AbstractActiveObjectsFactory.create(AbstractActiveObjectsFactory.java:52)
      	at com.atlassian.activeobjects.internal.DelegatingActiveObjectsFactory.create(DelegatingActiveObjectsFactory.java:39)
      	at com.atlassian.activeobjects.osgi.ActiveObjectsServiceFactory.createActiveObjects(ActiveObjectsServiceFactory.java:136)
      	at com.atlassian.activeobjects.osgi.ActiveObjectsServiceFactory.access$000(ActiveObjectsServiceFactory.java:51)
      	at com.atlassian.activeobjects.osgi.ActiveObjectsServiceFactory$1$1.get(ActiveObjectsServiceFactory.java:65)
      	at com.atlassian.activeobjects.osgi.ActiveObjectsServiceFactory$1$1.get(ActiveObjectsServiceFactory.java:61)
      	at com.atlassian.activeobjects.osgi.DelegatingActiveObjects$MemoizingSupplier.get(DelegatingActiveObjects.java:149)
      	at com.atlassian.activeobjects.osgi.DelegatingActiveObjects.find(DelegatingActiveObjects.java:76)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
      	at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:58)
      	at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      	at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:56)
      	at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:39)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      	at org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      	at $Proxy1764.find(Unknown Source)
      	at com.atlassian.greenhopper.service.sprint.SprintDao.loadAll(SprintDao.java:11)
      	at com.atlassian.greenhopper.service.sprint.SprintManagerImpl$1.create(SprintManagerImpl.java:52)
      	at com.atlassian.greenhopper.service.sprint.SprintManagerImpl$1.create(SprintManagerImpl.java:48)
      	at com.atlassian.util.concurrent.ResettableLazyReference$InternalReference.create(ResettableLazyReference.java:143)
      	at com.atlassian.util.concurrent.LazyReference$Sync.run(LazyReference.java:326)
      	at com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:146)
      	... 44 more
      

      OR

      java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.NullPointerException
      	at com.atlassian.jira.index.FutureResult.await(FutureResult.java:35)
      	at com.atlassian.jira.index.CompositeResultBuilder$CompositeResult.await(CompositeResultBuilder.java:82)
      	at com.atlassian.jira.issue.index.DefaultIndexManager.doIndexIssuesInBatchMode(DefaultIndexManager.java:857)
      	at com.atlassian.jira.issue.index.DefaultIndexManager.doStopTheWorldReindex(DefaultIndexManager.java:827)
      	at com.atlassian.jira.issue.index.DefaultIndexManager.reIndexAll(DefaultIndexManager.java:337)
      	at com.atlassian.jira.issue.index.DefaultIndexManager.reIndexAll(DefaultIndexManager.java:303)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      	at java.lang.reflect.Method.invoke(Unknown Source)
      	at com.atlassian.util.profiling.object.ObjectProfiler.profiledInvoke(ObjectProfiler.java:83)
      	at com.atlassian.jira.config.component.SwitchingInvocationHandler.invoke(SwitchingInvocationHandler.java:28)
      	at com.sun.proxy.$Proxy129.reIndexAll(Unknown Source)
      	at com.atlassian.jira.util.index.CompositeIndexLifecycleManager.reIndexAll(CompositeIndexLifecycleManager.java:56)
      	at com.atlassian.jira.web.action.admin.index.ReIndexAsyncIndexerCommand.doReindex(ReIndexAsyncIndexerCommand.java:28)
      	at com.atlassian.jira.web.action.admin.index.AbstractAsyncIndexerCommand.call(AbstractAsyncIndexerCommand.java:54)
      	at com.atlassian.jira.web.action.admin.index.ReIndexAsyncIndexerCommand.call(ReIndexAsyncIndexerCommand.java:16)
      	at com.atlassian.jira.web.action.admin.index.AbstractAsyncIndexerCommand.call(AbstractAsyncIndexerCommand.java:23)
      	at com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:365)
      	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
      	at java.util.concurrent.FutureTask.run(Unknown Source)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
      	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
      	at java.util.concurrent.FutureTask.run(Unknown Source)
      	at com.atlassian.jira.task.ForkedThreadExecutor$ForkedRunnableDecorator.run(ForkedThreadExecutor.java:249)
      	at java.lang.Thread.run(Unknown Source)
      Caused by: java.util.concurrent.ExecutionException: java.lang.NullPointerException
      	at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)
      	at java.util.concurrent.FutureTask.get(Unknown Source)
      	at com.atlassian.jira.index.FutureResult.await(FutureResult.java:31)
      	... 25 more
      Caused by: java.lang.NullPointerException
      	at com.atlassian.jira.issue.customfields.impl.AbstractMultiCFType.getValueFromIssue(AbstractMultiCFType.java:159)
      	at com.atlassian.greenhopper.customfield.sprint.SprintCFType.getValueFromIssue(SprintCFType.java:235)
      	at com.atlassian.greenhopper.customfield.sprint.SprintCFType.getValueFromIssue(SprintCFType.java:42)
      	at com.atlassian.jira.issue.fields.CustomFieldImpl.getValue(CustomFieldImpl.java:395)
      	at com.atlassian.greenhopper.customfield.sprint.SprintHistoryEntryFactory.getSprintChangeHistoryForIssue(SprintHistoryEntryFactory.java:134)
      	at com.atlassian.greenhopper.customfield.sprint.SprintHistoryEntryFactory.getSprintChangeHistory(SprintHistoryEntryFactory.java:54)
      	at com.atlassian.greenhopper.customfield.sprint.SprintCustomFieldIndexer.addDocumentFields(SprintCustomFieldIndexer.java:45)
      	at com.atlassian.greenhopper.customfield.sprint.SprintCustomFieldIndexer.addDocumentFieldsSearchable(SprintCustomFieldIndexer.java:30)
      	at com.atlassian.jira.issue.index.indexers.impl.AbstractCustomFieldIndexer.addIndex(AbstractCustomFieldIndexer.java:46)
      	at com.atlassian.jira.issue.index.IssueDocument.getDocument(IssueDocument.java:41)
      	at com.atlassian.jira.issue.index.DefaultIssueDocumentFactory.get(DefaultIssueDocumentFactory.java:15)
      	at com.atlassian.jira.issue.index.DefaultIssueDocumentFactory.get(DefaultIssueDocumentFactory.java:11)
      	at com.atlassian.jira.issue.index.DefaultIssueIndexer$IssueLockDocumentCreationStrategy$2.get(DefaultIssueIndexer.java:598)
      	at com.atlassian.jira.issue.index.DefaultIssueIndexer$IssueLockDocumentCreationStrategy$2.get(DefaultIssueIndexer.java:593)
      	at com.atlassian.util.concurrent.ManagedLocks$ManagedLockImpl.withLock(ManagedLocks.java:303)
      	at com.atlassian.jira.issue.index.DefaultIssueIndexer$IssueLockDocumentCreationStrategy.get(DefaultIssueIndexer.java:592)
      	at com.atlassian.jira.issue.index.DefaultIssueIndexer$IndexIssuesOperation.perform(DefaultIssueIndexer.java:446)
      	at com.atlassian.jira.issue.index.DefaultIssueIndexer$4$1.get(DefaultIssueIndexer.java:284)
      	at com.atlassian.jira.issue.index.DefaultIssueIndexer$4$1.get(DefaultIssueIndexer.java:280)
      	at com.atlassian.jira.index.SimpleIndexingStrategy.get(SimpleIndexingStrategy.java:9)
      	at com.atlassian.jira.index.SimpleIndexingStrategy.get(SimpleIndexingStrategy.java:5)
      	at com.atlassian.jira.index.MultiThreadedIndexingStrategy$1.call(MultiThreadedIndexingStrategy.java:38)
      	at com.atlassian.jira.index.MultiThreadedIndexingStrategy$1.call(MultiThreadedIndexingStrategy.java:35)
      	at com.atlassian.jira.util.concurrent.BoundedExecutor$2.call(BoundedExecutor.java:69)
      	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
      	at java.util.concurrent.FutureTask.run(Unknown Source)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      	... 1 more
      

      Workaround

      To workaround this:

      Step 1
      1. Disable JIRA Agile (GreenHopper) from 'Manage Add-ons'.
      2. Re-index data (this will succeed).
      3. Run the Database Integrity Checker and resolve all the errors shown.
      4. Re-enable JIRA Agile (GreenHopper).
      5. Re-index again (full re-index).
      Step 2 (if Step 1 does not resolve the issue)
      1. Create a new database and point JIRA to this db.
      2. Import a latest XML backup.

      Notes

      The second stack trace is caused by the issue being passed to getValueFromIssue in AbstractMultiCFType (in JIRA) being null. This is called from JIRA Agile's SprintCFType.getValueFromIssue method which checks for issue being a subtask first, so if the issue itself were null, it would have broken inside JIRA Agile code. It would appear that somehow sub-tasks are getting orphaned from their parent and this would cause these symptoms to occur.

              Unassigned Unassigned
              dcurrie@atlassian.com Dave C
              Votes:
              6 Vote for this issue
              Watchers:
              14 Start watching this issue

                Created:
                Updated:
                Resolved: