Publish error in shiny

I am running a simple shiny app

library(shiny)
library(DBI)

ui <- fluidPage( 
  textInput("ID", "Enter your ID:", "5"), 
  tableOutput("tbl") 
)

server <- function(input, output, session) { 
  output$tbl <- renderTable({ 
    conn <- dbConnect( 
      drv = RMySQL::MySQL(), 
      dbname = "shinydemo", 
      host = "shiny-demo.csa7qlmguqrf.us-east-1.rds.amazonaws.com", 
      username = "guest", 
      password = "guest") 
    on.exit(dbDisconnect(conn), add = TRUE) 
    query <- paste0("SELECT * FROM City WHERE ID = '", input$ID, "';") 
    dbGetQuery(conn, query) 
  }) 
}

shinyApp(ui, server)

It works fine locally in RStudio but when i try to publish it , the deployment fails with error :

Listening on http://127.0.0.1:4796
Error in function (type, msg, asError = TRUE)  : 
  SSL certificate problem: unable to get local issuer certificate
Timing stopped at: 0.85 0.22 1.99

Can someone please help

Hi, which application server are you deploying to?

If it's shinyapps.io, you might try the fixes described at SSL certificate problem when deploying to shinyapps.io and let us know if any of them work for you.

Similar issue resolved in a support ticket by bypassing the certificate check:

setwd()
options(rsconnect.check.certificate = FALSE)
rsconnect::deployApp()

This can be caused by outdated CA certificates on the host. Updating the root CA certificates on the OS is another alternative.

2 Likes