Data Pipeline export fails when issue has history of approvals and reporter no longer exists

XMLWordPrintable

    • 9.04
    • 2
    • Severity 3 - Minor
    • 12

      Issue Summary

      This is reproducible on Data Center: yes

      When attempting to run a Data Pipeline export, it consistently fails if there's an issue with any history of approvals and the Reporter of the issue is a user that no longer exists (not found on cwd_user but exists on app_user OR belongs to a deactivated User Directory).

      • The approvals is the out-of-the-box approvals, provided by JSM.
      • Users that don't exist in cwd_user will show an avatar with a "?" on it.

      Steps to Reproduce

      Create a JSM project.

      Create an issue that has approvals, like the basic Service Request with Approvals

      Add an approver and log in with that user to approve it.

      *Manually break the user you created the issue with (Reporter) by deleting the record from cwd_user.

      • This may cause other issues, but the goal is to have app_user entry with no associated cwd_user.
      • It's also possible to replicate by having a user from a deactivated User Directory as the reporter.

      Attempt a Data Pipeline export.

      It's also possible to replicate by having a user from a deactivated User Directory as the reporter.

      This is how the issue view would look like (you don't need to add approvers for the Data Pipeline failure to occur):

      Expected Results

      Data Pipeline runs successfully.

      Actual Results

      Export fails on the first occurrence of the problem.

      The below exception is thrown in the atlassian-jira.log file:

      2024-02-22 12:30:02,505-0300 data-pipeline-export-executor-0 ERROR anonymous     [c.a.b.i.core.service.DefaultDataExportOrchestrator] Failed writing entities to file - processId: 4
      java.lang.IllegalArgumentException: Failed on the extraction of entity with id: '10202' with: (through reference chain: com.atlassian.business.insights.jira.extract.serialize.IssueDocument["customFields"])
              at com.fasterxml.jackson.databind.ObjectMapper._convert(ObjectMapper.java:4544)
              at com.fasterxml.jackson.databind.ObjectMapper.convertValue(ObjectMapper.java:4485)
              at com.atlassian.business.insights.jira.extract.serialize.IssueSerializer.serialize(IssueSerializer.java:52)
              at com.atlassian.business.insights.jira.extract.serialize.IssueToLogRecordConverter.convert(IssueToLogRecordConverter.java:21)
              at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
              at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
              at java.base/java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1632)
              at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:278)
              at java.base/java.util.Spliterators$IteratorSpliterator.tryAdvance(Spliterators.java:1812)
              at java.base/java.util.stream.Streams$ConcatSpliterator.tryAdvance(Streams.java:720)
              at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:127)
              at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:502)
              at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:488)
              at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
              at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
              at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
              at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
              at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
              at one.util.streamex.AbstractStreamEx.forEach(AbstractStreamEx.java:360)
              at com.atlassian.business.insights.core.service.DefaultDataExportOrchestrator.lambda$null$5(DefaultDataExportOrchestrator.java:176)
              at com.atlassian.business.insights.jira.spi.JiraRequestContext.runInCustomContext(JiraRequestContext.java:40)
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.base/java.lang.reflect.Method.invoke(Method.java:566)
              at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
              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:186)
              at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:137)
              at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
              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:186)
              at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
              at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:137)
              at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
              at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:241)
              at com.sun.proxy.$Proxy1235.runInCustomContext(Unknown Source)
              at com.atlassian.business.insights.core.service.DefaultDataExportOrchestrator.lambda$runFullExport$6(DefaultDataExportOrchestrator.java:146)
              at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
              at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
              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:834)
      Caused by: com.fasterxml.jackson.databind.JsonMappingException: Failed on the extraction of entity with id: '10202' with: (through reference chain: com.atlassian.business.insights.jira.extract.serialize.IssueDocument["customFields"])
              at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:402)
              at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:361)
              at com.fasterxml.jackson.databind.ser.std.StdSerializer.wrapAndThrow(StdSerializer.java:323)
              at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:780)
              at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178)
              at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:318)
              at com.fasterxml.jackson.databind.ObjectMapper._convert(ObjectMapper.java:4522)
              ... 47 more
      Caused by: com.atlassian.business.insights.api.exceptions.DataExtractionException: Failed on the extraction of entity with id: '10202' with:
              at com.atlassian.business.insights.jira.extract.serialize.IssueOptionalWrapper.getExtractedCustomFields(IssueOptionalWrapper.java:105)
              at com.atlassian.business.insights.jira.extract.serialize.IssueDocument.getCustomFields(IssueDocument.java:98)
              at jdk.internal.reflect.GeneratedMethodAccessor599.invoke(Unknown Source)
              at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.base/java.lang.reflect.Method.invoke(Method.java:566)
              at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:772)
              ... 51 more
      Caused by: java.lang.NullPointerException: User should not be null
              at java.base/java.util.Objects.requireNonNull(Objects.java:246)
              at com.atlassian.servicedesk.plugins.approvals.internal.approval.ApprovalServiceOldImpl.getApprovers(ApprovalServiceOldImpl.java:115)
              at com.atlassian.servicedesk.plugins.approvals.internal.approval.ApprovalServiceImpl.getApprovers(ApprovalServiceImpl.java:46)
              at com.atlassian.business.insights.jira.extract.customfields.jsm.ApprovalsFieldExtractor.lambda$extract$0(ApprovalsFieldExtractor.java:68)
              at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
              at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
              at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
              at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
              at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
              at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
              at com.atlassian.business.insights.jira.extract.customfields.jsm.ApprovalsFieldExtractor.extract(ApprovalsFieldExtractor.java:70)
              at com.atlassian.business.insights.jira.extract.customfields.api.CustomFieldExtractor.extractAndRecord(CustomFieldExtractor.java:32)
              at com.atlassian.business.insights.jira.extract.customfields.api.FeatureFlaggedCustomFieldExtractor.extractAndRecord(FeatureFlaggedCustomFieldExtractor.java:31)
              at com.atlassian.business.insights.jira.extract.serialize.IssueOptionalWrapper.lambda$getExtractedCustomFields$0(IssueOptionalWrapper.java:100)
              at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
              at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
              at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
              at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
              at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
              at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
              at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
              at com.atlassian.business.insights.jira.extract.serialize.IssueOptionalWrapper.getExtractedCustomFields(IssueOptionalWrapper.java:103)
              ... 57 more 

      On the Data Pipeline page you can click "view details" for the failed export to see the following:

        "errors": [
          {
            "key": "unexpected.exception",
            "message": "Failed on the extraction of entity with id: '10202' with: (through reference chain: com.atlassian.business.insights.jira.extract.serialize.IssueDocument[\"customFields\"])"
          } 

      Workaround

      You may edit the issue and remove the Reporter or change it to a valid user. This will allow the Data Pipeline to proceed.

        1. image-2024-02-22-13-01-15-034.png
          3 kB
          Filipi Lima
        2. image-2024-02-27-13-16-10-664.png
          37 kB
          Filipi Lima

            Assignee:
            Unassigned
            Reporter:
            Filipi Lima
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: