[Loris-dev] Error when removing UploadID

Nicolas Brossard nicolasbrossard.mni at gmail.com
Mon Oct 5 12:22:02 EDT 2020


Hi Alfredo,

Here's what I think is happening:

You have two uploads (say A and B) in table mri_upload tied to the same
archive (say X) in table tarchive. In other words, these two uploads have
the same tarchive ID. You delete archive A and everything related to it:
the delete script throws an error because it can't delete archive X, since
upload B is still attached to it.

The solution:

For both the uploads that you could not delete (process them one at a time):

1. Find the tarchive ID associated to this upload:

SELECT TarchiveID FROM mri_upload WHERE UploadID =
<ID_of_the_upload_that_cant_be_deleted>

2. Find all the uploads with that specific tarchive ID

SELECT UploadID FROM mri_upload WHERE TarchiveID =
<whatever_was_reported_in_1>

3. Delete all the uploads associated with the TarchiveID reported in 1 with
the delete script. Note that the argument to option -upload_id for this
invocation will be the comma separated list of upload IDs reported in 2.


I hope this makes sense. Let me know how it goes.


Best,
Nicolas

On Mon, Oct 5, 2020 at 9:43 AM Morales Pinzon, Alfredo <
AMORALESPINZON at bwh.harvard.edu> wrote:

