shiny app unreachable by shinyloadtest library - r

I am trying to load-test a shiny app on RStudio Connect. The shinyloadtest library claims to be able to load-test shiny apps on Rstudio Connect. I have installed this library and the shinnycannon app/library. I try to run
shinyloadtest::record_session("https://rsconnect-dev.the_rest.io/of/my/url/")
and receive the following error:
Target URL https://rsconnect-dev.the_rest.io/of/my/url/ does not appear to be a Shiny application.
The actual url is different but starts with https://rsconnect-dev. It appears that one of the internal functions ( detect.R) is saying that the url is the incorrect format. Have you found a way to bypass this?

You probably found a solution but for future shinyloadtest users it could help.
Shiny applications hosted on shinyapps.io can't be reached with shinyloadtest package.
Try with this shiny example url = "https://daattali.com/shiny/mimic-google-form/" it should works.

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.

Script using GPU throws error when running app on Shiny server

I have written some code in R using the Shiny package. The app runs alright when running shiny::runApp() from RStudio.
I've tried to host the app on a Shiny server and the GUI starts up correctly. However, a plot should appear on the right when the button "Enviar informacion" is clicked. (You can see how the app looks here, but it won't work though because that link is not on Shiny server but on Shinyapps.io).
The relevant part of the logfile is the following:
Listening on http://127.0.0.1:38327
Loading required package: Rcpp
Warning: Error in [: subscript out of bounds
211: FUN [/srv/shiny-server/spike_sorting/server.R#82]
210: apply
209: cluster_som_h [/srv/shiny-server/spike_sorting/server.R#82]
...
So the error is inside the function cluster_som_h. After trying some stuff, I found out what is causing the error, but don't know how to fix it. Inside this function, I make use of the function Rsomoclu.train() from the package Rsomoclu, with kernelType = 1. This means that the function is run on the GPU. If I set kernelType = 0, then the app works okay with both runApp() and from the Shiny server. So that's where the problem is: for some reason, running the function on the GPU is not working if the app is run from the Shiny server, but it does work if it is run from RStudio using runApp().
Maybe there is something going on because I have CUDA installed on my computer but when I try to run it from the server something happens. Is there a way to fix this? I believe running the code from this specific computer no matter where on the LAN the app is run would solve this. Is this possible?
After doing some (basic) research, I found out what was happening. I have CUDA installed only in my user in Ubuntu, so I had to change the first line of the file /etc/shiny-server/shiny-server.conf so that the user was the right one:
# Instruct Shiny Server to run applications as the user "my_name"
run_as my_name;

Fatal error when deploying a shiny app with Rstudio

I have a shiny app (divided into ui.R, server.R and helpers.R) which works on my local machine. The app does not load any libraries besides library(shiny). I am unable to deploy it to shinyapps.io. That is what I do
I log myself into shinyapps.io (via the website www.shinyapps.io)
I run library(rsconnect) on the R console.
I copy the Tokens code (rsconnect::setAccountInfo...) from the www.shinyapps.io page into the R console and run it.
I run the app in Rstudio (1 warning: Warning in body(fun) : argument is not a function). The app runs as expected.
I use the "publish" button in the app window and get a new window saying: "R session aborted. R encountered a fatal error. The session was terminated"
Sorry, I have no idea about where to look for the error. Can you give me a hint what causes the problem? Which additional information would you need to help me?
Thanks a lot!
update: I just saw that there is a second "publish"-button in Rstudio if you have one of the app-files in the editor (without running it). When I use this one, I get the same crash, but with some more information: unexpected exception: boost::filesystem::unique_path: key is not valid in specified status (sorry, that is my own translation from German).
One way of deploying an app to the shinyapps.io server is not to use the button in RStudio, but to do it via the console. Here the steps that are working for me now (RStudio 1.0.143):
Log in on shinyapps.io (via the website www.shinyapps.io)
Run library(rsconnect) on the R console.
Copy the Tokens code (rsconnect::setAccountInfo...) from the www.shinyapps.io page into the R console and run it.
Run rsconnect::deployApp('path to your app') on the R console.
Pushing the publish button in RStudio still results in a crash of R.

Testing an R application deployed in Shiny Server

I have a shiny app that works locally even as a shiny app. However when I deploy it in a Shiny Server(free) running on RedHat 5 within my organization, there are strange issues with gsub. To debug this, I would like to see the data at different instances in the shiny code. So, is there something like console.log as in javascript?
I checked the documentations like the one here http://shiny.rstudio.com/articles/debugging.html, but they talk only about a shiny app running within RStudio which is not my case.
Note:
1. The code that I want to use is not within the server function of the shiny app.
2. I cannot install new packages, because of IT restrictions
3. I don't have access to shiny server logs
Hope the question is clear.

Resources