I'm running a R shiny application on an open source shiny-server, using Ubuntu and NGINX. However, my app keeps getting the message "Disconnected from the Server" for some reason and I can't seem to get it to work. The shiny app runs perfectly fine on my local.
I've tried the javascript workaround via the following suggestion in Shiny server session time out doesn't work, but it still doesn't seem to work.
Also tried to set app_idle_timeout and app_init_timeout to a longer duration, but to no avail.
This is my nginx config file:
server {
listen 80;
listen [::]:80;
listen 443 ssl;
server_name some_ip_address;
location / {
proxy_pass http://localhost:3838/;
proxy_redirect http://localhost:3838/ $scheme://$host/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_read_timeout 20d;
}
}
Was wondering if I editing shiny server or nginx config file to make this work? But I understand that it is only possible to extend the timeout in the pro version but I'm guessing there must be some workaround possible.
The "Disconnected from Server" error is a generic message that means that the R session has shut down for some reason. This could happen for a multitude of reasons, ranging from missing objects, to data that takes too long to load, to the use of forbidden packages, to hitting the application timeout settings.
You might be eager to deploy your Shiny app to a remote server. But the simplest way to run a Shiny app is to run it locally. You only need the shiny R package installed, and you can run the app in your browser. In this post you'll see a few ways of how to organize your files to be served locally.
You can disable application idle timeouts in Shiny Server (open source or Pro) by setting app_idle_timeout
to 0 in your Shiny Server config file.
For example,
location / {
app_idle_timeout 0;
}
https://docs.rstudio.com/shiny-server/#application-timeouts
app_idle_timeout -- Defines the amount of time (in seconds) an R process with no active connections should remain open. After the last connection disconnects from an R process, this timer will start and, after the specified number of seconds, if no new connections have been created, the R process will be killed. The default value for app_idle_timeout is 5 seconds.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With