Uploaded image for project: 'XNAT'
  1. XNAT
  2. XNAT-6799

(Auto)archiving two sessions under the same non-existent subject at the same time errors out one session

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Blocker
    • 1.8.3
    • 1.8.2
    • DICOM, Importer
    • None

    Description

      This is either similar or a duplicate of XNAT-5024. I don't know if the issue has come back, or if it was never quite fixed (since it's an intermittent race condition). I imported 16 sessions in one bulk operation with DQR. Two of the sessions had the same patient name, so they would get routed to the same subject. However, since XNAT had to create the subject object, it failed for one of the sessions and it ended up in "Error" state in the prearchive. This is probably going to be a big pain for people trying to use the DQR plugin. Here's some interesting things that get logged:

      2021-05-07 22:07:13,109 [DefaultMessageListenerContainer-13] ERROR org.nrg.xnat.helpers.merge.MergeSessionsA - An error occurred updating existing metadata for session XNAT_E00415: 2350832035 in project concurrentatt
      java.lang.Exception: Unable to identify subject for:XNAT_S00378
              at org.nrg.xdat.om.base.BaseXnatSubjectassessordata.preSave(BaseXnatSubjectassessordata.java:113)
              at org.nrg.xdat.om.base.BaseXnatImagesessiondata.preSave(BaseXnatImagesessiondata.java:3210)
              at org.nrg.xft.utils.SaveItemHelper.save(SaveItemHelper.java:82)
              at org.nrg.xft.utils.SaveItemHelper$$FastClassBySpringCGLIB$$64be15d8.invoke(<generated>)
              at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
              at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:737)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
              at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:84)
              at org.nrg.xnat.eventservice.aspects.EventServiceItemSaveAspect.processItemSaveTrigger(EventServiceItemSaveAspect.java:76)
              at sun.reflect.GeneratedMethodAccessor427.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:627)
              at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:616)
              at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:168)
              at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
              at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:672)
              at org.nrg.xft.utils.SaveItemHelper$$EnhancerBySpringCGLIB$$6a572476.save(<generated>)
              at org.nrg.xft.utils.SaveItemHelper.authorizedSave(SaveItemHelper.java:477)
              at org.nrg.xnat.archive.PrearcSessionArchiver.lambda$call$0(PrearcSessionArchiver.java:565)
              at org.nrg.xnat.helpers.merge.MergeSessionsA.call(MergeSessionsA.java:164)
              at org.nrg.xnat.archive.PrearcSessionArchiver.call(PrearcSessionArchiver.java:618)
              at org.nrg.xnat.helpers.prearchive.PrearcDatabase$12.extSync(PrearcDatabase.java:964)
              at org.nrg.xnat.helpers.prearchive.PrearcDatabase$12.extSync(PrearcDatabase.java:961)
              at org.nrg.xnat.helpers.prearchive.PrearcDatabase$LockAndSync.run(PrearcDatabase.java:1615)
              at org.nrg.xnat.helpers.prearchive.PrearcDatabase._archive(PrearcDatabase.java:987)
              at org.nrg.xnat.helpers.prearchive.PrearcDatabase.archive(PrearcDatabase.java:934)
              at org.nrg.xnat.helpers.prearchive.handlers.PrearchiveArchiveHandler.commitSessionToArchive(PrearchiveArchiveHandler.java:60)
              at org.nrg.xnat.helpers.prearchive.handlers.PrearchiveArchiveHandler.execute(PrearchiveArchiveHandler.java:47)
              at org.nrg.xnat.services.messaging.prearchive.PrearchiveOperationRequestListener.onRequest(PrearchiveOperationRequestListener.java:38)
      

      and:

      2021-05-07 22:07:13,385 [DefaultMessageListenerContainer-13] ERROR org.nrg.xnat.helpers.prearchive.PrearcDatabase -
      org.nrg.xnat.helpers.prearchive.PrearcDatabase$SyncFailedException: java.lang.Exception: Unable to identify subject for:XNAT_S00378
              at org.nrg.xnat.helpers.prearchive.PrearcDatabase$12.extSync(PrearcDatabase.java:966)
              at org.nrg.xnat.helpers.prearchive.PrearcDatabase$12.extSync(PrearcDatabase.java:961)
              at org.nrg.xnat.helpers.prearchive.PrearcDatabase$LockAndSync.run(PrearcDatabase.java:1615)
              at org.nrg.xnat.helpers.prearchive.PrearcDatabase._archive(PrearcDatabase.java:987)
              at org.nrg.xnat.helpers.prearchive.PrearcDatabase.archive(PrearcDatabase.java:934)
              at org.nrg.xnat.helpers.prearchive.handlers.PrearchiveArchiveHandler.commitSessionToArchive(PrearchiveArchiveHandler.java:60)
              at org.nrg.xnat.helpers.prearchive.handlers.PrearchiveArchiveHandler.execute(PrearchiveArchiveHandler.java:47)
              at org.nrg.xnat.services.messaging.prearchive.PrearchiveOperationRequestListener.onRequest(PrearchiveOperationRequestListener.java:38)
              at sun.reflect.GeneratedMethodAccessor1552.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:180)
              at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:112)
              at org.springframework.jms.listener.adapter.MessagingMessageListenerAdapter.invokeHandler(MessagingMessageListenerAdapter.java:104)
              at org.springframework.jms.listener.adapter.MessagingMessageListenerAdapter.onMessage(MessagingMessageListenerAdapter.java:69)
              at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:719)
              at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:679)
              at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:649)
              at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:317)
              at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:255)
              at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1167)
              at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1159)
              at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1056)
              at java.lang.Thread.run(Thread.java:748)
      Caused by: org.nrg.action.ServerException: java.lang.Exception: Unable to identify subject for:XNAT_S00378
              at org.nrg.xnat.helpers.merge.MergeSessionsA.call(MergeSessionsA.java:189)
              at org.nrg.xnat.archive.PrearcSessionArchiver.call(PrearcSessionArchiver.java:618)
              at org.nrg.xnat.helpers.prearchive.PrearcDatabase$12.extSync(PrearcDatabase.java:964)
              ... 23 common frames omitted
      Caused by: java.lang.Exception: Unable to identify subject for:XNAT_S00378
              at org.nrg.xdat.om.base.BaseXnatSubjectassessordata.preSave(BaseXnatSubjectassessordata.java:113)
              at org.nrg.xdat.om.base.BaseXnatImagesessiondata.preSave(BaseXnatImagesessiondata.java:3210)
              at org.nrg.xft.utils.SaveItemHelper.save(SaveItemHelper.java:82)
              at org.nrg.xft.utils.SaveItemHelper$$FastClassBySpringCGLIB$$64be15d8.invoke(<generated>)
              at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
              at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:737)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
              at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:84)
              at org.nrg.xnat.eventservice.aspects.EventServiceItemSaveAspect.processItemSaveTrigger(EventServiceItemSaveAspect.java:76)
              at sun.reflect.GeneratedMethodAccessor427.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:627)
              at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:616)
              at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:168)
      

      Attachments

        Issue Links

          Activity

            People

              moore.c@wustl.edu Charlie Moore (Inactive)
              moore.c@wustl.edu Charlie Moore (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 3 hours
                  3h