Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

renv prevents from deploying to RStudio Connect with an uninformative error #943

Closed
audricvigier opened this issue Aug 4, 2023 · 3 comments

Comments

@audricvigier
Copy link

Hi,

I am developing Shiny apps using the golem package, and currently with R 4.2.3 . Before using that R version, I was working with rsconnect 0.16.0 to deploy, but now with 1.0.0 version, which caused the deploys to be impossible because it was using the package renv. My MWE is the Shiny app that is generated upon creating a new golem project, and then executing golem::add_rstudioconnect_file(), and then hitting the blue button to deploy. The deploy worked with R 4.1.2 and rsconnect 0.16.0, but not with R 4.2.3 rsconnect 1.0.0, I had the following error (I blanked out the server name):

-- Preparing for deployment ----------------------------------------------------
v Deploying "reprex" to "server: <server_name> / username: audricvigier"
i Creating application on server...
v Created application with id 257
i Bundling 18 files: '.here', '.Rbuildignore', 'app.R', 'DESCRIPTION', 'dev/01_start.R', 'dev/02_dev.R', 'dev/03_deploy.R', 'dev/config_attachment.yaml', 'dev/run_dev.R', 'inst/app/www/favicon.ico', 'inst/golem-config.yml', 'man/run_app.Rd', 'NAMESPACE', 'R/_disable_autoload.R', 'R/app_config.R', 'R/app_server.R', 'R/app_ui.R', and 'R/run_app.R'
i Capturing R dependencies with renv
- Operation canceled.
Execution halted

I just lost a full day to understand what was causing it, and it turns out it was renv, which was thinking wrongly the Shiny app I was trying to deploy (which is also a package as it is a golem, available locally only at this stage) was coming from CRAN. As suggested here , using options(rsconnect.packrat = TRUE) prior to deploying solved everything. Can you make the error informative to suggest the use of packrat for people working with rsconnect and/or local packages? Or use packrat as the default option, rather than renv?

@hadley
Copy link
Member

hadley commented Aug 4, 2023

We have a fix for this in the dev version of renv, but unfortunately can't submit to CRAN because they are still on vacation.

@audricvigier
Copy link
Author

Thanks, I can confirm the error is very informative in today's dev version (branch main commit 5fb52fe )

@aronatkins
Copy link
Contributor

renv-1.0.1 has been released. Please open a new issue if you continue to have problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants