Oserror: [errno 13] permission denied - pb-dyim/SMRT-Analysis GitHub Wiki

In some cases you may see something similar to the following error where it is having problems loading the multiprocessing python module:

[ERROR] 2013-06-12 02:02:35,744 [pbpy.smrtpipe.engine.SmrtPipeTasks run 660] > self._workQueue = multiprocessing.Queue(options.queueSize)
[ERROR] 2013-06-12 02:02:35,744 [pbpy.smrtpipe.engine.SmrtPipeTasks run 660] > File "/opt/smrtanalysis/redist/python2.7/lib/python2.7/multiprocessing/__init__.py", line 218, in Queue
[ERROR] 2013-06-12 02:02:35,744 [pbpy.smrtpipe.engine.SmrtPipeTasks run 660] > return Queue(maxsize)
[ERROR] 2013-06-12 02:02:35,744 [pbpy.smrtpipe.engine.SmrtPipeTasks run 660] > File "/opt/smrtanalysis/redist/python2.7/lib/python2.7/multiprocessing/queues.py", line 63, in __init__
[ERROR] 2013-06-12 02:02:35,744 [pbpy.smrtpipe.engine.SmrtPipeTasks run 660] > self._rlock = Lock()
[ERROR] 2013-06-12 02:02:35,744 [pbpy.smrtpipe.engine.SmrtPipeTasks run 660] > File "/opt/smrtanalysis/redist/python2.7/lib/python2.7/multiprocessing/synchronize.py", line 147, in __init__
[ERROR] 2013-06-12 02:02:35,745 [pbpy.smrtpipe.engine.SmrtPipeTasks run 660] > SemLock.__init__(self, SEMAPHORE, 1, 1)
[ERROR] 2013-06-12 02:02:35,745 [pbpy.smrtpipe.engine.SmrtPipeTasks run 660] > File "/opt/smrtanalysis/redist/python2.7/lib/python2.7/multiprocessing/synchronize.py", line 75, in __init__
[ERROR] 2013-06-12 02:02:35,745 [pbpy.smrtpipe.engine.SmrtPipeTasks run 660] > sl = self._semlock = _multiprocessing.SemLock(kind, value, maxvalue)
[ERROR] 2013-06-12 02:02:35,745 [pbpy.smrtpipe.engine.SmrtPipeTasks run 660] > OSError: [Errno 13] Permission denied
[ERROR] 2013-06-12 02:02:35,745 [pbpy.smrtpipe.engine.SmrtPipeTasks run 660] > /bin/sh: module: line 1: syntax error: unexpected end of file
[ERROR] 2013-06-12 02:02:35,745 [pbpy.smrtpipe.engine.SmrtPipeTasks run 660] > /bin/sh: error importing function definition for `module'
[ERROR] 2013-06-12 02:02:35,745 [pbpy.smrtpipe.engine.SmrtPipeTasks run 660] > Your job 8035017 ("Gcal016516") has been submitted
[ERROR] 2013-06-12 02:02:35,745 [pbpy.smrtpipe.engine.SmrtPipeTasks run 660] > Job 8035017 exited with exit code 1.

This might be because shared memory permissions might not be configured correctly. If the permissions for the /dev/shm directory isn't correct, you will see the above error. The permissions should look like the following:

# ls -ld /dev/shm
drwxrwxrwt 2 root root 40 May 30 09:46 /dev/shm

To make it permanent, modify your /etc/fstab

...
none   /dev/shm   tmpfs   rw,nosuid,nodev,noexec   0   0
...
# If you don't want to reboot to apply these changes:
sudo mount /dev/shm

Verify that all compute nodes also have the correct permissions for the /dev/shm directory.