[Loris-dev] upload_file.pl issue

Nicolas Brossard nicolasbrossard.mni at gmail.com
Tue Sep 22 14:14:55 EDT 2020


Hi Ioannis,

Apologies for the late reply.

Since you are getting a permission denied error, it means the directory
exists *but* 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 /tmp/ImagingUpload-15-8-Z8Hax5/BR013_243782_V1
but the owner/permissions on that directory, once extracted, do not allow
it to cd there afterwards.

So...

Are you running script imaging_upload.pl as root or as another user?
Check the contents of the archive you are processing: what are the
ownership/permissions on directory BR013_243782_V1?
What do you get when you type the Unix command umask?


Cheers,
Nicolas


On Thu, Sep 17, 2020 at 9:54 PM Ioannis Pappas <ioannis at berkeley.edu> wrote:

> Hi Nicolas.
>
> 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:
>
> Can't cd to (/tmp/ImagingUpload-15-8-Z8Hax5/) BR013_243782_V1: Permission
> denied
> at /data/loris-mri/bin/mri/uploadNeuroDB/NeuroDB/ImagingUpload.pm line 202.
>
> However, I can write in /tmp no problem e.g.
>
> [lorisadmin at loris ~]$ mkdir /tmp/ImagingUpload-15-8-Z8Hax5/
> [lorisadmin at loris ~]$ ls -ld /tmp/ImagingUpload-15-8-Z8Hax5/
> drwxrwxr-x 2 lorisadmin lorisadmin 4096 Sep 17 15:14
> /tmp/ImagingUpload-15-8-Z8Hax5/
>
> 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).
> 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)?
>
> Thank you very much.
>
> Best wishes,
> Ioannis
>
>
>
>
>
> On Sep 15, 2020, at 1:44 PM, Nicolas Brossard <
> nicolasbrossard.mni at gmail.com> wrote:
>
> Hi Ioannis,
>
> No worries, we're here to help!
>
> On Unix systems, all users usually have permission to create directories
> in /tmp but just to be sure it'd be good idea to test that: just try
>
> % mkdir /tmp/hello
>
> and see if that works. If it does, then it means there's something more
> "sneaky" going on.
>
> You can try specifying an alternate temporary directory in which the
> upload script will write files: just type the following line in your
> environment file (located in the LORIS-MRI root directory):
>
> export TMPDIR=/my/alternate/temporary/dir
>
>
> Let me know if that helps.
>
>
> Cheers,
> Nicolas
>
>
> On Tue, Sep 15, 2020 at 4:23 PM Ioannis Pappas <ioannis at berkeley.edu>
> wrote:
>
>> Hi Loris support.
>>
>> Another quick question (hopefully I don’t occupy a lot of your time
>> during this pandemic).
>>
>> I am running the simple imaging upload pearl script like this:
>>
>> *sudo -i -u lorisadmin
>> /data/loris-mri/bin/mri/uploadNeuroDB/imaging_upload_file.pl
>> <http://imaging_upload_file.pl/> -profile prod -upload_id 2
>> /data/loris/incoming/BR013_243782_V1.zip -verbose*
>>
>> I think the script involves creating some directories because it leads to
>> an error. The error is this:
>>
>> *mkdir /tmp/ImagingUpload-13-7-7Z_JFF/BR013_243782_V1/BIAS_12ch_22:
>> Permission denied at /usr/local/share/perl5/Archive/Zip/DirectoryMember.pm *
>>
>> 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 *ImagingUpload*[..]
>>
>> Thank you very much. Hopefully I don’t see more errors in the script.
>>
>> Best wishes,
>> Ioannis
>> _______________________________________________
>> 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/20200922/44f85fcb/attachment.html>


More information about the Loris-dev mailing list