Some prearchive scans fail to archive

64 views
Skip to first unread message

Brian Gregor

unread,
Sep 12, 2024, 11:08:48 AM9/12/24
to xnat_discussion
Hi all,

We are seeing an issue with some sessions that are uploaded to the XNAT server (v1.8.10) prearchive via the SCP receiver. The sessions appear in the prearchive with a blank subject field. Examining the dicom.log file we'll see errors like those shown below.  Clicking the Details button resulted in a page displaying an XML parsing error (sorry, I didn't grab the text of that).  The Archive and Review and Archive buttons give similar XML parsing error messages.

With these sessions I can click the Rebuild button, which results in the subject field filling in correctly, and then I can successfully archive the session.  This pattern only occurs with sessions that contain scans with a "secondary" type instead of DICOM. 

Has anyone else dealt with a similar situation?  Thank you!

Here's an example of the errors found in dicom.log from one of the recent scans. 

ERROR org.nrg.dcm.xnat.CatalogBuilder - Unable to move /data/xnat/prearchive/example1/20240909_080125562/240909_example1/SCANS/6/DICOM/8tncf4.dcm to /data/xnat/prearchive/example1/20240909_080125562/240909_example1/SCANS/6/secondary
java.nio.file.NoSuchFileException: /data/xnat/prearchive/example1/20240909_080125562/240909_example1/SCANS/6/DICOM/8tncf4.dcm -> /data/xnat/prearchive/example1/20240909_080125562/240909_QA/SCANS/6/secondary/8tncf4.dcm
        at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
        at sun.nio.fs.UnixCopyFile.move(UnixCopyFile.java:457)
        at sun.nio.fs.UnixFileSystemProvider.move(UnixFileSystemProvider.java:262)
        at java.nio.file.Files.move(Files.java:1395)
        at org.nrg.dcm.xnat.CatalogBuilder.moveFile(CatalogBuilder.java:295)
        at org.nrg.dcm.xnat.CatalogBuilder.fixLocation(CatalogBuilder.java:278)
        at org.nrg.dcm.xnat.CatalogBuilder.call(CatalogBuilder.java:185)
        at org.nrg.dcm.xnat.DICOMScanBuilder$ResourceCatalogCollector.call(DICOMScanBuilder.java:304)
        at org.nrg.dcm.xnat.DICOMScanBuilder$ResourceCatalogCollector.iterator(DICOMScanBuilder.java:341)
        at org.nrg.dcm.xnat.DICOMScanBuilder.call(DICOMScanBuilder.java:242)
        at org.nrg.dcm.xnat.DICOMSessionBuilder.call(DICOMSessionBuilder.java:586)
        at org.nrg.dcm.xnat.DICOMSessionBuilder.call(DICOMSessionBuilder.java:56)
        at org.nrg.session.SessionBuilder.writeSession(SessionBuilder.java:208)
        at org.nrg.session.SessionBuilder.run(SessionBuilder.java:249)
        at org.nrg.xnat.archive.XNATSessionBuilder.buildDicomSession(XNATSessionBuilder.java:262)
        at org.nrg.xnat.archive.XNATSessionBuilder.call(XNATSessionBuilder.java:172)
        at org.nrg.xnat.helpers.prearchive.PrearcUtils.buildSession(PrearcUtils.java:809)
        at org.nrg.xnat.helpers.prearchive.PrearcUtils.buildSession(PrearcUtils.java:772)
        at org.nrg.xnat.helpers.prearchive.PrearcDatabase$13.extSync(PrearcDatabase.java:1035)
        at org.nrg.xnat.helpers.prearchive.PrearcDatabase$13.extSync(PrearcDatabase.java:1033)
        at org.nrg.xnat.helpers.prearchive.PrearcDatabase$LockAndSync.run(PrearcDatabase.java:1596)
        at org.nrg.xnat.helpers.prearchive.PrearcDatabase.buildSession(PrearcDatabase.java:1047)
        at org.nrg.xnat.helpers.prearchive.PrearcDatabase.buildSession(PrearcDatabase.java:1015)
        at org.nrg.xnat.helpers.prearchive.handlers.PrearchiveRebuildHandler.execute(PrearchiveRebuildHandler.java:65)
        at org.nrg.xnat.services.messaging.prearchive.PrearchiveOperationRequestListener.onRequest(PrearchiveOperationRequestListener.java:38)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        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:750)
2024-09-09 09:52:17,734 [DefaultMessageListenerContainer-4] ERROR org.nrg.dcm.xnat.DICOMScanBuilder - Unable to build catalog for scan 6

xnat pss

unread,
Sep 19, 2024, 5:44:56 PM9/19/24
to xnat_discussion
Just bumping this, recently upgraded to 1.8.10 and my images uploaded via API we're failing and stuck in "Building Now" in pre-archive. Nothing seem to work to remove the image from pre-archive and same exception is displayed. 

Thanks
PSS 

Brad Jones

unread,
Jun 9, 2026, 10:50:04 AM (3 days ago) Jun 9
to xnat_discussion
I'm having this same issue currently.  we ran out of space, and now that is fixed, but I have 40 rows stuck in Building now for over a week.  Is there a way to manually clean this up?  I already tried restarting tomcat.

Rick Herrick

unread,
Jun 9, 2026, 3:00:04 PM (3 days ago) Jun 9
to xnat_di...@googlegroups.com
Hi Brad,

If you have access to the database you can reset the status that way. You could do something like this:

UPDATE xdat_search.prearchive SET status = 'RECEIVING' WHERE status ~ '^.*BUILDING.*';

This should put the sessions back into receiving state, from which state they should then picked up as ready to build by the prearchive session rebuilder.

Rick Herrick 

Senior Software Developer

ri...@xnatworks.io

https://xnatworks.io | Find us on LinkedIn



--
You received this message because you are subscribed to the Google Groups "xnat_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xnat_discussi...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/xnat_discussion/3176ef60-d5e3-445b-ae33-ae6f646212f8n%40googlegroups.com.

Brad Jones

unread,
Jun 9, 2026, 3:18:57 PM (3 days ago) Jun 9
to xnat_discussion
thanks Rick!

right before I saw this.  I was able to blow away everything in the pre archive dir, then restart tomcat and that seemed to work.  Next I'll re upload them.

Brad Jones

Rick Herrick

unread,
Jun 9, 2026, 3:23:22 PM (3 days ago) Jun 9
to xnat_di...@googlegroups.com
Yeah, that would also work because XNAT by default checks the prearchive table against what's on the filesystem. It then removes any prearchive entries that lack corresponding folders. The downside is obviously that the data needs to be re-sent or re-uploaded.

Rick Herrick 

Senior Software Developer

ri...@xnatworks.io

https://xnatworks.io | Find us on LinkedIn


Reply all
Reply to author
Forward
0 new messages