<div dir="ltr">Hi Alfredo,<div><br></div><div>Awesome! Let me know if you have other issues.</div><div><br></div><div><br></div><div><br></div><div>Best,</div><div>Nicolas</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Oct 13, 2020 at 5:42 PM Morales Pinzon, Alfredo <<a href="mailto:AMORALESPINZON@bwh.harvard.edu">AMORALESPINZON@bwh.harvard.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div style="overflow-wrap: break-word;">
Hi Nicolas,
<div><br>
</div>
<div>I tried using both UploadIDs in the command and it worked. Thank you very much.</div>
<div><br>
</div>
<div>Best,</div>
<div>Alfredo.<br>
<div><br>
<blockquote type="cite">
<div>On Oct 5, 2020, at 12:22 PM, Nicolas Brossard <<a href="mailto:nicolasbrossard.mni@gmail.com" target="_blank">nicolasbrossard.mni@gmail.com</a>> wrote:</div>
<br>
<div>
<p><span style="padding:3px 10px;border-radius:5px;color:rgb(255,255,255);font-weight:bold;display:inline-block;background-color:rgb(255,0,0)"> External Email - Use Caution </span></p>
<div><br>
</div>
<div dir="ltr">Hi Alfredo,<br>
<div><br>
</div>
<div>Here's what I think is happening:</div>
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div>The solution:</div>
<div><br>
</div>
<div>For both the uploads that you could not delete (process them one at a time):</div>
<div><br>
</div>
<div>1. Find the tarchive ID associated to this upload: </div>
<div><br>
</div>
<div><font face="monospace">SELECT TarchiveID FROM mri_upload WHERE UploadID = <ID_of_the_upload_that_cant_be_deleted></font></div>
<div><font face="monospace"><br>
</font></div>
<div><font face="arial, sans-serif">2. Find all the uploads with that specific tarchive ID</font></div>
<div><font face="arial, sans-serif"><br>
</font></div>
<div><font face="monospace">SELECT UploadID FROM mri_upload WHERE TarchiveID = <whatever_was_reported_in_1></font></div>
<div><font face="monospace"><br>
</font></div>
<div>3. Delete all the uploads associated with the TarchiveID reported in 1 with the delete script. Note that the argument to option
<font face="monospace">-upload_id </font><font face="arial, sans-serif">for this invocation will be the comma separated list of upload IDs reported in 2.</font></div>
<div><font face="arial, sans-serif"><br>
</font></div>
<div><br>
</div>
<div>I hope this makes sense. Let me know how it goes.</div>
<div><br>
</div>
<div><br>
</div>
<div>Best,</div>
<div>Nicolas</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Mon, Oct 5, 2020 at 9:43 AM Morales Pinzon, Alfredo <<a href="mailto:AMORALESPINZON@bwh.harvard.edu" target="_blank">AMORALESPINZON@bwh.harvard.edu</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<div>Dear LorisDev team,</div>
<div><br>
</div>
<div>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 “<font face="Menlo"><span style="font-size:11px"><a href="http://delete_imaging_upload.pl/" target="_blank">delete_imaging_upload.pl</a></span><span style="font-size:11px">”</span><span style="font-size:11px">. </span></font>Here
is the output I am getting:</div>
<div><br>
</div>
<div>===</div>
<div>
<div>Backing up files related to the upload(s) to delete...</div>
<div>/aaa/data/assembly/700759/w96/mri/native/IPMSA_700759_w96_flair_001.mnc</div>
<div>/aaa/data/assembly/700759/w96/mri/native/IPMSA_700759_w96_mtOFF_001.mnc</div>
<div>/aaa/data/assembly/700759/w96/mri/native/IPMSA_700759_w96_pdw_001.mnc</div>
<div>/aaa/data/assembly/700759/w96/mri/native/IPMSA_700759_w96_t1p_001.mnc</div>
<div>/aaa/data/assembly/700759/w96/mri/native/IPMSA_700759_w96_t1c_001.mnc</div>
<div>/aaa/data/assembly/700759/w96/mri/native/IPMSA_700759_w96_t2w_001.mnc</div>
<div>/aaa/data/assembly/310229/w96/mri/native/IPMSA_310229_w96_flair_001.mnc</div>
<div>/aaa/data/assembly/310229/w96/mri/native/IPMSA_310229_w96_mtOFF_001.mnc</div>
<div>/aaa/data/assembly/310229/w96/mri/native/IPMSA_310229_w96_pdw_001.mnc</div>
<div>/aaa/data/assembly/310229/w96/mri/native/IPMSA_310229_w96_t1p_001.mnc</div>
<div>/aaa/data/assembly/310229/w96/mri/native/IPMSA_310229_w96_t1c_001.mnc</div>
<div>/aaa/data/assembly/310229/w96/mri/native/IPMSA_310229_w96_t2w_001.mnc</div>
<div>/aaa/data/assembly/700759/w96/mri/processed/ConsensusGd/IPMSA_700759_w96_t1c_001_gvf_001.mnc.gz</div>
<div>/aaa/data/assembly/700759/w96/mri/processed/NewT2/IPMSA_700759_w96_t2w_001_newt2f_001.mnc.gz</div>
<div>/aaa/data/assembly/700759/w96/mri/processed/T2Vol/IPMSA_700759_w96_t2w_001_ct2f_001.mnc.gz</div>
<div>/aaa/data/assembly/310229/w96/mri/processed/ConsensusGd/IPMSA_310229_w96_t1c_001_gvf_001.mnc.gz</div>
<div>/aaa/data/assembly/310229/w96/mri/processed/NewT2/IPMSA_310229_w96_t2w_001_newt2f_001.mnc.gz</div>
<div>/aaa/data/assembly/310229/w96/mri/processed/T2Vol/IPMSA_310229_w96_t2w_001_ct2f_001.mnc.gz</div>
<div>/aaa/data/pic/310229/IPMSA_310229_w96_flair_001_162722_check.jpg</div>
<div>/aaa/data/pic/310229/IPMSA_310229_w96_mtOFF_001_162723_check.jpg</div>
<div>/aaa/data/pic/310229/IPMSA_310229_w96_pdw_001_162724_check.jpg</div>
<div>/aaa/data/pic/310229/IPMSA_310229_w96_t1c_001_162726_check.jpg</div>
<div>/aaa/data/pic/310229/IPMSA_310229_w96_t1c_001_gvf_001_285082_check.jpg</div>
<div>/aaa/data/pic/310229/IPMSA_310229_w96_t1p_001_162725_check.jpg</div>
<div>/aaa/data/pic/310229/IPMSA_310229_w96_t2w_001_162727_check.jpg</div>
<div>/aaa/data/pic/310229/IPMSA_310229_w96_t2w_001_ct2f_001_285077_check.jpg</div>
<div>/aaa/data/pic/310229/IPMSA_310229_w96_t2w_001_newt2f_001_285071_check.jpg</div>
<div>/aaa/data/pic/700759/IPMSA_700759_w96_flair_001_162488_check.jpg</div>
<div>/aaa/data/pic/700759/IPMSA_700759_w96_mtOFF_001_162489_check.jpg</div>
<div>/aaa/data/pic/700759/IPMSA_700759_w96_pdw_001_162490_check.jpg</div>
<div>/aaa/data/pic/700759/IPMSA_700759_w96_t1c_001_162492_check.jpg</div>
<div>/aaa/data/pic/700759/IPMSA_700759_w96_t1c_001_gvf_001_284706_check.jpg</div>
<div>/aaa/data/pic/700759/IPMSA_700759_w96_t1p_001_162491_check.jpg</div>
<div>/aaa/data/pic/700759/IPMSA_700759_w96_t2w_001_162493_check.jpg</div>
<div>/aaa/data/pic/700759/IPMSA_700759_w96_t2w_001_ct2f_001_284699_check.jpg</div>
<div>/aaa/data/pic/700759/IPMSA_700759_w96_t2w_001_newt2f_001_284693_check.jpg</div>
<div>/aaa/data/tarchive/2010/DCM_2010-05-19_ImagingUpload-16-19-BKCuuy.tar</div>
<div><br>
</div>
<div>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//<a href="http://delete_imaging_upload.pl/" target="_blank">delete_imaging_upload.pl</a>
line 1612.</div>
<div>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//<a href="http://delete_imaging_upload.pl/" target="_blank">delete_imaging_upload.pl</a>
line 1612.</div>
<div>Usage: /bbb/IPMSA/bin/mri/tools//<a href="http://delete_imaging_upload.pl/" target="_blank">delete_imaging_upload.pl</a> [-profile file] [-ignore] [-backup_path path] [-protocol] [-form] [-uploadID list_of_uploadIDs]</div>
<div> [-type list_of_scan_types] [-defaced] [-nosqlbk] [-nofilesbk]</div>
</div>
<div>===</div>
<div><br>
</div>
<div>Any ideas what can be happening?</div>
<div><br>
</div>
<div>Regards,</div>
<div>Alfredo.</div>
<div>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 <a href="http://www.massgeneralbrigham.org/complianceline" target="_blank">
http://www.massgeneralbrigham.org/complianceline</a> . 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.</div>
</div>
_______________________________________________<br>
Loris-dev mailing list<br>
<a href="mailto:Loris-dev@bic.mni.mcgill.ca" target="_blank">Loris-dev@bic.mni.mcgill.ca</a><br>
<a href="https://mailman.bic.mni.mcgill.ca/mailman/listinfo/loris-dev" rel="noreferrer" target="_blank">https://mailman.bic.mni.mcgill.ca/mailman/listinfo/loris-dev</a><br>
</blockquote>
</div>
</div>
</blockquote>
</div>
<br>
</div>
<div>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 <a href="http://www.massgeneralbrigham.org/complianceline" target="_blank">http://www.massgeneralbrigham.org/complianceline</a> . 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.</div></div>
</blockquote></div>