OHDSI Home | Forums | Wiki | Github

Cannot publish PLE shiny apps

Dear all,
I am trying to publish a PLE shiny app based on a PLE study I run in Atlas, so my colleagues can open the shiny interface by a link rather than getting into Rstudio. The PLE shiny app works fine when I run “launchEvidenceExplorer(dataFolder = dataFolder, blind = TRUE, launch.browser = FALSE)”, but it always shows me an error when I try to publish it. The error is:

An error has occurred

The application failed to start: exited unexpectedly with code 1

Error in value[[3L]](cond) : object 'shinySettings' not found Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous> Execution halted

I checked the ui.R and the server.R. There is no object ‘shinySettings’ in either one. So, I copied the following codes to the ui.R and the server.R.

appDir ← system.file(“shiny”, “EvidenceExplorer”, package = “EstimationAnalysis.lbu5pamg”)
.GlobalEnv$shinySettings ← list(dataFolder = dataFolder, blind = blind)
on.exit(rm(shinySettings, envir=.GlobalEnv))

shinySettings object shows in the Rstudio environment, but I still get the error message below.

An error has occurred

The application failed to start (exited with code 1).

2021/05/12 14:36:40.497098488 Using Packrat dir /opt/rstudio-connect/mnt/app/packrat/lib/x86_64-pc-linux-gnu/4.0.2 2021/05/12 14:36:42.382100628 Error in value[[3L]](cond) : object 'shinySettings' not found 2021/05/12 14:36:42.382108850 Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous> 2021/05/12 14:36:42.382150011 Execution halted

Any ideas? Appreciate your help in advance.

I figured out how to make it work. The shinySettings need to be added to the global.R. Moreover, some other objects have to be copied under the EvidenceExplorer folder. Thank Denys Kaduk for his help.

Hi,

I am experiencing the same error. Do you remember which objects you needed to copy into the Evidence Explorer folder?

Thanks,
Christina

To publish the Shiny app:

  1. Copy the content of inst/shiny/EvidenceExplorer to your Shiny server
  2. Uncomment this line, maybe changing the dataFolder simply to ‘data’: https://github.com/OHDSI/SkeletonComparativeEffectStudy/blob/main/inst/shiny/EvidenceExplorer/global.R#L4
  3. Copy the files in the shinyData folder to your Shiny server, to the folder indicated in 2

Thank you! In the end I also added the line library(EmpiricalCalibration) to the global.r file in order to get it to run.

It is running smoothly now :slight_smile:

t