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

[Bug]: Multiple re-renders of the same article produces error #177

Open
3 tasks done
averissimo opened this issue Dec 6, 2023 · 0 comments
Open
3 tasks done

[Bug]: Multiple re-renders of the same article produces error #177

averissimo opened this issue Dec 6, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@averissimo
Copy link
Contributor

What happened?

When rendering an article multiple times across sessions it sometimes leads to the error below.

This happens as:

  • knitr_utils chunk recognizes the environment as being a test environment
  • Then triggers the save of an RDS file on testenv chunk
  • This requires an environment variable that doesn't exist
  • it ends up trying to write to the root directory.
processing file: lbt02.qmd
  |........................                               |  44% [save testenv]
Quitting from lines 2-10 [save testenv] (lbt02.qmd)
Error in `gzfile()`:
! cannot open the connection
Backtrace:
 1. base::saveRDS(tenv, filepath)
 2. base::gzfile(file, mode)
                                                                                                         
Execution halted

@kartikeyakirar also reproduced this error

It is corrected when:

diff --git a/book/tables/lab-results/lbt02.qmd b/book/tables/lab-results/lbt02.qmd
index a0f0e47d..1f02fca6 100644
--- a/book/tables/lab-results/lbt02.qmd
+++ b/book/tables/lab-results/lbt02.qmd
@@ -62,7 +62,7 @@ result
 
 ## `teal` App
 
-```{r teal, message=FALSE, opts.label='skip_if_testing'}
+```{r teal, message=FALSE, opts.label='skip_if_testing', cache=FALSE}
 #| screenshot.opts = list(delay = 8)
 
 library(scda)

Relevant log output

R version 4.3.2 (2023-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 23.10

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.11.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.11.0

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

time zone: Europe/Berlin
tzcode source: system (glibc)

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

loaded via a namespace (and not attached):
[1] utf8_1.2.4 R6_2.5.1 tidyselect_1.2.0 magrittr_2.0.3 glue_1.6.2 tibble_3.2.1 pkgconfig_2.0.3 dplyr_1.1.4 generics_0.1.3
[10] lifecycle_1.0.4 cli_3.6.1 fansi_1.0.5 vctrs_0.6.5 rsconnect_1.1.1 testthat_3.2.1 withr_2.5.2 renv_1.0.3 compiler_4.3.2
[19] rstudioapi_0.15.0 tools_4.3.2 brio_1.1.3 pillar_1.9.0 yaml_2.3.7 BiocManager_1.30.22 rlang_1.1.2

Code of Conduct

  • I agree to follow this project's Code of Conduct.

Contribution Guidelines

  • I agree to follow this project's Contribution Guidelines.

Security Policy

  • I agree to follow this project's Security Policy.
@averissimo averissimo added the bug Something isn't working label Dec 6, 2023
@averissimo averissimo changed the title [Bug]: Multiple re-renders of the same article may lead to [Bug]: Multiple re-renders of the same article produces error Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants