Rmd file stops knitting halfway without any warning/error/output

Following from the unresolved closed topic.
I have an Rmd file that knits and renders uneventfully with the knit button when the R session is fresh, but if the code is run in the console the knit button becomes dysfunctional and knitting halts at a certain point through the document without any error or warning messages. The red stop sign just disappears and nothing happens. I've noted no problems with the Rstudio session whatsoever, everything functions fine, codes run in the console with the expected output and I can still use Rmarkdown::render in the console and get my pdf output.
Interestingly -similar to the closed but unresolved post- this project also contains a biggish data file (3.5 mb xlsx) with 22.5K rows. Below is a screenshot of my latest attempt with the knit button.
grafik

Below is the sessioninfo

R version 3.5.2 (2018-12-20)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.5 LTS

Matrix products: default
BLAS: /usr/lib/atlas-base/atlas/libblas.so.3.0
LAPACK: /usr/lib/atlas-base/atlas/liblapack.so.3.0

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

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

other attached packages:
 [1] broom_0.5.2      lme4_1.1-21      Matrix_1.2-15    zoo_1.8-5        lubridate_1.7.4  ggalluvial_0.9.1
 [7] kableExtra_1.1.0 forcats_0.4.0    stringr_1.4.0    dplyr_0.8.0.1    purrr_0.3.2      readr_1.3.1     
[13] tidyr_0.8.3      tibble_2.1.1     ggplot2_3.1.1    tidyverse_1.2.1  readxl_1.3.1    

loaded via a namespace (and not attached):
 [1] tidyselect_0.2.5   xfun_0.6           splines_3.5.2      haven_2.1.0        lattice_0.20-38    colorspace_1.4-1  
 [7] generics_0.0.2     htmltools_0.3.6    viridisLite_0.3.0  yaml_2.2.0         rlang_0.3.4        nloptr_1.2.1      
[13] pillar_1.3.1       glue_1.3.1         withr_2.1.2        selectr_0.4-1      RColorBrewer_1.1-2 modelr_0.1.4      
[19] plyr_1.8.4         munsell_0.5.0      gtable_0.3.0       cellranger_1.1.0   rvest_0.3.3        evaluate_0.13     
[25] labeling_0.3       knitr_1.22         highr_0.8          Rcpp_1.0.1         scales_1.0.0       backports_1.1.4   
[31] webshot_0.5.1      jsonlite_1.6       hms_0.4.2          digest_0.6.18      stringi_1.4.3      bookdown_0.9      
[37] grid_3.5.2         cli_1.1.0          tools_3.5.2        magrittr_1.5       lazyeval_0.2.2     crayon_1.3.4      
[43] pkgconfig_2.0.2    ellipsis_0.1.0     MASS_7.3-51.1      xml2_1.2.0         minqa_1.2.4        assertthat_0.2.1  
[49] rmarkdown_1.12     httr_1.4.0         rstudioapi_0.10    boot_1.3-20        R6_2.4.0           nlme_3.1-137      
[55] compiler_3.5.2   

Hello,

Sorry you are hitting this problem. The other issue was related to hitting the container memory limit (which is 1GB in cloud) and your description of the behavior makes it sound like it has the same root cause. If you can send me to the url to the project I can confirm that you're hitting the limit from our logging.

Sean

But then shouldn't I hit the limit again when I attempt to knit using render()? It works fine.

I'm seeing quite a few out of memory events for that project so I'm pretty sure that's the underlying cause. If you are close to the memory limit it makes sense that it behaves correctly when the session is fresh. However it ends up manifesting itself after the 2nd execution (or when you try to re-run a specific more intensive R Markdown step over again) because there is some data left in memory from the previous executions.

Sean

1 Like

@Seans is correct, it's an out of memory issue. I didn't see it on my personal machines b/c i have way more RAM than what they provide in the cloud.
This still happens to my class on a regular basis, but clearing out the working environment, and sometimes restarting R & clearing output (found in the Session menu) then knitting from a clean slate always works.
Just watch out that you're not storing a lot of copies of large files in your working environment, then you may end up with the same problem when you knit.

1 Like

This topic was automatically closed 21 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.