Switching between tabs not possible online - r

I wrote a shiny app which works fine on my machine and on my server. Now I migrated the app to another virtual server (running Ubuntu 22.04 LTS). I can access the virtual server via a GUI and when I run the app on that virtual server in Rstudio it works fine. When I access the app (running with free shinyserver) from the internet, I reach the application and can see the dashboard. It actually looks fine, all the links work and so on, but I cannot switch between dashboard tabs. When I click on a tab, the webpage changes from "webpage/" to "webpage/#tab-2470-2" (or some other number behind "#tab-") but nothing happens.
Since the R code and the shiny config on my server (where everything works) and the new virtual server is exactly the same, I presume that the virtual server is missing some packages. It's a fresh installation aside from R, Rstudio, shinyserver, the required dependencies and all updates. The problem is that I do not get any error messages (shiny log directory is empty), so I do not even know where to start troubleshooting.
So I am wondering if anyone experienced the same behaviour or has an idea what I am missing?
Thanks in advance!

Related

Shiny App doesn't work while accessing on remote computer

I am trying to run a ShinyApp via R studio. The R Studio is on my work computer and I am accessing it from my home computer via remote access.
I tried changing the host argument in runApp to "0.0.0.0" (as suggested:here )
and even then all i get is a dark blank screen.
Any help, appreciated.
Thanks to a few colleagues at work, I figured that there could be an issue with accessing the shiny output via R studio in built browser when accessing it remotely.
The workaround which works for me is to open a new browser via
runApp(shinyobject<-shinyApp(ui, server), launch.browser=T)

Error when hosting shiny app on DigitalOcean ubuntu server

I have built a shiny app that I have successfully deployed to shinyapps.io in the past. However, since I need better hosting resources and a custom domain, and the only shinyapps.io option allowing for the latter is out of my price range, I am trying to host the app on a digital ocean ubuntu droplet.
I have been able to set up shiny server on my droplet using this tutorial. The sample apps work just fine. However, when I try to access my own app (having uploaded it into a directory within my shiny server) I get the following error:
An error has occurred! An error has occurred. Check your logs or
contact the app author for clarification.
I've googled for a solution and have tried moving the data cleaning steps from outside the server/ui function into the functions. I have also checked that RStudio on the droplet has all the required packages installed and that seems to be the case. I have checked the logs but there is nothing about this app or the error in the shiny server log. My app works fine both on my local computer and on shinyapps.io. I'd really appreciate any pointers (and apologies if I am duplicating but I haven't found anything that seems directly applicable).
Okay - it turns out one of the packages was indeed missing. I had installed them all using my non-root user with admin privileges, and was under the impression they were available globally. One of the packages was not available to root and installing it there resolved the problem.

RStudio Server immediately freezes and crashes browser after starting

I have an Rstudio Server installation on a Linux Azure VM that seems frozen and also crashes any browser I try to login with.
I have restarted the VM and separately restarted RStudio Server (similarly to the solution in this post) a number of times, but it does not change the behavior. I didn't think I had it set to reload an environment or operation upon restart, but perhaps I accidentally did. The last thing I was doing with the server was a large sparse matrix operation that turned out to be too much for it.
Since the problem occurs immediately after the app loads, I'm not sure how to reset its state. I tried following these instructions but it didn't work:
I renamed ~/.rstudio to ~/.rstudio.backup while RStudio Server was stopped and it was recreated on the next start, but it still resumed in the same state. I saw mentions of ~/.local/share/rstudio/ and ~/.config/rstudio in the support docs, but they do not seem to exist in this Azure Ubuntu installation.
I also moved and renamed the folder of the last used R project, but it had no effect. There is a .config/R/ folder but it only contains a rsconnect folder and 2 empty subfolders.
I finally got it. After shutting down and restarting RStudio Server it was necessary to run this command immediately after RStudio Server loaded:
sudo rstudio-server suspend-all

R - Shiny App : How to host a Shiny App without interruption? If possible on Github or Shiny Server

So my shiny app goes to sleep since it is running locally on my computer, I want people to be able to access it even when my computer is turned off, i.e I want it to be hosted somewhere online so that it can continuously run. Any help would be great

Shiny app on Server: not publish it, only make it run

I am working on an Shiny app in R. My goal is to put in on a server, not on my local pc.
EDIT: my goal is not to publish it on the web, but only make it run on the server locally.
I have installed R on the server, added all the libraries I need, lastly I tried to launch my app that it is quite long, the schema is more or less this:
data preprocessing (with RODBC)
some custom functions
server<- etc.
ui<- etc.
shinyapp(server,ui)
Well in my local pc everything is fine, but on the server I cannot have a result, it is impossible to reach the address.
I decided to do something like this, create the two files called server and ui, and launching them with:
runApp(".../shiny")
Having the idea to use the option of runApp.
Well it is arriving this
ERROR: Error sourcing C:\Users\...\AppData\Local\Temp\Rtmp8YeSOV\file22281c0c2f6d
First of all, this procedure is going to help me?
If so, could you tell me what that error mean?
Thanks in advance.
I'm not sure, but I think it's not possible to reach a shiny app running in a local computer (or server). For that purpose you can use the Shiny Sever, which allow you to put your Shiny apps accessible online.
It seems that your server is a Windows computer, so your options are:
Build Shiny Server from its source code, (maybe a little difficult).
Use a virtual machine like VMware Player (free for non-commercial use) and install Ubuntu or other Linux distribution to use the pre-built binary of Shiny Server. With this option you can restrict the access to only your local network and maybe faster access to your DB's.
Use a DigitalOcean virtual server (for a very reasonable price), in this case you apps will be on the cloud and accesible everywhere.
For option 2 and 3 you can follow the very useful and well written tutorial of Dean Attali about installing and setting up a Shiny Sever. It is for DigitalOcean but is pretty much the same if you decide to use a virtual machine with Linux.
The answer is quite simple, I was using IE as browser: if you use Chrome specifying it on the runApp statement, everything works fine.

Resources