rstudio / rsconnect

Publish Shiny Applications, RMarkdown Documents, Jupyter Notebooks, Plumber APIs, and more
http://rstudio.github.io/rsconnect/
131 stars 80 forks source link

Failed deployments when renv.lock is automatically included in deployment bundle #925

Closed kmasiello closed 1 year ago

kmasiello commented 1 year ago

Breaking change with rsconnect v 1.0.

In a renv project with the old faithful Shiny app, the deploy button now includes renv.lock as part of the suggested files in the deployment: image

However the deployment will fail with no helpful errors: image

Removing renv.lock from the bundle results in a successful deployment.

rsconnect v 0.8.29 did not automatically include renv.lock in the deployment, or list it as a possible add-on to the bundle. The new behavior under 1.0 breaks existing deployment patterns for users.

aronatkins commented 1 year ago

This was tracked with https://github.com/rstudio/rsconnect/issues/918 and should be resolved. Could you try installing the latest rsconnect-1.0.1 from CRAN? If that version is not available yet in your mirror due to propagation delay, install from GitHub:

install.packages("rsconnect") # OR
remotes::install_github("rstudio/rsconnect", "v1.0.1")
aronatkins commented 1 year ago

Reopening in case there are parts of #918 that were not solved.

aronatkins commented 1 year ago

Resolved by installing the development version of renv along with the latest rsconnect 1.0.1.:

remotes::install_github("rstudio/renv")
aronatkins commented 1 year ago

Testing notes to confirm that the development version of renv is necessary to avoid the deployment trouble reported here (and in #918).

Project variations. Run these steps in a vanilla RStudio project (not an renv project). Work through file-creation and deployment testing for one project before moving to the next variation.

remotes::install_cran("renv")
remotes::install_version("rsconnect", "1.0.0")
usethis::create_project("~/Desktop/push-rsc-100-renv-100")

remotes::install_cran("renv")
remotes::install_version("rsconnect", "1.0.1")
usethis::create_project("~/Desktop/push-rsc-101-renv-100")

remotes::install_github("rstudio/renv")
remotes::install_version("rsconnect", "1.0.1")
usethis::create_project("~/Desktop/push-rsc-101-renv-head")

remotes::install_github("rstudio/renv")
remotes::install_version("rsconnect", "1.0.0")
usethis::create_project("~/Desktop/push-rsc-100-renv-head")

Within each new project, run these steps to create your content. The "deploy.R" file is included to make sure that renv includes rsconnect in its library (required for the development version of renv).

writeLines(con = "app.R", c(
  "library(shiny)",
  "ui <- fluidPage('hello')",
  "server <- function(input, output) {}",
  "shinyApp(ui, server)"
))
writeLines(con = "deploy.R", c("library(rsconnect)"))
renv::init(repos = "https://cloud.r-project.org")

Once you have created the files for a project an initialized its renv environment, attempt to use push-button deploy.