a2iEditing / RNAEditingIndexer

A tool for the calculation of RNA-editing index for RNA seq data
Other
35 stars 18 forks source link

permission error - used docker run #17

Open soundharramsay opened 4 years ago

soundharramsay commented 4 years ago

~/software/RNAEditingIndexer$ docker run -u $(id -u ${gplab}):$(id -g ${gplab}) -v /the_path/to_your_bams:/home/gplab/software/RNAEditingIndexer/Aligned.out_sort.bam:ro -v /the_path/to_your_output_dir:/home/gplab/software/RNAEditingIndexer/result:rw your_docker_rep_name/a_name_such_as_a2i_editing_index:a_tag RNAEditingIndex -d /home/gplab/software/RNAEditingIndexer/ -l /home/gplab/software/RNAEditingIndexer/result -o /home/gplab/software/RNAEditingIndexer/result
-os /home/gplab/software/RNAEditingIndexer/result --genome mm10 Traceback (most recent call last): File "Tools/EditingIndex/A2IEditingIndex.py", line 1341, in File "Tools/EditingIndex/A2IEditingIndex.py", line 1069, in main File "Commons/general_functions.py", line 116, in init_logging_dict File "logging/init.py", line 1554, in basicConfig File "logging/init.py", line 920, in init File "logging/init.py", line 950, in _open IOError: [Errno 13] Permission denied: '/home/gplab/software/RNAEditingIndexer/result/EditingIndex.2020-04-05T09:49:07.639199.log' [6] Failed to execute script A2IEditingIndex

mcarrara-bioinfo commented 4 years ago

I have exactly the same problem, exactly with the same syntax and I hope this will be solved. After some search I can provide a few pointers:

I am out of ideas. Can anyone shed some light on this error?

guilhermetabordaribas commented 4 years ago

~/software/RNAEditingIndexer$ docker run -u $(id -u ${gplab}):$(id -g ${gplab}) -v /the_path/to_your_bams:/home/gplab/software/RNAEditingIndexer/Aligned.out_sort.bam:ro -v /the_path/to_your_output_dir:/home/gplab/software/RNAEditingIndexer/result:rw your_docker_rep_name/a_name_such_as_a2i_editing_index:a_tag RNAEditingIndex -d /home/gplab/software/RNAEditingIndexer/ -l /home/gplab/software/RNAEditingIndexer/result -o /home/gplab/software/RNAEditingIndexer/result -os /home/gplab/software/RNAEditingIndexer/result --genome mm10 Traceback (most recent call last): File "Tools/EditingIndex/A2IEditingIndex.py", line 1341, in File "Tools/EditingIndex/A2IEditingIndex.py", line 1069, in main File "Commons/general_functions.py", line 116, in init_logging_dict File "logging/init.py", line 1554, in basicConfig File "logging/init.py", line 920, in init File "logging/init.py", line 950, in _open IOError: [Errno 13] Permission denied: '/home/gplab/software/RNAEditingIndexer/result/EditingIndex.2020-04-05T09:49:07.639199.log' [6] Failed to execute script A2IEditingIndex

Hello dear, soundharramsay

I'm using docker version 19.03.12 and ubuntu 18.04. I ran it successfully using "--user root" instead of " -u $(id -u ${gplab}):$(id -g ${gplab})". Unfortunately i don't know why, but it works. I also used /data directory instead /home.

mcarrara-bioinfo commented 4 years ago

Hello guilhermetabordaribas,

Thank you for the answer. Using the root user works because the privileges are transferred from guest to host directly, when writing on the host folder.

The practice of running a container as root is highly discouraged for this reason, because you can damage the host folders or open a path for an attacker based on guest escape and privilege escalation.

Based on my tests, this behavior can be easily solved by changing the software so that it does not require root privileges to run. Right now the scripts work on files and folders that have either specific group permissions or root-only access.

The solution is to change the scripts so that they read and write files and folders accessible to anyone (+rwx for other).

I tried to do this myself, in order to fork and release, but handling permission in containers is not my thing and, if I'm not mistaken, an inner script works inside a guest system folder, making the effort quite useless again for safety concerns (and for the fact that I don't have the time to review the whole code hoping to find the culprit)