Rstudio and shiny server connection problems ( refused to connect)

April 16, 2016 3.4k views
Getting Started

I have set up Rstudio and shiny servers. Both seemed to be working OK (the demo apps work and I can log into & use Rstudio from a browser). But now I have two (possibly related?) problems:

  1. In Rstudio, I get this error " refused to connect" whenever I try to run a Shiny app or even try to open a help page. (e.g. ?runApp, or ?mean).

  2. I copied an existing shiny app to /srv/shiny-server/. It worked fine at first, but after I made some changes (on a local version of R) and replaced the files on the server, I get this error when trying to launch the app:

An error has occurred
The application failed to start.
The application exited during initialization.

Warning in readLines(file, warn = FALSE) :
cannot open file '/srv/shiny-server/SMP_shinyapp/global.R': Permission denied
Error in readLines(file, warn = FALSE) : cannot open the connection
Calls: runApp -> <Anonymous> -> sourceUTF8 -> readUTF8 -> readLines
Execution halted

I am very new to using servers, ubuntu etc. I got as far as I did by following tutorials and googling stuff, but now I am completely stuck. Any advice would be greatly appreciated!

1 Answer

There is probably a mismatch in ownership. /srv/shiny-server is owned by root, when you copied the files the system retained your owner.

Have another answer? Share your knowledge.