hexylena / docker-rstudio-notebook

RStudio as a Galaxy Interactive Environment
MIT License
5 stars 17 forks source link

rstudio `gx_get()` /import Permission Error #24

Closed monprin closed 5 years ago

monprin commented 5 years ago

Hello,

I upgraded to 19.05 today and have been testing the Rstudio GIE running. It actually works flawlessly out of the box with one exception: whenever I try to use gx_get(), I get a permission error like this:

> gx_get(1)
Traceback (most recent call last):
  File "/usr/local/bin/get", line 18, in <module>
    print( get( args.id, args.identifier_type, args.history_id ) )
  File "/usr/local/lib/python2.7/dist-packages/galaxy_ie_helpers/__init__.py", line 139, in get
    dc.download_dataset(datasets[dataset_identifier], file_path=file_path, use_default_filename=False)
  File "/usr/local/lib/python2.7/dist-packages/bioblend/galaxy/datasets/__init__.py", line 128, in download_dataset
    with open(file_local_path, 'wb') as fp:
IOError: [Errno 13] Permission denied: '/import/1'
[1] "/import/1"

When looking at the permissions in the /import, it's easy to see why, everything is owned by root, despite the working user being rstudio, and world write is not allowed. gx_put() does work if I make a file and try to send it to galaxy.

I have Galaxy setup to use an external machine as a container runner and thus have the use_volumes option in the .ini set to false. Jupyter does work well here and is able to do both get and put.

It seems to stem from the Dockerfile defining the /import directory as a volume and those, by default, seem to be owned by root if another pre-made volume is not defined (which I would rather not do for easier maintenance).

I was wondering if you know any workaround to get this to work so we can just use the default configuration and image?

Thanks you!

hexylena commented 5 years ago

Hi @monprin,

Thanks for the detailed bug report. It looks like we can just remove the VOLUME declaration since it isn't used in the jupyter container either. I've pushed a change for this, it should work whenever the container is re-built and re-pulled hopefully.

monprin commented 5 years ago

Hey,

Thanks @erasche for the quick reply to this, but it does look like the Quay build may have failed, per the status icon on the repo info page.

Thanks!

hexylena commented 5 years ago

@monprin looks like it succeeded this time, can you give it a test?

monprin commented 5 years ago

@erasche Updated the image in Galaxy and looks good.

Thank you very much for the help with this, I'm closing the issue!

hexylena commented 5 years ago

Glad we could get it sorted out so easily!

drosofff commented 5 years ago

Dear @erasche I am a bit puzzled when reading this closed issue: I am currently testing the release_19.05 for ie and I am still observing the same error as described by @monprin, which is fixed if I chmod 777 the /import from within the running container.

So the bug was not eventually fixed ?

hexylena commented 5 years ago

Hi @drosofff, a chmod is run and a volume is no longer specified, but volume permissions are changed when things are mounted in? So this is supposed to be fixed, but if it isn't, that's too bad.

If it is not, unfortunately I do not have time to support this branch, due to the changes going on for GIEs in 19.09+ galaxy.

drosofff commented 5 years ago

Hi Elena,

a chmod is run and a volume is no longer specified

Yes I saw this in the Dockerfile... but for obscure reason, yes the permissions are changed in the mounted /import. There is also a problem with the gx_get() function targeting this dir whereas the import file directory for rstudio is actually /home/rstudio/(also with insufficient write permissions).

I do not have time to support this branch, due to the changes going on for GIEs in 19.09+ galaxy

OK, no problem, we can live with that. If I find something, I'll make a PR

Best