I'm having trouble knitting an Rmd when I set cache=TRUE for sql code chunks.
There is some discussion of a related error #1544 and rstudio/rmarkdown#914, but those examples seem to be when output.var is set in the sql chunk and the bug was fixed a couple years ago.
The following Rmd will knit the first time, but the second time when it tries to read from the cache, I get this error:
Quitting from lines 12-13 (test-sql-cache-rmd.Rmd)
Error in fun(environment()) : invalid first argument
Calls: <Anonymous> ... call_block -> <Anonymous> -> lazyLoad -> lazyLoadDBexec -> fun
Execution halted
I have provided the necessary information about my issue.
If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included xfun::session_info('knitr'). I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version: remotes::install_github('yihui/knitr').
If I have posted the same issue elsewhere, I have also mentioned it in this issue.
I have learned the Github Markdown syntax, and formatted my issue correctly.
I understand that my issue may be closed if I don't fulfill my promises.
The text was updated successfully, but these errors were encountered:
I think I can add to it. This behaviour is present even with eval=FALSE. I had some chunks demoing SQL queries on my blog (using SQL chunks mostly for the sake of pretty code highlighting), and every blogdown run except the first would fail with:
Error in fun(environment()) : invalid first argument
Calls: local ... call_block -> <Anonymous> -> lazyLoad -> lazyLoadDBexec -> fun
Execution halted
Error in render_page(f) :
Failed to render 'content/post/2018-07-24-self-hosted-git-server/2018-07-24-gitea.Rmd'
When it failed, I would change it to a generic code chunk, and then it would run ok once before failing again the subsequent run. Anyway, thanks for explaining this weird behaviour!
This was my chunk options and code:
```{r global_options, echo=FALSE, results='hide', message=FALSE}
opts_chunk$set(
eval = TRUE,
cache = TRUE,
message = FALSE,
warning = FALSE)
```
```{sql eval=FALSE}
GRANT ALL ON gitea.* TO 'gitea'@'localhost';
FLUSH PRIVILEGES;
```
I'm having trouble knitting an Rmd when I set
cache=TRUEfor sql code chunks.There is some discussion of a related error #1544 and rstudio/rmarkdown#914, but those examples seem to be when
output.varis set in the sql chunk and the bug was fixed a couple years ago.The following Rmd will knit the first time, but the second time when it tries to read from the cache, I get this error:
When
cache=FALSE, the error goes away.This issue was previously posed on RStudio Community.
By filing an issue to this repo, I promise that
xfun::session_info('knitr'). I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version:remotes::install_github('yihui/knitr').I understand that my issue may be closed if I don't fulfill my promises.
The text was updated successfully, but these errors were encountered: