ThinkR-open / golem

A Framework for Building Robust Shiny Apps
https://thinkr-open.github.io/golem/
Other
885 stars 130 forks source link

[BUG] Problem to deploy golem app to shinyapps.io #1098

Closed agronomofiorentini closed 10 months ago

agronomofiorentini commented 10 months ago

Describe the bug Dear creators, I have installed the latest golem version 0.4.1 and i am using rsconnect 1.0.2.

When I went to create a new golem project and tried to upload to shinyapps.io I have the following problem.

── Preparing for deployment ────────────────────────────────────────────────────
✔ Re-deploying "CarbonFarmingMap" to "server: shinyapps.io / username: XXXXXXXXXXXXX"
ℹ Looking up application with id "9669542"...
✔ Found application <https://XXXXXXXXXXXXX.shinyapps.io/CarbonFarmingMap/>
ℹ Bundling 17 files: '.here', '.Rbuildignore', 'app.R', 'DESCRIPTION', 'dev/01_start.R', 'dev/02_dev.R', 'dev/03_deploy.R', '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'
ℹ Capturing R dependencies with renv
The following package(s) were installed from an unknown source:
- CarbonFarmingMap [0.0.0.9000]
renv may be unable to restore these packages in the future.
Consider reinstalling these packages from a known source (e.g. CRAN).

Traceback (most recent calls last):
9: rsconnect::deployApp(appDir = "C:/Users/Utente/Desktop/CarbonFarmingMap", 
       appFileManifest = "C:/Users/Utente/AppData/Local/Temp/9146-57ed-34c1-4af7", 
       account = "automaticfarmsolution", server = "shinyapps.io", 
       appName = "CarbonFarmingMap", appTitle = "CarbonFarmingMap", 
       launch.browser = function(url) {
           message("Deployment completed: ", url)
       }, lint = FALSE, metadata = list(asMultiple = FALSE, asStatic = FALSE))
8: bundleApp(appName = target$appName, appDir = appDir, appFiles = appFiles, 
       appMetadata = appMetadata, quiet = quiet, verbose = verbose, 
       pythonConfig = pythonConfig, image = image)
7: createAppManifest(appDir = bundleDir, appMetadata = appMetadata, 
       users = users, pythonConfig = pythonConfig, retainPackratDirectory = TRUE, 
       image = image, verbose = verbose, quiet = quiet)
6: bundlePackages(bundleDir = appDir, extraPackages = extraPackages, 
       verbose = verbose, quiet = quiet)
5: computePackageDependencies(bundleDir, extraPackages, quiet = quiet, 
       verbose = verbose)
4: snapshotRenvDependencies(bundleDir, extraPackages, verbose = verbose)
3: renv::snapshot(bundleDir, packages = deps$Package, prompt = FALSE)
2: renv_snapshot_validate_report(valid, prompt, force)
1: stop("aborting snapshot due to pre-flight validation failure")
Errore in renv_snapshot_validate_report(valid, prompt, force) : 
  aborting snapshot due to pre-flight validation failure
Chiamate: <Anonymous> ... snapshotRenvDependencies -> <Anonymous> -> renv_snapshot_validate_report
Esecuzione interrotta

session info

Session info ───────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.2.0 (2022-04-22 ucrt)
 os       Windows 10 x64 (build 22621)
 system   x86_64, mingw32
 ui       RStudio
 language (EN)
 collate  Italian_Italy.utf8
 ctype    Italian_Italy.utf8
 tz       Europe/Berlin
 date     2023-08-24
 rstudio  2023.06.0+421 Mountain Hydrangea (desktop)
 pandoc   NA

─ Packages ───────────────────────────────────────────────────────────────────
 package          * version    date (UTC) lib source
 askpass            1.1        2019-01-13 [1] CRAN (R 4.2.0)
 assertthat         0.2.1      2019-03-21 [1] CRAN (R 4.2.0)
 attempt            0.3.1      2020-05-03 [1] CRAN (R 4.2.0)
 cachem             1.0.8      2023-05-01 [1] CRAN (R 4.2.3)
 callr              3.7.3      2022-11-02 [1] CRAN (R 4.2.2)
 CarbonFarmingMap   0.0.0.9000 2023-08-24 [1] local
 cli                3.6.1      2023-03-23 [1] CRAN (R 4.2.3)
 config             0.3.1      2020-12-17 [1] CRAN (R 4.2.0)
 crayon             1.5.2      2022-09-29 [1] CRAN (R 4.2.1)
 curl               5.0.2      2023-08-14 [1] CRAN (R 4.2.3)
 desc               1.4.2      2022-09-08 [1] CRAN (R 4.2.2)
 devtools           2.4.5      2022-10-11 [1] CRAN (R 4.2.2)
 digest             0.6.31     2022-12-11 [1] CRAN (R 4.2.0)
 ellipsis           0.3.2      2021-04-29 [1] CRAN (R 4.2.0)
 fansi              1.0.4      2023-01-22 [1] CRAN (R 4.2.3)
 fastmap            1.1.1      2023-02-24 [1] CRAN (R 4.2.3)
 fs                 1.6.2      2023-04-25 [1] CRAN (R 4.2.3)
 glue               1.6.2      2022-02-24 [1] CRAN (R 4.2.0)
 golem              0.4.1      2023-06-05 [1] CRAN (R 4.2.3)
 htmltools          0.5.5      2023-03-23 [1] CRAN (R 4.2.3)
 htmlwidgets        1.6.2      2023-03-17 [1] CRAN (R 4.2.3)
 httpuv             1.6.11     2023-05-11 [1] CRAN (R 4.2.3)
 httr               1.4.7      2023-08-15 [1] CRAN (R 4.2.3)
 jsonlite           1.8.4      2022-12-06 [1] CRAN (R 4.2.2)
 later              1.3.1      2023-05-02 [1] CRAN (R 4.2.3)
 lifecycle          1.0.3      2022-10-07 [1] CRAN (R 4.2.1)
 magrittr           2.0.3      2022-03-30 [1] CRAN (R 4.2.0)
 memoise            2.0.1      2021-11-26 [1] CRAN (R 4.2.0)
 mime               0.12       2021-09-28 [1] CRAN (R 4.2.0)
 miniUI             0.1.1.1    2018-05-18 [1] CRAN (R 4.2.0)
 openssl            2.0.6      2023-03-09 [1] CRAN (R 4.2.3)
 parsedate          1.3.1      2022-10-27 [1] CRAN (R 4.2.2)
 pillar             1.9.0      2023-03-22 [1] CRAN (R 4.2.0)
 pkgbuild           1.4.2      2023-06-26 [1] CRAN (R 4.2.3)
 pkgconfig          2.0.3      2019-09-22 [1] CRAN (R 4.2.0)
 pkgload            1.3.2.1    2023-07-08 [1] CRAN (R 4.2.3)
 prettyunits        1.1.1      2020-01-24 [1] CRAN (R 4.2.0)
 processx           3.8.2      2023-06-30 [1] CRAN (R 4.2.3)
 profvis            0.3.8      2023-05-02 [1] CRAN (R 4.2.3)
 promises           1.2.1      2023-08-10 [1] CRAN (R 4.2.3)
 ps                 1.7.5      2023-04-18 [1] CRAN (R 4.2.3)
 purrr              1.0.1      2023-01-10 [1] CRAN (R 4.2.3)
 R6                 2.5.1      2021-08-19 [1] CRAN (R 4.2.0)
 rappdirs           0.3.3      2021-01-31 [1] CRAN (R 4.2.0)
 rcmdcheck          1.4.0      2021-09-27 [1] CRAN (R 4.2.0)
 Rcpp               1.0.10     2023-01-22 [1] CRAN (R 4.2.3)
 rematch            1.0.1      2016-04-21 [1] CRAN (R 4.2.0)
 remotes            2.4.2.1    2023-07-18 [1] CRAN (R 4.2.3)
 rhub               1.1.2      2022-08-31 [1] CRAN (R 4.2.2)
 rlang              1.1.1      2023-04-28 [1] CRAN (R 4.2.3)
 rprojroot          2.0.3      2022-04-02 [1] CRAN (R 4.2.0)
 rsconnect          1.0.2      2023-08-17 [1] CRAN (R 4.2.3)
 rstudioapi         0.15.0     2023-07-07 [1] CRAN (R 4.2.3)
 sessioninfo        1.2.2      2021-12-06 [1] CRAN (R 4.2.0)
 shiny              1.7.5      2023-08-12 [1] CRAN (R 4.2.3)
 stringi            1.7.12     2023-01-11 [1] CRAN (R 4.2.2)
 stringr            1.5.0      2022-12-02 [1] CRAN (R 4.2.2)
 tibble             3.2.1      2023-03-20 [1] CRAN (R 4.2.3)
 urlchecker         1.0.1      2021-11-30 [1] CRAN (R 4.2.2)
 usethis            2.2.2      2023-07-06 [1] CRAN (R 4.2.3)
 utf8               1.2.3      2023-01-31 [1] CRAN (R 4.2.3)
 uuid               1.1-1      2023-08-17 [1] CRAN (R 4.2.3)
 vctrs              0.6.2      2023-04-19 [1] CRAN (R 4.2.3)
 whoami             1.3.0      2019-03-19 [1] CRAN (R 4.2.0)
 withr              2.5.0      2022-03-03 [1] CRAN (R 4.2.0)
 xopen              1.0.0      2018-09-17 [1] CRAN (R 4.2.0)
 xtable             1.8-4      2019-04-21 [1] CRAN (R 4.2.0)
 yaml               2.3.7      2023-01-23 [1] CRAN (R 4.2.2)

 [1] C:/Users/Utente/AppData/Local/R/win-library/4.2
 [2] C:/Program Files/R/R-4.2.0/library

──────────────────────────────────────────────────────────────────────────────

Additional context yesterday when i tried to deploy the app instead, rstudio's blue development button told me i had to upgrade all packages which i did and from then on the problem manifested itself. It had never happened before

ilyaZar commented 10 months ago

hi @agronomofiorentini try what is outlined in #1070 as a solution, maybe it works ?

agronomofiorentini commented 10 months ago

Thanks @ilyaZar for the reply.

I will try out and i will let you know if is working.

Thanks again 😃

agronomofiorentini commented 10 months ago

Your suggestion solved the issue.

as suggested here #1070 , we must use:

  1. options(rsconnect.packrat = TRUE)
  2. rsconnect::deployApp("path/to/the/app")

Thanks