Page 1 of 1

OSError: [Errno 13] Permission denied

PostPosted: Wed May 02, 2018 10:21 pm
by Hang
Hi there,

I'm trying to call a compiled Matlab executable from Omero server using Python script service.

In my Python script, I use the fucntion:
Code: Select all
subprocess.Popen(['/home/yuh5/Desktop/magicsquare/for_testing/magicsquare', '5'])


However, I got error:
Code: Select all
omero script launch 354
Using session 869c89d4-c0a5-44a1-9205-6aa49a300d47 (yuh5@localhost:4064). Idle timeout: 10 min. Current group: system
Enter value for "IDs": 1
Job 311 ready
Waiting....
Callback received: FINISHED

   *** start stdout (id=361)***
   * Color of each channel:
   *
   *** end stdout ***


   *** start stderr (id=362)***
   * Traceback (most recent call last):
   *   File "./script", line 122, in <module>
   *     run_script()
   *   File "./script", line 100, in run_script
   *     subprocess.Popen(['/home/yuh5/Desktop/magicsquare/for_testing/magicsquare', '5'])
   *   File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
   *     errread, errwrite)
   *   File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child
   *     raise child_exception
   * OSError: [Errno 13] Permission denied
   *
   *** end stderr ***


   *** out parameters ***
   ***  done ***


I'm sure I have the permission to execute file under that path. And I was able to run that executable with:

Code: Select all
omero@ceb-cad2:/usr/local/MATLAB$ python
Python 2.7.12 (default, Dec  4 2017, 14:50:18)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import subprocess
>>> subprocess.Popen(['/home/yuh5/Desktop/magicsquare/for_testing/magicsquare', '5'])
<subprocess.Popen object at 0x7f879a9f8f90>
>>>
m =

    17    24     1     8    15
    23     5     7    14    16
     4     6    13    20    22
    10    12    19    21     3
    11    18    25     2     9



FYI:
ceb-cad2 is my Linux server. Omero.server is installed on ceb-cad2. Matlab executable is placed under ~/Desktop/ on ceb-cad2.

1. Do y'all know why I get this error?

2. When I call: "omero script launch...", what group is this executed under? Root? my user account on the Linux machine? or Omero?

Re: OSError: [Errno 13] Permission denied

PostPosted: Thu May 03, 2018 10:20 am
by sbesson
Hi Hang,

the OMERO script should be executed by the owner of the Processor process

Code: Select all
$ ps aux | grep runProcessor.py


What are the ownership and the permissions of your executable file as shown by:

Code: Select all
$ ls -alh /home/yuh5/Desktop/magicsquare/for_testing/magicsquare


Best,
Sebastien

Re: OSError: [Errno 13] Permission denied

PostPosted: Thu May 03, 2018 3:22 pm
by Hang
For each of the two commands, I got the following. The first one I don't quite understand what it's telling me. The second the permissions seems fine to me.

1.
Code: Select all
ps aux | grep runProcessor.py
yuh5      3230  0.0  0.0  14224  1020 pts/1    S+   11:17   0:00 grep --color=auto runProcessor.py
omero     3288  0.0  0.2 1205716 83280 ?       Sl   Apr27   8:13 python lib/python/runProcessor.py --Ice.Config=/home/omero/OMERO.server-5.4.4-ice36-b82/var/master/servers/Processor-0/config/config


2.
Code: Select all
ls -alh /home/yuh5/Desktop/magicsquare/for_testing/magicsquare
-rwxrwxr-x 1 yuh5 yuh5 87K Apr 11 17:22 /home/yuh5/Desktop/magicsquare/for_testing/magicsquare


Hang

Re: OSError: [Errno 13] Permission denied

PostPosted: Fri May 04, 2018 4:30 pm
by sbesson