rstudio / shinyapps-package-dependencies

Collection of bash scripts that install R package system dependencies
https://www.shinyapps.io/
Other
79 stars 56 forks source link

Trouble Hosting RSelenium on shinyapps.io #367

Closed saleforecast1 closed 10 months ago

saleforecast1 commented 10 months ago

Hey amazing community!

I hope you're all doing great. 🌟 I'm currently facing a bit of a roadblock with hosting RSelenium on shinyapps.io, and I'm reaching out to the brilliant minds here for some guidance.

The Challenge:

I've been working on a Shiny app that involves RSelenium for some web scraping magic. Locally, everything is smooth sailing, but when I try to host it on shinyapps.io, I encounter a pesky error that's causing a bit of a headache.

The Error:

Quarto not found.
[2023-12-03T09:48:08.811850540+0000] Execute script: packages/build/RSelenium.sh
+ set -e
+ apt-get update -qq
W: http://cran.rstudio.com/bin/linux/ubuntu/jammy-cran40/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
+ DEBIAN_FRONTEND=noninteractive
+ apt-get install -y libssl-dev phantomjs
Reading package lists...
Building dependency tree...
Reading state information...
Package phantomjs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'phantomjs' has no installation candidate## End Task Log ################################################################
Error: Unhandled Exception: Child Task 1361911030 failed: Error building image: Build exited with non-zero status: 100
Execution halted

Shiny Code:

library(shiny)
library(wdman)
library(RSelenium)
library(httr)    
library(netstat)

ui <- fluidPage(
  actionButton("btn", "Click Me!"),
  textOutput("txt"),
)

server <- function(input, output, session) {
  observeEvent(input$btn, {
    #connect chrome driver
    client_server <- rsDriver(
      browser = "chrome",
      chromever = "119.0.5735.90",
      verbose = FALSE,
      port = free_port(),
    )

    # connect remote driver to client
    remDr <- client_server$client
    remDr$navigate("http://www.google.com")
    remDr$maxWindowSize()
    title <- remDr$getTitle()
    output$txt <- renderText(as.character(title))
    # clean up
    remDr$quit()
  })
}

shinyApp(ui, server)

What I've Tried:

My Ask:

If anyone has faced a similar challenge or has experience with hosting RSelenium on shinyapps.io, your insights would be a game-changer! πŸš€

How You Can Help:

I'm open to any suggestions that could help me overcome this hurdle and make this project a success. Your expertise and support are immensely appreciated! πŸ™Œ

Thank you in advance for being an awesome community. Let's crack this code together!

Happy coding,

SaleForecast

stevenolen commented 10 months ago

Thanks for your patience, #368 has now been deployed and should enable RSelenium to be installed in shinyapps.io applications again!