stan-dev / stan-dev/rstanarm

Unable to publish a Shiny App with rstanarm

Open
#573 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
401
Forks
136
PR merge metrics
No merged PRs in 30d

Description

Summary:

Whenever I try to deploy a Shiny app with {rstanarm}, it won't publish. It will take a lot of time deploying until it eventually times out. The app works perfectly as intended when running locally.
When deploying, the app will get stuck in this point

Preparing to deploy document...DONE
Uploading bundle for document: 6908182...DONE
Deploying bundle: 6263558 for document: 6908182 ...
Waiting for task: 1214426410
  building: Processing bundle: 6263558
  building: Parsing manifest
  building: Building image: 7300316
  building: Installing system dependencies
  building: Fetching packages
  building: Building package: rstanarm

for a very long time before printing a giant wall of text and, finally, the error message.

Description:

The error I get when deploying ends as follows:

[2022-09-02T17:28:44.241024278+0000] Installing R package: lme4 (1.1-30)
* installing to library '/opt/R/4.2.1/lib/R/library'
* installing *binary* package 'lme4' ...
* DONE (lme4)
[2022-09-02T17:28:45.483821008+0000] Building R package: rstanarm (2.21.3)
/mnt/packages/build /mnt
"/opt/R/4.2.1/lib/R/bin/Rscript" -e "source(file.path('..', 'tools', 'make_cc.R')); make_cc(commandArgs(TRUE))" stan_files/lm.stan
g++ -std=gnu++14 -I"/opt/R/4.2.1/lib/R/include" -DNDEBUG -I"../inst/include" -I"/opt/R/4.2.1/lib/R/library/StanHeaders/include/src" -DBOOST_DISABLE_ASSERTS -DEIGEN_NO_DEBUG -I'/opt/R/4.2.1/lib/R/library/StanHeaders/include' -I'/opt/R/4.2.1/lib/R/library/rstan/include' -I'/opt/R/4.2.1/lib/R/library/BH/include' -I'/opt/R/4.2.1/lib/R/library/Rcpp/include' -I'/opt/R/4.2.1/lib/R/library/RcppEigen/include' -I'/opt/R/4.2.1/lib/R/library/RcppParallel/include' -I/usr/local/include  `"/opt/R/4.2.1/lib/R/bin/Rscript" -e "RcppParallel::CxxFlags()"` `"/opt/R/4.2.1/lib/R/bin/Rscript" -e "StanHeaders:::CxxFlags()"` -fpic  -g -O2  -c stan_files/lm.cc -o stan_files/lm.o
"/opt/R/4.2.1/lib/R/bin/Rscript" -e "source(file.path('..', 'tools', 'make_cc.R')); make_cc(commandArgs(TRUE))" stan_files/mvmer.stan
g++ -std=gnu++14 -I"/opt/R/4.2.1/lib/R/include" -DNDEBUG -I"../inst/include" -I"/opt/R/4.2.1/lib/R/library/StanHeaders/include/src" -DBOOST_DISABLE_ASSERTS -DEIGEN_NO_DEBUG -I'/opt/R/4.2.1/lib/R/library/StanHeaders/include' -I'/opt/R/4.2.1/lib/R/library/rstan/include' -I'/opt/R/4.2.1/lib/R/library/BH/include' -I'/opt/R/4.2.1/lib/R/library/Rcpp/include' -I'/opt/R/4.2.1/lib/R/library/RcppEigen/include' -I'/opt/R/4.2.1/lib/R/library/RcppParallel/include' -I/usr/local/include  `"/opt/R/4.2.1/lib/R/bin/Rscript" -e "RcppParallel::CxxFlags()"` `"/opt/R/4.2.1/lib/R/bin/Rscript" -e "StanHeaders:::CxxFlags()"` -fpic  -g -O2  -c stan_files/mvmer.cc -o stan_files/mvmer.o
"/opt/R/4.2.1/lib/R/bin/Rscript" -e "source(file.path('..', 'tools', 'make_cc.R')); make_cc(commandArgs(TRUE))" stan_files/binomial.stan
g++ -std=gnu++14 -I"/opt/R/4.2.1/lib/R/include" -DNDEBUG -I"../inst/include" -I"/opt/R/4.2.1/lib/R/library/StanHeaders/include/src" -DBOOST_DISABLE_ASSERTS -DEIGEN_NO_DEBUG -I'/opt/R/4.2.1/lib/R/library/StanHeaders/include' -I'/opt/R/4.2.1/lib/R/library/rstan/include' -I'/opt/R/4.2.1/lib/R/library/BH/include' -I'/opt/R/4.2.1/lib/R/library/Rcpp/include' -I'/opt/R/4.2.1/lib/R/library/RcppEigen/include' -I'/opt/R/4.2.1/lib/R/library/RcppParallel/include' -I/usr/local/include  `"/opt/R/4.2.1/lib/R/bin/Rscript" -e "RcppParallel::CxxFlags()"` `"/opt/R/4.2.1/lib/R/bin/Rscript" -e "StanHeaders:::CxxFlags()"` -fpic  -g -O2  -c stan_files/binomial.cc -o stan_files/binomial.o
"/opt/R/4.2.1/lib/R/bin/Rscript" -e "source(file.path('..', 'tools', 'make_cc.R')); make_cc(commandArgs(TRUE))" stan_files/count.stan
g++ -std=gnu++14 -I"/opt/R/4.2.1/lib/R/include" -DNDEBUG -I"../inst/include" -I"/opt/R/4.2.1/lib/R/library/StanHeaders/include/src" -DBOOST_DISABLE_ASSERTS -DEIGEN_NO_DEBUG -I'/opt/R/4.2.1/lib/R/library/StanHeaders/include' -I'/opt/R/4.2.1/lib/R/library/rstan/include' -I'/opt/R/4.2.1/lib/R/library/BH/include' -I'/opt/R/4.2.1/lib/R/library/Rcpp/include' -I'/opt/R/4.2.1/lib/R/library/RcppEigen/include' -I'/opt/R/4.2.1/lib/R/library/RcppParallel/include' -I/usr/local/include  `"/opt/R/4.2.1/lib/R/bin/Rscript" -e "RcppParallel::CxxFlags()"` `"/opt/R/4.2.1/lib/R/bin/Rscript" -e "StanHeaders:::CxxFlags()"` -fpic  -g -O2  -c stan_files/count.cc -o stan_files/count.o
"/opt/R/4.2.1/lib/R/bin/Rscript" -e "source(file.path('..', 'tools', 'make_cc.R')); make_cc(commandArgs(TRUE))" stan_files/jm.stan
g++ -std=gnu++14 -I"/opt/R/4.2.1/lib/R/include" -DNDEBUG -I"../inst/include" -I"/opt/R/4.2.1/lib/R/library/StanHeaders/include/src" -DBOOST_DISABLE_ASSERTS -DEIGEN_NO_DEBUG -I'/opt/R/4.2.1/lib/R/library/StanHeaders/include' -I'/opt/R/4.2.1/lib/R/library/rstan/include' -I'/opt/R/4.2.1/lib/R/library/BH/include' -I'/opt/R/4.2.1/lib/R/library/Rcpp/include' -I'/opt/R/4.2.1/lib/R/library/RcppEigen/include' -I'/opt/R/4.2.1/lib/R/library/RcppParallel/include' -I/usr/local/include  `"/opt/R/4.2.1/lib/R/bin/Rscript" -e "RcppParallel::CxxFlags()"` `"/opt/R/4.2.1/lib/R/bin/Rscript" -e "StanHeaders:::CxxFlags()"` -fpic  -g -O2  -c stan_files/jm.cc -o stan_files/jm.o
"/opt/R/4.2.1/lib/R/bin/Rscript" -e "source(file.path('..', 'tools', 'make_cc.R')); make_cc(commandArgs(TRUE))" stan_files/bernoulli.stan
g++ -std=gnu++14 -I"/opt/R/4.2.1/lib/R/include" -DNDEBUG -I"../inst/include" -I"/opt/R/4.2.1/lib/R/library/StanHeaders/include/src" -DBOOST_DISABLE_ASSERTS -DEIGEN_NO_DEBUG -I'/opt/R/4.2.1/lib/R/library/StanHeaders/include' -I'/opt/R/4.2.1/lib/R/library/rstan/include' -I'/opt/R/4.2.1/lib/R/library/BH/include' -I'/opt/R/4.2.1/lib/R/library/Rcpp/include' -I'/opt/R/4.2.1/lib/R/library/RcppEigen/include' -I'/opt/R/4.2.1/lib/R/library/RcppParallel/include' -I/usr/local/include  `"/opt/R/4.2.1/lib/R/bin/Rscript" -e "RcppParallel::CxxFlags()"` `"/opt/R/4.2.1/lib/R/bin/Rscript" -e "StanHeaders:::CxxFlags()"` -fpic  -g -O2  -c stan_files/bernoulli.cc -o stan_files/bernoulli.o
"/opt/R/4.2.1/lib/R/bin/Rscript" -e "source(file.path('..', 'tools', 'make_cc.R')); make_cc(commandArgs(TRUE))" stan_files/polr.stan
g++ -std=gnu++14 -I"/opt/R/4.2.1/lib/R/include" -DNDEBUG -I"../inst/include" -I"/opt/R/4.2.1/lib/R/library/StanHeaders/include/src" -DBOOST_DISABLE_ASSERTS -DEIGEN_NO_DEBUG -I'/opt/R/4.2.1/lib/R/library/StanHeaders/include' -I'/opt/R/4.2.1/lib/R/library/rstan/include' -I'/opt/R/4.2.1/lib/R/library/BH/include' -I'/opt/R/4.2.1/lib/R/library/Rcpp/include' -I'/opt/R/4.2.1/lib/R/library/RcppEigen/include' -I'/opt/R/4.2.1/lib/R/library/RcppParallel/include' -I/usr/local/include  `"/opt/R/4.2.1/lib/R/bin/Rscript" -e "RcppParallel::CxxFlags()"` `"/opt/R/4.2.1/lib/R/bin/Rscript" -e "StanHeaders:::CxxFlags()"` -fpic  -g -O2  -c stan_files/polr.cc -o stan_files/polr.o
"/opt/R/4.2.1/lib/R/bin/Rscript" -e "source(file.path('..', 'tools', 'make_cc.R')); make_cc(commandArgs(TRUE))" stan_files/continuous.stan
g++ -std=gnu++14 -I"/opt/R/4.2.1/lib/R/include" -DNDEBUG -I"../inst/include" -I"/opt/R/4.2.1/lib/R/library/StanHeaders/include/src" -DBOOST_DISABLE_ASSERTS -DEIGEN_NO_DEBUG -I'/opt/R/4.2.1/lib/R/library/StanHeaders/include' -I'/opt/R/4.2.1/lib/R/library/rstan/include' -I'/opt/R/4.2.1/lib/R/library/BH/include' -I'/opt/R/4.2.1/lib/R/library/Rcpp/include' -I'/opt/R/4.2.1/lib/R/library/RcppEigen/include' -I'/opt/R/4.2.1/lib/R/library/RcppParallel/include' -I/usr/local/include  `"/opt/R/4.2.1/lib/R/bin/Rscript" -e "RcppParallel::CxxFlags()"` `"/opt/R/4.2.1/lib/R/bin/Rscript" -e "StanHeaders:::CxxFlags()"` -fpic  -g -O2  -c stan_files/continuous.cc -o stan_files/continuous.o
################################# End Task Log ################################# 
Error: Unhandled Exception: Child Task 1214426412 error: Unhandled Exception: HTTP 599: Timeout during request
Execution halted

