SQL error on DICOM download

15 views
Skip to first unread message

Ben Wagner

unread,
Aug 8, 2022, 11:05:05 AM8/8/22
to xnat_discussion
Hi all,
  Recently updated to XNAT 1.8.5 and when trying to download DICOM files from "manage files" the following SQL error occurs.  I'm getting similar reports for "download images" and when using the different python wrappers.  Oddity is I'm not seeing this on a similar XNAT 1.8.5 instance I manage.  

Any suggestions?
Ben

PreparedStatementCallback; bad SQL grammar [WITH resources AS ( SELECT a.xnat_abstractresource_id AS resourceId, r.uri AS uri, xme.element_name AS xsiType, e.id AS securityId, e.project AS projectId FROM xnat_abstractresource a LEFT JOIN xnat_resource r ON a.xnat_abstractresource_id = r.xnat_abstractresource_id LEFT JOIN xnat_imagescandata s ON a.xnat_imagescandata_xnat_imagescandata_id = s.xnat_imagescandata_id LEFT JOIN img_assessor_in_resource iain ON a.xnat_abstractresource_id = iain.xnat_abstractresource_xnat_abstractresource_id LEFT JOIN img_assessor_out_resource iaout ON a.xnat_abstractresource_id = iaout.xnat_abstractresource_xnat_abstractresource_id LEFT JOIN recon_in_resource rin ON a.xnat_abstractresource_id = rin.xnat_abstractresource_xnat_abstractresource_id LEFT JOIN recon_out_resource rout ON a.xnat_abstractresource_id = rout.xnat_abstractresource_xnat_abstractresource_id LEFT JOIN xnat_reconstructedimagedata recon ON COALESCE(rin.xnat_reconstructedimagedata_xnat_reconstructedimagedata_id, rout.xnat_reconstructedimagedata_xnat_reconstructedimagedata_id) = recon.xnat_reconstructedimagedata_id LEFT JOIN xnat_experimentdata_resource eres ON a.xnat_abstractresource_id = eres.xnat_abstractresource_xnat_abstractresource_id LEFT JOIN xnat_experimentdata e ON COALESCE(s.image_session_id, eres.xnat_experimentdata_id, iaout.xnat_imageassessordata_id, iain.xnat_imageassessordata_id, recon.image_session_id) = e.id LEFT JOIN xdat_meta_element xme ON e.extension = xme.xdat_meta_element_id WHERE a.xnat_abstractresource_id IN (?) AND e.id IS NOT NULL UNION SELECT a.xnat_abstractresource_id AS resourceId, r.uri AS uri, 'xnat:subjectData' AS xsiType, s.id AS securityId, s.project AS projectId FROM xnat_subjectdata_resource res LEFT JOIN xnat_abstractresource a ON res.xnat_abstractresource_xnat_abstractresource_id = a.xnat_abstractresource_id LEFT JOIN xnat_resource r ON a.xnat_abstractresource_id = r.xnat_abstractresource_id LEFT JOIN xnat_subjectdata S ON res.xnat_subjectdata_id = S.id WHERE a.xnat_abstractresource_id IN (?) UNION SELECT a.xnat_abstractresource_id AS resourceId, r.uri AS uri, 'xnat:projectData' AS xsiType, p.id AS securityId, p.id AS projectId FROM xnat_projectdata_resource res LEFT JOIN xnat_abstractresource a ON res.xnat_abstractresource_xnat_abstractresource_id = a.xnat_abstractresource_id LEFT JOIN xnat_resource r ON a.xnat_abstractresource_id = r.xnat_abstractresource_id LEFT JOIN xnat_projectdata p ON res.xnat_projectdata_id = p.id WHERE a.xnat_abstractresource_id IN (?)) SELECT * FROM resources WHERE data_type_fns_can_action_entity(?, 'read', securityId) = TRUE]; nested exception is org.postgresql.util.PSQLException: ERROR: column rin.xnat_reconstructedimagedata_xnat_reconstructedimagedata_id does not exist Hint: Perhaps you meant to reference the column "rout.xnat_reconstructedimagedata_xnat_reconstructedimagedata_id". Position: 1187


Ben Wagner

unread,
Aug 8, 2022, 12:39:11 PM8/8/22
to xnat_discussion
Ok, so I went a bit nuclear.  Comparing the working database to the non-working the table recon_in_resource field was named oddly:

Old: xnat_reconstructedimgdata_xnat_reconstructedimgdata_id
Required: xnat_reconstructedimagedata_xnat_reconstructedimagedata_id

I thought dropping (as it was empty) and restarting XNAT would recreate it.  Unfortunately it didn't.  So I copied its structure and attributes from the working database.  It's working now.

Odd.
Ben

--
You received this message because you are subscribed to a topic in the Google Groups "xnat_discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/xnat_discussion/HDpKfGImmdk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to xnat_discussi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xnat_discussion/1b247ce6-ff51-4bb4-94ef-8e84f0e6acaen%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages