Dendrobates
Dendrobates

Reputation: 3534

R Shiny "Disconnected from server" works fine locally and on shinyapps.io

I created a Shiny app, using some public data (csv format) and visualize some basic insights in my shiny app. When deploying, the app works fine both locally, and on shinyapps.io, but for some reason fails when deploying on my own ubuntu server, where shiny-server is installed. Other examples, provided by shiny-server work fine.

The UI elements load correctly, but shortly after (like half a second later) the application crashes, showing the generic error "Disconnected from server". The strangest thing to me is that it works fine on shinyapps.io.

Some things that might cause the problem:

  1. I tried to load a .csv file, which I made available in the same directory as the server and UI files.
  2. Packages are installed globally (installed in terminal as sudo user), but might not be accessible for the shiny-server.

The app is available here: https://maartenstolk.shinyapps.io/nbd_biblion/

Any suggestions what might go wrong?

Upvotes: 2

Views: 3228

Answers (1)

pari
pari

Reputation: 808

I had the exact same problem with the ubuntu server. The problem was due to inaccessibility of the packages globally. So i had to reinstall packages again by this command:

sudo su - -c "R -e \"install.packages('packagenme', repos = 'http://cran.rstudio.com/',dependencies =TRUE)\""

and at the end everything was working

Upvotes: 1

Related Questions