This isn't the complete error, please let me know if you need the whole wall of text and I'll upload it as soon as I can.

Reproducible Steps:

This simple, reproducible shiny app throws the same error when deploying:

library(shiny)
library(rstanarm)

ui <- fluidPage(
  textInput('text',
            label = 'Ingrese texto:'),
  verbatimTextOutput('textOut')
)

server <- function(input, output, session) {
  output$textOut <- 
    renderText({input$text})
}

shinyApp(ui, server)

This is my sessionInfo:

R version 4.2.1 (2022-06-23)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Monterey 12.5.1

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] parsnip_1.0.0         recipes_1.0.1         ranger_0.14.1         modelr_0.1.9         
 [5] readxl_1.4.1          stringr_1.4.1         purrr_0.3.4           gridExtra_2.3        
 [9] readr_2.1.2           tidyr_1.2.0           dplyr_1.0.9           ggplot2_3.3.6        
[13] DT_0.23               shinycssloaders_1.0.0 shinyjs_2.1.0         shinyWidgets_0.7.1   
[17] shinydashboard_0.7.2  shiny_1.7.2          

loaded via a namespace (and not attached):
  [1] backports_1.4.1      plyr_1.8.7           igraph_1.3.4         splines_4.2.1       
  [5] crosstalk_1.2.0      listenv_0.8.0        rstantools_2.2.0     inline_0.3.19       
  [9] digest_0.6.29        htmltools_0.5.3      yardstick_1.0.0      rsconnect_0.8.27    
 [13] fansi_1.0.3          magrittr_2.0.3       memoise_2.0.1        tzdb_0.3.0          
 [17] globals_0.15.1       gower_1.0.0          matrixStats_0.62.0   RcppParallel_5.1.5  
 [21] xts_0.12.1           askpass_1.1          hardhat_1.2.0        prettyunits_1.1.1   
 [25] colorspace_2.0-3     xfun_0.32            callr_3.7.2          crayon_1.5.1        
 [29] jsonlite_1.8.0       lme4_1.1-30          survival_3.3-1       zoo_1.8-10          
 [33] glue_1.6.2           gtable_0.3.0         ipred_0.9-13         pkgbuild_1.3.1      
 [37] clipr_0.8.0          rstan_2.21.5         future.apply_1.9.0   scales_1.2.1        
 [41] DBI_1.1.3            miniUI_0.1.1.1       Rcpp_1.0.9           xtable_1.8-4        
 [45] stats4_4.2.1         lava_1.6.10          StanHeaders_2.21.0-7 prodlim_2019.11.13  
 [49] htmlwidgets_1.5.4    threejs_0.3.3        ellipsis_0.3.2       loo_2.5.1           
 [53] pkgconfig_2.0.3      nnet_7.3-17          sass_0.4.2           utf8_1.2.2          
 [57] janitor_2.1.0        tidyselect_1.1.2     rlang_1.0.4          reshape2_1.4.4      
 [61] later_1.3.0          munsell_0.5.0        cellranger_1.1.0     tools_4.2.1         
 [65] cachem_1.0.6         xgboost_1.6.0.1      cli_3.3.0            generics_0.1.3      
 [69] pacman_0.5.1         broom_1.0.0          ggridges_0.5.3       evaluate_0.16       
 [73] fastmap_1.1.0        yaml_2.3.5           processx_3.7.0       knitr_1.40          
 [77] nlme_3.1-157         future_1.27.0        mime_0.12            rstanarm_2.21.3     
 [81] compiler_4.2.1       bayesplot_1.9.0      shinythemes_1.2.0    rstudioapi_0.14     
 [85] curl_4.3.2           tibble_3.1.8         bslib_0.4.0          stringi_1.7.8       
 [89] ps_1.7.1             lattice_0.20-45      Matrix_1.4-1         nloptr_2.0.3        
 [93] markdown_1.1         conflicted_1.1.0     vctrs_0.4.1          pillar_1.8.1        
 [97] lifecycle_1.0.1      jquerylib_0.1.4      data.table_1.14.2    httpuv_1.6.5        
[101] R6_2.5.1             promises_1.2.0.1     parallelly_1.32.1    writexl_1.4.0       
[105] codetools_0.2-18     boot_1.3-28          colourpicker_1.1.1   MASS_7.3-57         
[109] gtools_3.9.3         assertthat_0.2.1     openssl_2.0.2        withr_2.5.0         
[113] shinystan_2.6.0      parallel_4.2.1       hms_1.1.2            grid_4.2.1          
[117] rpart_4.1.16         timeDate_4021.104    minqa_1.2.4          class_7.3-20        
[121] rmarkdown_2.16       snakecase_0.11.0     dbarts_0.9-22        prophet_1.0         
[125] lubridate_1.8.0      base64enc_0.1-3      dygraphs_1.1.1.6    

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the minimal Shiny app deployment described in the issue and inspect the build log at the rstanarm compilation step. No repository file or test is identified; done means the app publishes successfully without the build timing out.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, r
Domain
build-system, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.