<div dir="ltr">Hi all,<br><div><br></div><div>Regarding the foreign key constraint fail error, my guess is that you have two records in mri_uploads that are tied to the same archive and you are trying to delete one of them. What I am saying is that you have two uploads, say U1 and U2, which have the same tarchive ID, say A1. If you try to delete U1, the script will try to delete everything associated to it, including archive A1, which will fail because of the foreign key constraint still tying U2 to A1. This is unfortunately a bug of the delete script. </div><div><br></div><div>You should be able to delete *all* the uploads that have the same tarchive ID though, but you'd have to do it in the same script invocation. So back to our example, you could delete U1 and U2 but you'd have to delete them at the same time by supplying both upload IDs in a comma-separated list via the -uploadID switch (see the perldoc for the delete script).</div><div><br></div><div>I hope this makes sense. Let me know if I you need more information.</div><div><br></div><div><br></div><div>Regards,</div><div>Nicolas</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 6, 2020 at 6:02 PM Cecile Madjar <<a href="mailto:cecile.madjar@mcin.ca">cecile.madjar@mcin.ca</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 dir="ltr"><div dir="ltr">Hi Alfredo,<div><br></div><div>See answers below in blue.<br></div></div><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Error type 1:<br>
===<br>
Error! File /ABC/data/pic/979907/IPMSA_979907_m00_NA_001_182_check.jpg exists in the database but was not found on the file system.<br>
Aborting.<br>
===<br>
<br>
Error type 2:<br>
===<br>
Error! File /ABC/data/assembly/677803/m12/mri/native/IPMSA_677803_m12_NA_002.nii exists in the database but was not found on the file system.<br>
Aborting.<br>
===<br></blockquote><div><br></div><div><font color="#0000ff">The first two errors are the same. The delete script always checks first if the file is on the filesystem. My guess is that when you ran the pipeline, the path to the NIfTI file was inserted into the database even when the NIfTI file was not created due to some mnc2nii conversion errors (known bug that was fixed in release 22.0). You can use the option -ignore to ignore the check between database and file system.</font></div><div><font color="#0000ff"> </font></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Error type 3:<br>
===<br>
/ABC/data/pic/819059/IPMSA_819059_m12_NA_006_3098_check.jpg<br>
/ABC/data/pic/819059/IPMSA_819059_m12_NA_007_3099_check.jpg<br>
/ABC/data/pic/819059/IPMSA_819059_m12_NA_008_3100_check.jpg<br>
/ABCdata/pic/819059/IPMSA_819059_m12_NA_009_3101_check.jpg<br>
/ABC/data/pic/819059/IPMSA_819059_m12_t1_001_3091_check.jpg<br>
/ABC/data/pic/819059/IPMSA_819059_m12_t1_002_3092_check.jpg<br>
/ABC/data/tarchive/2009/DCM_2009-12-10_ImagingUpload-7-57-r0hk9h.tar<br>
<br>
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 /data_/ipmsa/loris_data/IPMSA/bin/mri/tools//<a href="http://delete_imaging_upload.pl" rel="noreferrer" target="_blank">delete_imaging_upload.pl</a> line 1612.<br>
Issuing rollback() due to DESTROY without explicit disconnect() of DBD::mysql::db handle database=IPMSA_LORIS;host=132.216.133.50;port=3306; at /data_/ipmsa/loris_data/IPMSA/bin/mri/tools//<a href="http://delete_imaging_upload.pl" rel="noreferrer" target="_blank">delete_imaging_upload.pl</a> line 1612.<br>
===<br></blockquote><div><br></div><div><font color="#0000ff">Not sure what is going on here. Could you point me to the file so I can check where the issue comes from? Or the release version you are using. Are there any processed output data for that upload ID?</font></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Error type 4:<br>
===<br>
Cannot delete upload 1543: the MRI pipeline is currently processing it.<br>
===<br></blockquote><div><br></div><div><font color="#0000ff">If you are sure you are not running the pipeline, you will need to update the mri_upload table to reflect this. For some obscure reason, the insertion status fields of the mri_upload table were not updated for that UploadID. Maybe the pipeline got interrupted?</font></div><div><font color="#0000ff">UPDATE mri_upload SET Inserting=0, InsertionComplete=1 WHERE UploadID=1543;</font></div><div><font color="#0000ff">Then, rerun the delete script on that UploadID.</font></div><div><font color="#0000ff"><br></font></div><div><font color="#0000ff">Hope this helps. Best,</font></div><div><font color="#0000ff"><br></font></div><div><font color="#0000ff">Cécile</font></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Looking forward to hearing from you.<br>
<br>
Regards,<br>
Alfredo.<br>
<br>
_______________________________________________<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>
_______________________________________________<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>