chrome fails when trying to download generated reports from shiny app on posit connect cloud

Hello,

I have written a shiny app that generates a report from an Rmarkdown file using inputs form the user, and outputs an html file that displays in the app. There is also a 'download report' button that should allow the user to download a .pdf version of the report. However, when the deployed to Posit Connect Cloud, if the user attempts to download the report it starts and then fails because chrome cannot create the 'sandbox'. The specific error from the log files are:

! Failed to start chrome. Chrome is available on your system, so this error may be a configuration issue. Try `chromote_info()` to check and verify your settings. 
2026-09-17T14:07:19-06:00 Log file: /tmp/Rtmpf8ziUa/chrome-2fe289f56a2-stderr.log
2026-09-17T14:07:19-06:00 Error:
2026-09-17T14:07:19-06:00 [1001:1001:0917/200719.404881:FATAL:content/browser/zygote_host/zygote_host_impl_linux.cc:129] No usable sandbox! If you are running on Ubuntu 23.10+ or another Linux distro that has disabled unprivileged user namespaces with AppArmor, see https://chromium.googlesource.com/chromium/src/+/main/docs/security/apparmor-userns-restrictions.md. Otherwise see https://chromium.googlesource.com/chromium/src/+/main/docs/linux/suid_sandbox_development.md for more information on developing with the (older) SUID sandbox. If you want to live dangerously and need an immediate workaround, you can try using --no-sandbox.
2026-09-17T14:07:19-06:00 [0917/200719.409521:ERROR:third_party/crashpad/crashp [... truncated]

I have worked through potential fixes suing chatGPT and Gemini suggestions, most of which attempt to change the chrome settings to include "--no-sandbox", but nothing has worked. It works fine on a local computer though. Any help on this issue would be a lifesaver!
Code to reproduce the issue is below:

library(shiny)
library(webshot2)
library(htmltools)

ui <- fluidPage(
titlePanel("Convert renderUI to PDF via webshot2"),

uiOutput("myHTMLReport"),

hr(),
downloadButton("downloadPdf", "Download as PDF")
)

server <- function(input, output, session) {

report_content <- reactive({
tagList(
h1("Dynamic Report Layout"),
p("This layout is captured via headless Chrome and outputted directly to PDF."),
tags$ul(
tags$li("Item 1"),
tags$li("Item 2")
)
)
})

output$myHTMLReport <- renderUI({
report_content()
})

output$downloadPdf <- downloadHandler(
filename = function() {
paste0("report-webshot-", Sys.Date(), ".pdf")
},
content = function(file) {

temp_html <- tempfile(fileext = ".html")

htmltools::save_html(report_content(), temp_html)

webshot2::webshot(
url = temp_html,
file = file,
vwidth = 800, # Set view width in pixels
vheight = 1100 # Set view height in pixels
)
}

)
}

shinyApp(ui, server)

Are you on a free plan? You need a paid plan to run chromote see e.g. How to set up`CHROMOTE_CHROME` environment variable to the executable of a Chromium-based browser in Posit Connect Cloud

I was not aware of that. Thank you so much for the information!