"Connection refused" when running learnr modules on RStudio Cloud

I'm trying to get learnr modules running on RStudio Cloud. They work on my local machine but don't work on R Studio Cloud.

To reproduce this issue, start a new workspace, and then install the packages and try to run a tutorial:

install.packages('tidyverse')
install.packages('remotes')

remotes::install_github("RohanAlexander/DoSStoolkit")

library(tidyverse)

learnr::run_tutorial("hello_world", package = "DoSStoolkit")

The result is 'Connection refused' in another window, rather than the learnr tutorial loading in that window.

The sessioninfo() for the RStudio Cloud instance where it doesn't work is:

R version 4.0.3 (2020-10-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.2 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/atlas/libblas.so.3.10.3
LAPACK: /usr/lib/x86_64-linux-gnu/atlas/liblapack.so.3.10.3

locale:
 [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8       
 [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8   
 [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C          
[10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   

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

other attached packages:
 [1] palmerpenguins_0.1.0  sortable_0.4.4        flair_0.0.2          
 [4] dplyr_1.0.6           opendatatoronto_0.1.4 learnr_0.10.1        
 [7] shiny_1.6.0           forcats_0.5.1         stringr_1.4.0        
[10] purrr_0.3.4           readr_1.4.0           tidyr_1.1.3          
[13] tibble_3.1.2          ggplot2_3.3.3         tidyverse_1.3.1      

loaded via a namespace (and not attached):
 [1] httr_1.4.2        sass_0.4.0        jsonlite_1.7.2    modelr_0.1.8     
 [5] bslib_0.2.5.1     assertthat_0.2.1  highr_0.9         renv_0.13.2      
 [9] cellranger_1.1.0  yaml_2.2.1        pillar_1.6.1      backports_1.2.1  
[13] lattice_0.20-41   glue_1.4.2        digest_0.6.27     promises_1.2.0.1 
[17] checkmate_2.0.0   rvest_1.0.0       colorspace_2.0-1  htmltools_0.5.1.1
[21] httpuv_1.6.1      Matrix_1.2-18     pkgconfig_2.0.3   broom_0.7.6      
[25] haven_2.4.1       xtable_1.8-4      scales_1.1.1      later_1.2.0      
[29] generics_0.1.0    ellipsis_0.3.2    cachem_1.0.5      withr_2.4.2      
[33] cli_2.5.0         magrittr_2.0.1    crayon_1.4.1      readxl_1.3.1     
[37] mime_0.10         evaluate_0.14     fs_1.5.0          fansi_0.5.0      
[41] xml2_1.3.2        tools_4.0.3       hms_1.1.0         lifecycle_1.0.0  
[45] munsell_0.5.0     reprex_2.0.0      compiler_4.0.3    jquerylib_0.1.4  
[49] rlang_0.4.11      grid_4.0.3        rstudioapi_0.13   htmlwidgets_1.5.3
[53] rmarkdown_2.8     gtable_0.3.0      DBI_1.1.1         markdown_1.1     
[57] R6_2.5.0          lubridate_1.7.10  knitr_1.33        fastmap_1.1.0    
[61] utf8_1.2.1        rprojroot_2.0.2   stringi_1.6.2     Rcpp_1.0.6       
[65] png_0.1-7         vctrs_0.3.8       dbplyr_2.1.1      tidyselect_1.1.1 
[69] xfun_0.23        

FWIW the sessioninfo() on my local computer, where it does load is:
Works:

R version 4.0.3 (2020-10-10)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 10.16

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

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

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

other attached packages:
 [1] opendatatoronto_0.1.4 ggmap_3.0.0           sortable_0.4.4        patchwork_1.1.1      
 [5] gt_0.3.0              kableExtra_1.3.4      here_1.0.1            scales_1.1.1         
 [9] ggpubr_0.4.0          knitr_1.33            janitor_2.1.0         lubridate_1.7.10     
[13] glue_1.4.2            palmerpenguins_0.1.0  flair_0.0.2           dplyr_1.0.6          
[17] forcats_0.5.1         stringr_1.4.0         purrr_0.3.4           readr_1.4.0          
[21] tidyr_1.1.3           tibble_3.1.2          ggplot2_3.3.3         tidyverse_1.3.1      
[25] learnr_0.10.1.9009    shiny_1.6.0          

loaded via a namespace (and not attached):
  [1] colorspace_2.0-1     rjson_0.2.20         ggsignif_0.6.1       ellipsis_0.3.2       rio_0.5.26          
  [6] rprojroot_2.0.2      snakecase_0.11.0     markdown_1.1         fs_1.5.0             rstudioapi_0.13     
 [11] farver_2.1.0         remotes_2.3.0        fansi_0.4.2          xml2_1.3.2           splines_4.0.3       
 [16] cachem_1.0.5         jsonlite_1.7.2       broom_0.7.6          dbplyr_2.1.1         png_0.1-7           
 [21] compiler_4.0.3       httr_1.4.2           backports_1.2.1      assertthat_0.2.1     Matrix_1.3-2        
 [26] fastmap_1.1.0        cli_2.5.0            later_1.2.0          htmltools_0.5.1.9005 prettyunits_1.1.1   
 [31] tools_4.0.3          gtable_0.3.0         rappdirs_0.3.3       Rcpp_1.0.6           carData_3.0-4       
 [36] cellranger_1.1.0     jquerylib_0.1.4      vctrs_0.3.8          svglite_2.0.0        nlme_3.1-152        
 [41] xfun_0.23            ps_1.6.0             openxlsx_4.2.3       rvest_1.0.0          mime_0.10           
 [46] lifecycle_1.0.0      renv_0.13.2          rstatix_0.7.0        MASS_7.3-53.1        hms_1.1.0           
 [51] promises_1.2.0.1     yaml_2.2.1           curl_4.3.1           gridExtra_2.3        sass_0.4.0          
 [56] stringi_1.6.2        highr_0.9            checkmate_2.0.0      pkgbuild_1.2.0       zip_2.1.1           
 [61] bitops_1.0-7         RgoogleMaps_1.4.5.3  rlang_0.4.11.9000    pkgconfig_2.0.3      systemfonts_1.0.2   
 [66] evaluate_0.14        lattice_0.20-41      htmlwidgets_1.5.3    labeling_0.4.2       cowplot_1.1.1       
 [71] processx_3.5.2       tidyselect_1.1.1     plyr_1.8.6           magrittr_2.0.1       R6_2.5.0            
 [76] generics_0.1.0       DBI_1.1.1            pillar_1.6.1         haven_2.4.1          foreign_0.8-81      
 [81] withr_2.4.2          mgcv_1.8-34          sp_1.4-5             abind_1.4-5          modelr_0.1.8        
 [86] crayon_1.4.1         car_3.0-10           utf8_1.2.1           rmarkdown_2.8.3      jpeg_0.1-8.1        
 [91] isoband_0.2.4        grid_4.0.3           readxl_1.3.1         data.table_1.14.0    callr_3.7.0         
 [96] reprex_2.0.0         digest_0.6.27        webshot_0.5.2        xtable_1.8-4         httpuv_1.6.1        
[101] munsell_0.5.0        viridisLite_0.4.0    bslib_0.2.5.1

Sorry to hear you having trouble getting learnr working. FWIW, I was able to run the code you pasted without any issues.

If you look in the network tab of the developer tools of your browser, can you share a screenshot of any errors that show up there?

thanks
sam

1 Like

Interestingly, I tried this yesterday and could reproduce the same issue that @Rohan saw. I opened the project today to dig a little deeper and now it's working! :tada: (ish)

I think it's safe to assume this was an intermittent issue with RStudio Cloud (I also couldn't run any regular Shiny apps), but if it happens again please let us know!

1 Like

Thank you @samp and @grrrck for your help.

As they mention, it seems like just one of those things. If anyone comes here with the same error in the future, possibly try waiting for a few hours and then trying again.

Screenshot as at morning!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.