Skip to content

pandoc: openFile: does not exist (No such file or directory) #1268

Open

Description

@harryprince

I am trying to server Rmd using shiny server. However, it seems rmarkdown or pandoc is buggy.
It works well on Rstudio but fails deploy on rstudio connect too.

yaml config:

output:
  flexdashboard::flex_dashboard:
    social: menu
    source: embed
    storyboard: yes

Rmarkdown version:

 packageVersion("rmarkdown")
[1] ‘1.8’
shiny-server --version
Shiny Server v1.5.3.838
Node.js v6.10.0

pandoc version

/opt/shiny-server/ext/pandoc/pandoc --version
pandoc 1.12.3
Compiled with texmath 0.6.6, highlighting-kate 0.5.6.

sessionInfo():

R version 3.3.2 (2016-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.5 LTS

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

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

here is the shiny server log:

processing file: index.Rmd
output file: /tmp/rmarkdown/e01d3e5bbe48ef364e37eb0580046563/index.knit.md

pandoc: /tmp/RtmpWH829n/rmarkdown-str67a94810a85d.html: openFile: does not exist (No such file or directory)
Warning: Error in : pandoc document conversion failed with error 1
Stack trace (innermost first):
    115: pandoc_convert
    114: convert
    113: <Anonymous>
    112: do.call
    111: contextFunc
    110: .getReactiveEnvironment()$runWith
    109: shiny::maskReactiveContext
    108: <reactive>
     95: doc
     94: shiny::renderUI
     93: func
     92: force
     91: withVisible
     90: withCallingHandlers
     89: globals$domain$wrapSync
     88: promises::with_promise_domain
     87: captureStackTraces
     83: tryCatch
     82: do
     81: hybrid_chain
     80: origRenderFunc
     79: output$__reactivedoc__
      3: <Anonymous>
      2: do.call
      1: rmarkdown::run

Activity

  1. yihui commented on Feb 24, 2018

    @yihui
  2. harryprince commented on Feb 26, 2018

    @harryprince
    Author
  3. yihui commented on Feb 26, 2018

    @yihui
  4. ADraginda commented on Feb 27, 2018

    @ADraginda

    Just FYI I'm also seeing this error (trying to use rmarkdown with flexdashboard). Using the dev version unblocked things but I'm still seeing the error.

  5. yihui commented on Feb 27, 2018

    @yihui
    Collaborator

    @ADraginda Are you also on Shiny Server? Is it reproducible locally?

  6. added
    bug
    on Mar 12, 2018
  7. NilsOle commented on Jun 4, 2018

    @NilsOle

    I have the same issue, but only when I run rmarkdown::render(...) in parallel on multiple cores. When I do
    registerDoParallel(cores=1) it works without error. When running in parallel, out of many calls of the function, only some return errors as described here, and also not consistently (appears random at first sight).
    Is that information helpful?

    To reproduce, install the following R package and

    1. run reproducemarkdownerror:hello(3) for 3 cores respectively. This should give you error messages.
    2. reproducemarkdownerror:hello(1) should not give you any errors.

    reproducermarkdownerror_0.1.0.tar.gz

    Output (operation produces only 92 files although 100 expected):

    > reproducermarkdownerror::hello(3)
    Loading required package: foreach
    Loading required package: iterators
    Loading required package: parallel
    pandoc: /tmp/RtmpmiRJfV/rmarkdown-str124b12f90895.html: openFile: does not exist (No such file or directory)
    pandoc: /tmp/RtmpmiRJfV/rmarkdown-str124d5a2948a2.html: openFile: does not exist (No such file or directory)
    pandoc: /tmp/RtmpmiRJfV/rmarkdown-str124b1d015295.html: openFile: does not exist (No such file or directory)
    pandoc: /tmp/RtmpmiRJfV/rmarkdown-str124c3a9fd602.html: openFile: does not exist (No such file or directory)
    pandoc: /tmp/RtmpmiRJfV/rmarkdown-str124b191fe7b1.html: openFile: does not exist (No such file or directory)
    pandoc: /tmp/RtmpmiRJfV/rmarkdown-str124d70f14424.html: openFile: does not exist (No such file or directory)
    pandoc: /tmp/RtmpmiRJfV/rmarkdown-str124b586db239.html: openFile: does not exist (No such file or directory)
    pandoc: /tmp/RtmpmiRJfV/rmarkdown-str124b142b5ab8.html: openFile: does not exist (No such file or directory)
    
     Error in do_rpt(r) : 
      task 7 failed - "pandoc document conversion failed with error 1"
     
    

    Script taken from here:
    https://gist.github.com/hrbrmstr/17bc21af55392f23f012f57bb2fda51c

    Version information:

    > devtools::session_info("rmarkdown")
     setting  value                       
     version  R version 3.4.4 (2018-03-15)
     system   x86_64, linux-gnu           
     ui       RStudio (1.1.383)           
     language (EN)                        
     collate  en_US.UTF-8                 
     tz       Europe/Berlin               
     date     2018-06-04                  
    
     package   * version date       source        
     backports   1.1.2   2017-12-13 CRAN (R 3.4.3)
     base64enc   0.1-3   2015-07-28 CRAN (R 3.4.3)
     digest    * 0.6.15  2018-01-28 CRAN (R 3.4.3)
     evaluate    0.10.1  2017-06-24 CRAN (R 3.4.3)
     glue        1.2.0   2017-10-29 CRAN (R 3.4.3)
     graphics  * 3.4.4   2018-03-16 local         
     grDevices * 3.4.4   2018-03-16 local         
     highr       0.6     2016-05-09 CRAN (R 3.4.3)
     htmltools   0.3.6   2017-04-28 CRAN (R 3.4.3)
     jsonlite    1.5     2017-06-01 CRAN (R 3.4.3)
     knitr       1.20    2018-02-20 CRAN (R 3.4.3)
     magrittr    1.5     2014-11-22 CRAN (R 3.4.3)
     markdown    0.8     2017-04-20 CRAN (R 3.4.3)
     methods   * 3.4.4   2018-03-16 local         
     mime        0.5     2016-07-07 CRAN (R 3.4.3)
     Rcpp        0.12.17 2018-05-18 CRAN (R 3.4.4)
     rmarkdown   1.9     2018-03-01 CRAN (R 3.4.3)
     rprojroot   1.3-2   2018-01-03 CRAN (R 3.4.4)
     stats     * 3.4.4   2018-03-16 local         
     stringi     1.2.2   2018-05-02 CRAN (R 3.4.4)
     stringr     1.3.1   2018-05-10 CRAN (R 3.4.4)
     tools       3.4.4   2018-03-16 local         
     utils     * 3.4.4   2018-03-16 local         
     yaml        2.1.19  2018-05-01 CRAN (R 3.4.4)
    
  8. goldingn commented on Aug 24, 2018

    @goldingn

    I can reproduce this error locally. Using rmarkdown::pandoc_convert() to convert a file in the same directory works, but trying to convert it one directory down fails.

    Create directory structure and file

    dir <- tempdir()
    sub_dir <- tempfile(tmpdir = dir)
    f <- tempfile(tmpdir = sub_dir)
    dir.create(sub_dir)
    writeLines("This is a test", f)
    cwd <- getwd()
    library(rmarkdown)

    This works

    setwd(sub_dir)
    fname <- basename(f)
    readLines(fname)
    #> [1] "This is a test"
    pandoc_convert(fname, to = "html")

    This doesn't:

    setwd(dir)
    fname <- file.path(basename(sub_dir), basename(f))
    readLines(fname)
    #> [1] "This is a test"
    pandoc_convert(fname, to = "html")
    #> Error: pandoc document conversion failed with error 1
    setwd(cwd)
    sessionInfo()
    #> R version 3.5.1 (2018-07-02)
    #> Platform: x86_64-apple-darwin15.6.0 (64-bit)
    #> Running under: macOS Sierra 10.12.6
    #> 
    #> Matrix products: default
    #> BLAS: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRblas.0.dylib
    #> LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib
    #> 
    #> locale:
    #> [1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8
    #> 
    #> attached base packages:
    #> [1] stats     graphics  grDevices utils     datasets  methods   base     
    #> 
    #> other attached packages:
    #> [1] rmarkdown_1.10.12
    #> 
    #> loaded via a namespace (and not attached):
    #>  [1] compiler_3.5.1  magrittr_1.5    htmltools_0.3.6 tools_3.5.1    
    #>  [5] yaml_2.2.0      Rcpp_0.12.18    stringi_1.2.4   knitr_1.20     
    #>  [9] htmldeps_0.1.1  digest_0.6.16   stringr_1.3.1   evaluate_0.11
  9. AndrewManHayChiu commented on Nov 21, 2018

    @AndrewManHayChiu

    I had a similar problem, where I could knit in some directories, but not in others (on a mapped network drive).

    I removed pandoc 2.4, to direct RStudio to use the in-built pandoc as per @yihui 's comment at #1184.

  10. pauvasquezh commented on May 24, 2019

    @pauvasquezh
  11. vthivierge commented on Jul 18, 2019

    @vthivierge
  12. vthivierge commented on Jul 18, 2019

    @vthivierge

    Following @pauvasquezh, @NilsOle or @goldingn were you able to solve this?

    I solved it by changing my RStudio global options and setting the R version to be the local C:\ drive and not R on the network drive.

  13. crossxwill commented on Jul 22, 2019

    @crossxwill

    If the Rmd file is stored on a network drive, the knitting fails. However, if the Rmd file is stored on the local C:\ drive, the knitting works fine.

    YAML

    ---
    title: "Untitled"
    author: "William Chiu"
    date: "7/22/2019"
    output: powerpoint_presentation
    ---
    

    Network drive

    output file: ppt_test.knit.md
    
    "C:/Users/wchiu/AppData/Local/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS ppt_test.utf8.md --to pptx --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash+smart --output ppt_test.pptx 
    pandoc.exe: ppt_test.utf8.md: openBinaryFile: does not exist (No such file or directory)
    Error: pandoc document conversion failed with error 1
    Execution halted
    

    Local C:\ drive

    "C:/Users/wchiu/AppData/Local/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS ppt_test.utf8.md --to pptx --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash+smart --output ppt_test.pptx 
    output file: ppt_test.knit.md
    
    
    Output created: ppt_test.pptx
    

    Session Info

    > sessionInfo()
    R version 3.6.1 (2019-07-05)
    Platform: x86_64-w64-mingw32/x64 (64-bit)
    Running under: Windows 7 x64 (build 7601) Service Pack 1
    
    Matrix products: default
    
    locale:
    [1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
    [3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
    [5] LC_TIME=English_United States.1252    
    
    attached base packages:
    [1] stats     graphics  grDevices utils     datasets  methods   base     
    
    loaded via a namespace (and not attached):
     [1] compiler_3.6.1  htmltools_0.3.6 tools_3.6.1     yaml_2.2.0      Rcpp_1.0.1      rmarkdown_1.14 
     [7] knitr_1.23      xfun_0.8        digest_0.6.20   evaluate_0.14  
    

    RStudio Version

    $citation
    
    To cite RStudio in publications use:
    
      RStudio Team (2018). RStudio: Integrated Development for R. RStudio, Inc., Boston, MA URL
      http://www.rstudio.com/.
    
    A BibTeX entry for LaTeX users is
    
      @Manual{,
        title = {RStudio: Integrated Development Environment for R},
        author = {{RStudio Team}},
        organization = {RStudio, Inc.},
        address = {Boston, MA},
        year = {2018},
        url = {http://www.rstudio.com/},
      }
    
    
    $mode
    [1] "desktop"
    
    $version
    [1] ‘1.2.1335’
    
  14. 39 remaining items

  15. jmarshallnz commented on Jul 28, 2021

    @jmarshallnz

    Just chiming in with my experiences with RStudio 1.4+ and pandoc 2.14.1. 2.14.1 has fixed the ".Rmd file located in the user roaming profile (i.e. UNC path) issue", so if RStudio updates to this version of pandoc then that is solved as far as I can tell.

    However, there is a related problem: If the .libPaths() is on a roaming profile (UNC) location, and rmarkdown is installed into that location then you get basically the same error, presumably due to pandoc not loading the template files etc correctly. This is supposed to be fixed in pandoc 2.14.1:

    jgm/pandoc@26ed7fb

    But it seems that it isn't completely fixed. Am not sure exactly which bit is failing, output is like this:

    "C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS blah.knit.md --to html4 --from markdown+autolink_bare_uris+tex_math_single_backslash --output blah.html --lua-filter "\\tur-homes2.massey.ac.nz\jcmarsha\My Documents\R\win-library\4.1\rmarkdown\rmarkdown\lua\pagebreak.lua" --lua-filter "\\tur-homes2.massey.ac.nz\jcmarsha\My Documents\R\win-library\4.1\rmarkdown\rmarkdown\lua\latex-div.lua" --self-contained --variable bs3=TRUE --standalone --section-divs --template "\\tur-homes2.massey.ac.nz\jcmarsha\My Documents\R\win-library\4.1\rmarkdown\rmd\h\default.html" --no-highlight --variable highlightjs=1 --variable theme=bootstrap --include-in-header "C:\Users\jcmarsha\AppData\Local\Temp\3\Rtmpya8M4d\rmarkdown-strd784b525dcd.html" --mathjax --variable "mathjax-url:https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" 
    

    In addition, two warnings are generated, suggesting it might be fixable within rmarkdown maybe?

    Warning messages:
    1: In normalizePath(path.expand(path), winslash, mustWork) :
      path[1]="\\tur-homes2.massey.ac.nz": The specified path is invalid
    2: In normalizePath(path.expand(path), winslash, mustWork) :
      path[1]="\\tur-homes2.massey.ac.nz": The specified path is invalid
    

    Everything works fine, and the warnings are not generated if the UNC path is mapped to a drive and then R_LIBS_USER is set accordingly.

  16. kiwifb commented on Jul 29, 2021

    @kiwifb

    It seems like windows people have some kind of work around. But non-windows using drive over cifs are not so lucky.

    I have seen a similar issue on jupyter because by default they tried to enforce atomic write which didn't work so well on remote file system. It kind of works the first time but after that you have some kind of ghost files preventing things from working. I got the following message from the r markdown window

    Error in abs_path(input) : 
      The file 'simulating-the-Roy-Rubin-Model-final.Rmd' does not exist.
    Calls: <Anonymous> -> setwd -> dirname -> abs_path
    In addition: Warning messages:
    1: In file.create(to[okay]) :
      cannot create file 'simulating-the-Roy-Rubin-Model-final.Rmd', reason 'No such file or directory'
    2: In normalizePath(path, winslash = winslash, mustWork = mustWork) :
      path[1]="simulating-the-Roy-Rubin-Model-final.Rmd": No such file or directory
    Execution halted
    

    when I look at my file system I have

    -rwx--x--x 1 frb15 domain users 817988 Jul 28 23:42  simulating-the-Roy-Rubin-Model-final.html*
    -????????? ? ?     ?                 ?            ?  simulating-the-Roy-Rubin-Model-final.knit.md
    -rwx--x--x 1 frb15 domain users  17041 Jul 28 23:41 'simulating-the-Roy-Rubin-Model final.Rmd'*
    -????????? ? ?     ?                 ?            ?  simulating-the-Roy-Rubin-Model-final.Rmd
    

    But I feel one the reason things don't work, is that temporary files are created in place instead of a proper temporary location, /tmp on unix and whatever it would be in windows.

  17. cderv commented on Jul 29, 2021

    @cderv
    Collaborator

    @jmarshallnz @kiwifb Thanks a lot that is very helpful ! With your comment, I believe we have something to reproduce. It require to setup an environment with UNC path, so it won't be straightforward for me.

    Also, we still don't know for sure if this is Pandoc or rmarkdown. It is probably both.

    @jabranham the commit you linked to (jgm/pandoc@26ed7fb) is in a release version since Pandoc 2.11. When you say

    2.14.1 has fixed the ".Rmd file located in the user roaming profile (i.e. UNC path) issue"

    Do you have another fix in Pandoc in mind ? FWIW, next RStudio IDE version should be shipped with 2.14.1

    @kiwifb The error you get is clearly not from Pandoc and it different. If you can reproduce, can you share also the traceback() after the error ? What abs_path() does is calling file.exists(). With rmarkdown, everything happens by default relatively to the input path, included intermediates. I believe mainly because those intermediates needs to be found by Pandoc and we would need to deal with absolute path everywhere including in the generated md file. Note that some resources are created in a tmp folder like special HTML headers to include.

    We'll try to make quicker progress with your information, thanks for sharing ! We definitely need to reproduce this in order to better dig into the issue with file managements and computation with network drive.

    Thanks again

  18. jmarshallnz commented on Jul 29, 2021

    @jmarshallnz

    @cderv Yes, you're right about that commit being in 2.11. Strange. There definitely is a difference in behaviour between pandoc 2.11 and 2.14.1 with RStudio 1.4. With v2.11 I can reproduce (everytime) the fault where the .Rmd is stored in a UNC path it fails to build. With 2.14.1 this is gone, except for the case where rmarkdown is also installed on a UNC path.

    I can't really see anything obvious in pandoc other than that commit, so not sure what fixed (part of) the problem.

  19. cderv commented on Jul 29, 2021

    @cderv
    Collaborator

    Then it is possible that something in RStudio IDE helped fix this issue. There was also non-pandoc issue with RStudio IDE and UNC path I believe.

    With what you say, it could mean that next version of RStudio IDE with Pandoc 2.14.1 should be better.

    We would need to look then more at the issue with rmarkdown package on network drive. For this, I am thinking we may need to copy the resources included into the package locally so that Pandoc does not need to access them through network drive (if that is the issue). Currently, some resource are passed to pandoc using absolute path to rmarkdown installation folder.

  20. kiwifb commented on Jul 29, 2021

    @kiwifb

    My setup is a rstudio server running on ubuntu 20.04 with some remote folders mounted via cifs. The previous error I think had some extra layers of indirections because the filename had space in it, which lead to extra normalization.
    The first time it knits OK

    output file: simulating-the-Roy-Rubin-Modelfinal.knit.md
    
    /usr/lib/rstudio-server/bin/pandoc/pandoc +RTS -K512m -RTS simulating-the-Roy-Rubin-Modelfinal.knit.md --to html4 --from markdown+autolink_bare_uris+tex_math_single_backslash --output simulating-the-Roy-Rubin-Modelfinal.html --lua-filter /usr/lib/R/library/rmarkdown/rmarkdown/lua/pagebreak.lua --lua-filter /usr/lib/R/library/rmarkdown/rmarkdown/lua/latex-div.lua --self-contained --variable bs3=TRUE --standalone --section-divs --template /usr/lib/R/library/rmarkdown/rmd/h/default.html --highlight-style tango --variable theme=united --include-in-header /tmp/RtmpaGRfIM/rmarkdown-str14a4f44e57f07c.html --mathjax --variable 'mathjax-url:https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' 
    
    Output created: simulating-the-Roy-Rubin-Modelfinal.html
    

    But the second time (or sometimes more time, it is a bit finicky) I now get

    label: unnamed-chunk-28 (with options) 
    List of 1
     $ echo: logi TRUE
    
      |......................................................................| 100%
      ordinary text without R code
    
    
    Error in file(con, "w") : cannot open the connection
    Calls: <Anonymous> -> <Anonymous> -> write_utf8 -> writeLines -> file
    In addition: Warning message:
    In file(con, "w") :
      cannot open file 'simulating-the-Roy-Rubin-Modelfinal.knit.md': No such file or directory
    Execution halted
    

    I am doing everything from the rstudio interface at the moment, how do I run things to get to the backtrace you want. I can run R directly from the command line if needed.

  21. kiwifb commented on Jul 29, 2021

    @kiwifb

    Figured it out by running rmarkdown::render from rstudio's console.

    5: file(con, "w") 
    4: writeLines(enc2utf8(text), con, ..., useBytes = TRUE)
    3: write_utf8(res, output)
    2: knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet) 
    1: rmarkdown::render("/home/frb15/Pdrive/simulating-the-Roy-Rubin-Modelfinal.Rmd",         "html_document")
    
  22. cderv commented on Jul 29, 2021

    @cderv
    Collaborator

    That is a bit disturbing to me that this is sometimes working, and sometimes not.

    Thanks for sharing the setup. I'll see if I can get my hand of such configuration.

  23. kiwifb commented on Jul 29, 2021

    @kiwifb

    I think there is a lot to be done around some remote file system. What personally gets my attention as a programer in other language and context is that the intermediary file (in .knit.md) shouldn't be created there. It is transient and disappear once you are done. On most OS there are special place for those in /tmp (or windows equivalent) or ~/.cache or other special folders if you are more sophisticated. There is no absolute guarantee of locality but it is way cleaner than leaving your stuff next to your input and output - unless you are debugging.

  24. cderv commented on Jul 29, 2021

    @cderv
    Collaborator

    I understand you point, and I think what you describe applies to more standard temporary content. However, for the specific usage here, we need to consider the way Pandoc is working. For example, it is highly possible that .knit.md will contain references to resource relatively to your Rmd document. If the resulting md file is elsewhere, those resources linked in the md doc won't be located relatively to the source file anymore and Pandoc won't find them during the conversion to HTML. Some processing would need to happen to handle absolute vs relative path correctly. That is just an example. Also, rmarkdown does write to tempdir() already some files that does not have this type of concerns.

    We are a bit off topic here. You can open a new issue if you want to discuss some ways to improve that (Knitr + Pandoc + LaTeX interaction needs to be considered here). Thanks !

  25. kiwifb commented on Jul 29, 2021

    @kiwifb

    Ha, it just proves that I am completely ignorant of the context and that I don't know what I am talking about. I have been spending a few hours looking at the code earlier today and I couldn't really untangle the various abstractions. R is not the language I am the most familiar with.

    I have come to that conversation because I am supporting a lecturer for whom I have organised the particular setup. The cifs mount is to access our university shared file system for convenience. As it turns out it is not currently convenient to run a number of things including knitting directly on it :)

  26. cderv commented on Jul 29, 2021

    @cderv
    Collaborator

    Thanks for chiming in then !

    We really appreciate having also external contributors with different background to share views and thoughts on the ecosystem because it brings new perspective. If you still want to look deeper with your setup (and I think that would us), you could try without R and rmarkdown, using directly Pandoc to convert a document with different scenarios. For example :

    • Using Pandoc on your cifs mount to convert a doc
    • Using Pandoc to convert from local storage but using a resource from external storage

    If this does not work well at this level, then it is why we have a hard time looking at it from our level 🤔

  27. EPriske commented on Oct 5, 2021

    @EPriske

    Following @pauvasquezh, @NilsOle or @goldingn were you able to solve this?

    I solved it by changing my RStudio global options and setting the R version to be the local C:\ drive and not R on the network drive.

    This solved my problem with R Markdown. Thank you so much

  28. abhiavi commented on Mar 30, 2026

    @abhiavi

    I'd like to help resolve this file handling error. Could you please confirm the repository's contribution policy and the preferred process for submitting a fix?

  29. yihui commented on Aug 25, 2026

    @yihui
    Collaborator

    For those hitting this specifically when running rmarkdown::render() in parallel (e.g. registerDoParallel(cores > 1), foreach %dopar%, or a fork cluster) — as reported by @NilsOle and others above — this was the same root cause as #1632: forked workers share tempdir(), and each render's cleanup deleted sibling renders' temp files mid-conversion. Fixed in #2631 — please try the dev version:

    remotes::install_github('rstudio/rmarkdown')

    Note this does not address the other cause discussed in this thread — .Rmd files or R installed on a network/UNC drive on Windows (the Sys.getenv('R_USER') / .libPaths() reports). That's a separate issue and remains open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bughelp wanted ❤️

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions