<div dir="ltr">Hi Ioannis,<div><br></div><div>Apologies for the late reply.</div><div><br></div><div>Since you are getting a permission denied error, it means the directory exists <b>but</b> you cannot cd to it, otherwise you'd be getting a directory does not exist error. My guess is that when the archive is decompressed, the script creates directory <font face="monospace">/tmp/ImagingUpload-15-8-Z8Hax5/BR013_243782_V1</font> but the owner/permissions on that directory, once extracted, do not allow it to cd there afterwards.</div><div><br></div><div>So...</div><div><br></div><div>Are you running script <font face="monospace"><a href="http://imaging_upload.pl">imaging_upload.pl</a> </font><font face="arial, sans-serif">as</font><font face="monospace"> root </font><font face="arial, sans-serif">or as another user</font>?</div><div>Check the contents of the archive you are processing: what are the ownership/permissions on directory <font face="monospace">BR013_243782_V1</font>?</div><div>What do you get when you type the Unix command <font face="monospace">umask?</font></div><div><font face="monospace"><br></font></div><div><font face="monospace"><br></font></div><div><font face="arial, sans-serif">Cheers,</font></div><div><font face="arial, sans-serif">Nicolas</font></div><div><font face="arial, sans-serif"><br></font></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 17, 2020 at 9:54 PM Ioannis Pappas <<a href="mailto:ioannis@berkeley.edu">ioannis@berkeley.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>Apologies for the late reply but I wanted to look into it more with the kind help of Julie (our sys admin). For your information the exact error is this:</div><div><br></div><div>Can't cd to (/tmp/ImagingUpload-15-8-Z8Hax5/) BR013_243782_V1: Permission denied<br>at /data/loris-mri/bin/mri/uploadNeuroDB/NeuroDB/ImagingUpload.pm line 202.</div><div><br></div><div>However, I can write in /tmp no problem e.g. </div><div><br></div><div>[lorisadmin@loris ~]$ mkdir /tmp/ImagingUpload-15-8-Z8Hax5/<br>[lorisadmin@loris ~]$ ls -ld /tmp/ImagingUpload-15-8-Z8Hax5/<br>drwxrwxr-x 2 lorisadmin lorisadmin 4096 Sep 17 15:14 /tmp/ImagingUpload-15-8-Z8Hax5/<br></div><div><br></div><div>I think that the problem is that the perl script doesn’t make the temporary directory after unzipping in /tmp and then all of sudden it wants to cd there (that’s why I get “permission denied” it just doesn’t exist).</div><div>My .zip (BR013_243782_V1.zip) contains one folder (BR013_243782_V1) of .dcm files for simplicity. Should there be some internal structure there (or something else in terms of naming)?</div><div><br></div><div>Thank you very much. </div><div><br></div><div>Best wishes,</div><div>Ioannis </div><div><br></div><div><br></div><div><br></div><div><br><div><br><blockquote type="cite"><div>On Sep 15, 2020, at 1:44 PM, Nicolas Brossard <<a href="mailto:nicolasbrossard.mni@gmail.com" target="_blank">nicolasbrossard.mni@gmail.com</a>> wrote:</div><br><div><div dir="ltr">Hi Ioannis,<div><br></div><div>No worries, we're here to help!</div><div><br></div><div>On Unix systems, all users usually have permission to create directories in <font face="monospace">/tmp</font> but just to be sure it'd be good idea to test that: just try</div><div><br></div><div><font face="monospace">% mkdir /tmp/hello</font></div><div><font face="monospace"><br></font></div><div><font face="arial, sans-serif">and see if that works. If it does, then it means there's something more "sneaky" going on.</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">You can try specifying an alternate temporary directory in which the upload script will write files: just type the following line in your </font><font face="monospace">environment</font><font face="arial, sans-serif"> file (located in the LORIS-MRI root directory):</font></div><div><font face="arial, sans-serif"><br></font></div><div><div style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">export TMPDIR=/my/alternate/temporary/dir</span></div><div style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><br></div><div style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font face="arial, sans-serif">Let me know if that helps.</font></div><div style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font face="arial, sans-serif"><br></font></div><div style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font face="arial, sans-serif"><br></font></div><div style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font face="arial, sans-serif">Cheers,</font></div><div style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font face="arial, sans-serif">Nicolas</font></div><div style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font face="arial, sans-serif"><br></font></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Sep 15, 2020 at 4:23 PM Ioannis Pappas <<a href="mailto:ioannis@berkeley.edu" target="_blank">ioannis@berkeley.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>Hi Loris support.</div><div><br></div><div>Another quick question (hopefully I don’t occupy a lot of your time during this pandemic).</div><div><br></div><div>I am running the simple imaging upload pearl script like this:</div><div><br></div><div><i>sudo -i -u lorisadmin /data/loris-mri/bin/mri/uploadNeuroDB/<a href="http://imaging_upload_file.pl/" target="_blank">imaging_upload_file.pl</a> -profile prod -upload_id 2 /data/loris/incoming/BR013_243782_V1.zip -verbose</i></div><div><br></div><div>I think the script involves creating some directories because it leads to an error. The error is this:</div><div><br></div><div><i>mkdir /tmp/ImagingUpload-13-7-7Z_JFF/BR013_243782_V1/BIAS_12ch_22: Permission denied at /usr/local/share/perl5/Archive/Zip/DirectoryMember.pm </i></div><div><br></div><div>Do you guys think it has to do with my permission at /tmp or there is something else more sneaky? The /tmp folder doesn’t seem to have anything related to <i>ImagingUpload</i>[..]</div><div><br></div><div>Thank you very much. Hopefully I don’t see more errors in the script.</div><div><br></div><div>Best wishes,</div><div>Ioannis</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></div></blockquote></div>