Trouble writing files on shiny-server

7.877 Aufrufe
Direkt zur ersten ungelesenen Nachricht

bkj...@gmail.com

ungelesen,
18.06.2013, 20:02:0718.06.13
an shiny-...@googlegroups.com
I'm running shiny server on EC2 in Ubuntu.  The app starts up normally, but if I try to use write.csv to write a file to /var/shiny-server/www/, I get the following error message:

Listening on port 38308 Warning in file(file, ifelse(append, "a", "w")) : cannot open file '/var/shiny-server/www/shiny_test/time.csv': Permission denied Error in file(file, ifelse(append, "a", "w")) : cannot open the connection

I don't know much about setting up servers, so this may be a relatively simple fix regarding permissions. I saw on another thread that I might have to make the server "root", but I don't know how to do that. Does anyone have any idea as to what I'm doing wrong?

FYI I followed the step-by-step installation instructions on the shiny-server page, so everything is (hopefully) set up as you would expect.

Thanks,
Ben

Joe Cheng

ungelesen,
19.06.2013, 00:30:5119.06.13
an shiny-...@googlegroups.com
This is the correct default behavior; you generally want your R process to be running under a fairly restricted set of permissions, in case there is a security hole in your code (or in Shiny) an attacker won't be able to modify anything. However, if you do need to make modifications then you can change the config to allow that.

In this case, I'd create a subdirectory of your app dir (shiny_test) for the "shiny" user to write to:

# Create the directory
sudo mkdir /var/shiny-server/www/shiny_test/work
# Make shiny the owner of the directory
sudo chown shiny:shiny /var/shiny-server/www/shiny_test/work

Then change the path you pass to write.csv to be "work/time.csv" instead of "time.csv".




--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

bkj...@gmail.com

ungelesen,
19.06.2013, 08:50:4319.06.13
an shiny-...@googlegroups.com
OK - I'll try this later today and let you know if I have further problems.  Sounds like it will work though.


Thanks a lot for your help

Nestor Montaño

ungelesen,
21.06.2013, 18:40:4221.06.13
an shiny-...@googlegroups.com
It works for me!

Thanks

Yoni Sidi

ungelesen,
28.03.2016, 15:57:4628.03.16
an Shiny - Web Framework for R
Hi 

I tried this now and it didnt work. Has the server settings changed since the this post? how to i write to disk on the server during the running of the application?

thanks

yoni

Joe Cheng

ungelesen,
29.03.2016, 10:04:0229.03.16
an Yoni Sidi, Shiny - Web Framework for R
No, nothing should've changed--what error are you seeing?

Hána František

ungelesen,
29.03.2017, 04:17:0529.03.17
an Shiny - Web Framework for R, yon...@gmail.com
Hi,
I have same problem with Docker (Rocker/shiny). For beter reproduction of this problem I create small app https://gist.github.com/sinacek/1e298396de11ea5277d94c99460be0c9 and tried run it in docker image https://hub.docker.com/r/rocker/shiny/ .
 
Thanks for help
Frantisek

Dne úterý 29. března 2016 16:04:02 UTC+2 Joe Cheng [RStudio] napsal(a):
Die Nachricht wurde gelöscht
Die Nachricht wurde gelöscht

Vivek Jayabalan

ungelesen,
30.07.2017, 05:37:1830.07.17
an Shiny - Web Framework for R
Oh this brilliantly worked for me. However, I am a linux scrub. Wondering if you can modify this "sudo chown shiny:shiny /var/shiny-server/www/shiny_test/work" so that I can also edit the file?
Context: I update the file manually from an SQL Query Weekly, and I need responses from Shiny over the week

Tom Bowling

ungelesen,
08.10.2018, 07:39:5708.10.18
an Shiny - Web Framework for R
I'm running in to this issue trying to save files to a folder called temp within my shiny app. I'm really new to using linux, so I could be missing something really obvious, but when I try

sudo chown shiny:shiny /srv/shiny-server/apps/SensoryApp/temp
I get
chown: invalid user: ‘shiny:shiny’

Is there an easy way to work out what i need to change to get this to work?

Tom Bowling

ungelesen,
08.10.2018, 11:30:2408.10.18
an Shiny - Web Framework for R
As an update, I was running the shiny-server within a docker container, I had to create the shiny user on the linux VM - then change the permissions as per the "sudo chown" - then needed to get the container to mirror these permissions
Allen antworten
Antwort an Autor
Weiterleiten
0 neue Nachrichten