> Dear LorisDev team,
>
> I am removing the images from some visits that need to be reuploaded. Out
> of 1.5K visits I have two of them failing to be removed. I am using the
> script “delete_imaging_upload.pl”. Here is the output I am getting:
>
> ===
> Backing up files related to the upload(s) to delete...
> /aaa/data/assembly/700759/w96/mri/native/IPMSA_700759_w96_flair_001.mnc
> /aaa/data/assembly/700759/w96/mri/native/IPMSA_700759_w96_mtOFF_001.mnc
> /aaa/data/assembly/700759/w96/mri/native/IPMSA_700759_w96_pdw_001.mnc
> /aaa/data/assembly/700759/w96/mri/native/IPMSA_700759_w96_t1p_001.mnc
> /aaa/data/assembly/700759/w96/mri/native/IPMSA_700759_w96_t1c_001.mnc
> /aaa/data/assembly/700759/w96/mri/native/IPMSA_700759_w96_t2w_001.mnc
> /aaa/data/assembly/310229/w96/mri/native/IPMSA_310229_w96_flair_001.mnc
> /aaa/data/assembly/310229/w96/mri/native/IPMSA_310229_w96_mtOFF_001.mnc
> /aaa/data/assembly/310229/w96/mri/native/IPMSA_310229_w96_pdw_001.mnc
> /aaa/data/assembly/310229/w96/mri/native/IPMSA_310229_w96_t1p_001.mnc
> /aaa/data/assembly/310229/w96/mri/native/IPMSA_310229_w96_t1c_001.mnc
> /aaa/data/assembly/310229/w96/mri/native/IPMSA_310229_w96_t2w_001.mnc
>
> /aaa/data/assembly/700759/w96/mri/processed/ConsensusGd/IPMSA_700759_w96_t1c_001_gvf_001.mnc.gz
>
> /aaa/data/assembly/700759/w96/mri/processed/NewT2/IPMSA_700759_w96_t2w_001_newt2f_001.mnc.gz
>
> /aaa/data/assembly/700759/w96/mri/processed/T2Vol/IPMSA_700759_w96_t2w_001_ct2f_001.mnc.gz
>
> /aaa/data/assembly/310229/w96/mri/processed/ConsensusGd/IPMSA_310229_w96_t1c_001_gvf_001.mnc.gz
>
> /aaa/data/assembly/310229/w96/mri/processed/NewT2/IPMSA_310229_w96_t2w_001_newt2f_001.mnc.gz
>
> /aaa/data/assembly/310229/w96/mri/processed/T2Vol/IPMSA_310229_w96_t2w_001_ct2f_001.mnc.gz
> /aaa/data/pic/310229/IPMSA_310229_w96_flair_001_162722_check.jpg
> /aaa/data/pic/310229/IPMSA_310229_w96_mtOFF_001_162723_check.jpg
> /aaa/data/pic/310229/IPMSA_310229_w96_pdw_001_162724_check.jpg
> /aaa/data/pic/310229/IPMSA_310229_w96_t1c_001_162726_check.jpg
> /aaa/data/pic/310229/IPMSA_310229_w96_t1c_001_gvf_001_285082_check.jpg
> /aaa/data/pic/310229/IPMSA_310229_w96_t1p_001_162725_check.jpg
> /aaa/data/pic/310229/IPMSA_310229_w96_t2w_001_162727_check.jpg
> /aaa/data/pic/310229/IPMSA_310229_w96_t2w_001_ct2f_001_285077_check.jpg
> /aaa/data/pic/310229/IPMSA_310229_w96_t2w_001_newt2f_001_285071_check.jpg
> /aaa/data/pic/700759/IPMSA_700759_w96_flair_001_162488_check.jpg
> /aaa/data/pic/700759/IPMSA_700759_w96_mtOFF_001_162489_check.jpg
> /aaa/data/pic/700759/IPMSA_700759_w96_pdw_001_162490_check.jpg
> /aaa/data/pic/700759/IPMSA_700759_w96_t1c_001_162492_check.jpg
> /aaa/data/pic/700759/IPMSA_700759_w96_t1c_001_gvf_001_284706_check.jpg
> /aaa/data/pic/700759/IPMSA_700759_w96_t1p_001_162491_check.jpg
> /aaa/data/pic/700759/IPMSA_700759_w96_t2w_001_162493_check.jpg
> /aaa/data/pic/700759/IPMSA_700759_w96_t2w_001_ct2f_001_284699_check.jpg
> /aaa/data/pic/700759/IPMSA_700759_w96_t2w_001_newt2f_001_284693_check.jpg
> /aaa/data/tarchive/2010/DCM_2010-05-19_ImagingUpload-16-19-BKCuuy.tar
>
> DBD::mysql::db do failed: Cannot delete or update a parent row: a foreign
> key constraint fails (`IPMSA_LORIS`.`mri_upload`, CONSTRAINT
> `FK_mriupload_TarchiveID` FOREIGN KEY (`TarchiveID`) REFERENCES `tarchive`
> (`TarchiveID`)) at /bbb/IPMSA/bin/mri/tools//delete_imaging_upload.pl
> line 1612.
> Issuing rollback() due to DESTROY without explicit disconnect() of
> DBD::mysql::db handle database=IPMSA_LORIS;host=111.222.333.44;port=3306;
> at /bbb/IPMSA/bin/mri/tools//delete_imaging_upload.pl line 1612.
> Usage: /bbb/IPMSA/bin/mri/tools//delete_imaging_upload.pl [-profile file]
> [-ignore] [-backup_path path] [-protocol] [-form] [-uploadID
> list_of_uploadIDs]
>             [-type list_of_scan_types] [-defaced] [-nosqlbk] [-nofilesbk]
> ===
>
> Any ideas what can be happening?
>
> Regards,
> Alfredo.
> The information in this e-mail is intended only for the person to whom it
> is addressed. If you believe this e-mail was sent to you in error and the
> e-mail contains patient information, please contact the Mass General
> Brigham Compliance HelpLine at
> http://www.massgeneralbrigham.org/complianceline . If the e-mail was sent
> to you in error but does not contain patient information, please contact
> the sender and properly dispose of the e-mail.
> _______________________________________________
> Loris-dev mailing list
> Loris-dev at bic.mni.mcgill.ca
> https://mailman.bic.mni.mcgill.ca/mailman/listinfo/loris-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.bic.mni.mcgill.ca/pipermail/loris-dev/attachments/20201005/2d2d362c/attachment.html>


More information about the Loris-dev mailing list