Open harryprince opened 6 years ago
Please test the development version:
devtools::install_github('rstudio/rmarkdown')
https://github.com/rstudio/blogdown/issues/256#issuecomment-365966430
I tried to do it , however, it failed too and the error is the same as usual.
devtools::install_github("rstudio/rmarkdown",lib="/usr/local/lib/R/site-library")
Are you sure R uses the rmarkdown package from /usr/local/lib/R/site-library
? In other words, have you checked .libPaths()
and are you sure /usr/local/lib/R/site-library
is the first entry? When showing the session info, it will be great if you can load the package before showing it, e.g., either
library(rmarkdown)
sessionInfo()
or better (as requested in the issue template):
devtools::session_info('rmarkdown')
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.
@ADraginda Are you also on Shiny Server? Is it reproducible locally?
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)
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
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.
@NilsOle I'm having the same problem as you are describing, were you able to solve it somehow? :)
Following @pauvasquezh, @NilsOle or @goldingn were you able to solve this?
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.
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.
---
title: "Untitled"
author: "William Chiu"
date: "7/22/2019"
output: powerpoint_presentation
---
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
"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
> 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
$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’
Just save the Rmd file to the C:\ drive rather than desktop (Network Drive). This solved my problem while I have struggled a month... Very simple solution. Thank you guys.
@yihui - although there is a very simple work around (store Rmd file on C:\ rather than network drive), some of us are not allowed to save files on our C:\ (per company policy and/or using RStudio Server Pro with mounted network folders). Is there a plan to fix rmarkdown or knitr such that Rmd files that are stored on a network drive can still knit?
I think this is the same issue as in #701 where there is already a long discussion.
An issue was even opened to pandoc (jgm/pandoc#1326) as it is in fact a more general issue with pandoc than just Rmarkdown. it was conclude that it could come from the drive directly, and that it is not specific to R or Rmarkdown tools (https://github.com/rstudio/rmarkdown/issues/701#issuecomment-236960677)
Currently solution is to copy locally somewhere (not necessary in C:) before doing the conversion. see for example https://github.com/rstudio/rmarkdown/issues/701#issuecomment-237222070 or other comments.
To share experience, on a RStudio Server Pro (linux) with NFS mounted drive, we have no issue with that.
Before I had issues with older system, and specifically with self_contained=TRUE
document.
Also, there was recently a specific fix for WINDOWS environment in https://github.com/jgm/pandoc/issues/5127 that is included in Pandoc 2.7.3. I don't know if it could help.
At the time, I manage to change some directory argument from Rmarkdown (https://github.com/rstudio/rmarkdown/issues/701#issuecomment-237182996) to get the intermediaries files on local drive. (my home directory was on local drive).
although there is a very simple work around (store Rmd file on C:\ rather than network drive), some of us are not allowed to save files on our C:\ (per company policy and/or using RStudio Server Pro with mounted network folders)
I think any local folder where you have access right will work. Not just C:/ . You could have a home directory or even a temp directory to move your file before knitting. (R has one in tempdir()
)
Moving files there before rendering could solve the issue with pandoc. Updating pandoc could help too maybe (rmarkdown::pandoc_version()
to see what is shipped with your RStudio)
Hope it helps.
FYI Seeing the same issue using Rstudio in a windows VM. Setting the default working directory in Rstudio to a drive letter (e.g., Z:) in "Tools > Global options > General" rather than the default "~" resolved the issue.
I'm trying to do multiple reports (https://www.reed.edu/data-at-reed/software/R/markdown_multiple_reports.html) and with mtcars works fine, but if I do the same with my own dataframe loaded from a *.csv doesn't work. I don't know how to fix it nor I understand why and how is happening, I'm on a local computer.
sessionInfo() R version 3.5.0 (2018-04-23) 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=Spanish_Spain.1252 LC_CTYPE=Spanish_Spain.1252 LC_MONETARY=Spanish_Spain.1252 [4] LC_NUMERIC=C LC_TIME=Spanish_Spain.1252
attached base packages: [1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] readr_1.1.1 stringr_1.3.1 leaflet_2.0.2 dplyr_0.8.3 ggplot2_3.1.1 rmarkdown_1.10 markdown_0.8
[8] knitr_1.20
loaded via a namespace (and not attached):
[1] Rcpp_1.0.1 pillar_1.3.1 compiler_3.5.0 later_0.7.5 plyr_1.8.4 tools_3.5.0
[7] digest_0.6.18 evaluate_0.10.1 tibble_2.1.3 gtable_0.2.0 pkgconfig_2.0.2 rlang_0.4.0
[13] cli_1.0.1 shiny_1.1.0 rstudioapi_0.7 crosstalk_1.0.0 yaml_2.1.19 withr_2.1.2
[19] hms_0.4.2 htmlwidgets_1.3 rprojroot_1.3-2 grid_3.5.0 tidyselect_0.2.5 glue_1.3.1
[25] R6_2.2.2 fansi_0.4.0 purrr_0.2.5 magrittr_1.5 promises_1.0.1 scales_1.0.0
[31] backports_1.1.2 htmltools_0.3.6 rsconnect_0.8.15 assertthat_0.2.0 xtable_1.8-3 mime_0.5
[37] colorspace_1.3-2 httpuv_1.4.5 utf8_1.1.4 stringi_1.2.2 lazyeval_0.2.1 munsell_0.5.0
[43] crayon_1.3.4
I encountered the same error knitting to HTML from an .Rmd on a network drive. My working directory was already local. However, clearing the knitr cache resolved the issue.
The solution by @vthivierge worked for me.
100% fix
when you open a project on a mapped drive do not open it through the shortcut to the mapped drive
rmarkdown::render('H:/Mediasonic/John/tester.Rmd', encoding = 'UTF-8');
this is what happens when you open it wrong the knit command cannot operate on this path rmarkdown::render('//offfice//H//Mediasonic RAID1//John/tester.Rmd', encoding = 'UTF-8');
Watch out used open file in recents and in "Quick Access" in windows 10 when opening Rstudio projects always brows to the actual mapped drive letter or set up a short cut that explicitly does that.
Watch out used open file in recents and in "Quick Access" in windows 10 when opening Rstudio projects always brows to the actual mapped drive letter or set up a short cut that explicitly does that.
Thank you!! This solved it for me.
I'm having the same issue on a Mac. Would anyone be able to assist on how to map the files properly to overcome this glitch since there is no C:/ drive? It seems like the solution is possible but I can't get it to work on my system! Thank you!
You can use "~/" as a shortcut for home directory, or you can refer to the absolute path, which will be something like /Users/Vicki , /Users/[your username on the machine]
Joe Wasserman joe.wasserman@gmail.com https://www.joewasserman.com
On Thu, Jan 2, 2020 at 3:56 PM vickibendus notifications@github.com wrote:
I'm having the same issue on a Mac. Would anyone be able to assist on how to map the files properly to overcome this glitch since there is no C:/ drive? It seems like the solution is possible but I can't get it to work on my system! Thank you!
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rstudio/rmarkdown/issues/1268?email_source=notifications&email_token=AH4TPUVHQKESIT2NTR3MX43Q3ZIHBA5CNFSM4ESHCZKKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEH7MM3I#issuecomment-570345069, or unsubscribe https://github.com/notifications/unsubscribe-auth/AH4TPURW7GAVR35JJ7ZDU53Q3ZIHBANCNFSM4ESHCZKA .
Shoot that doesn't seem to be a solution for me then. My current working directory is "/Users/vickibendus/Desktop/R Materials/Soccer Reports", which appears to be the correct type of path. I'll have to keep searching for a way around this problem.
None of the solutions above have worked for me unfortunately. In my case, what confuses me is that the .Rmd file is converted to a .knit.md file which I cannot find (perhaps it's deleted since the rendering fails. My other question is why does pandoc get applied to a .utf8.md file if what was explicitly created was instead a .knit.md file. Perhaps a .utf8.md file is also created but I also cannot find this file (again it may just be deleted when rendering fails).
I've taken the long pandoc command and have manually edited the paths to look more like C:/etc. This would work fine except that these .knit.md and .utf8.md files are not available so the error regarding openBinaryFile seems to be simply because it can't find these files (perhaps because they're automatically deleted but maybe not). Does anyone know where these files would temporarily exist at least?
@haroldgil To avoid deletion of the intermediate files, you may call rmarkdown::render('matt.Rmd', clean = FALSE)
.
I found an easy solution in my case worth sharing. Again the problem seems to stem from the odd representation of a network drive directory. This directory comes into play in the pandoc command because pandoc() seems to indirectly rely on Sys.getenv('R_USER')
.
This directory is equivalent to my directory H:/
Thus I created a .Renviron file in H:/ and included in it the single entry R_USER=H:/
I restarted RStudio and the knitting works fine now. Also, looking at the pandoc command, all the weird references to the long/weird representation of H:/ (see image) have been replaced simply with H:/ indicating to me that pandoc() indeed relies on the value of Sys.getenv('R_USER')
.
I tried most of the suggestions above and it did not work.
I did know I had two paths in .libpaths() and I suspected it was causing the problem. One of the paths It referred to one old R/RStudio (it happened to be on network disk H in my case). It was almost fully deleted folder with a few files, and it was causing the problem.
How to navigate to/find paths is explained here: https://www.accelebrate.com/library/how-to-articles/r-rstudio-library I just did this: .libPaths(myPaths[2]) # keep only an importnat path (to local disk, in my case) and removed unwanted directory on disk H.
Then, I checked in "Install packages" of RStudio that the second path has disappeared and is absent.
After that KNIT-ing one my one I found all the missing packages it complained about. Those which my primary path to C drive did not have. After I installed it, it is working.
It is funny and sad at the same time, even though second path was not default, it was the root of the problem. Only removing files on H and also paths to that H in .libpaths() - HELPED!
I found an easy solution in my case worth sharing. Again the problem seems to stem from the odd representation of a network drive directory. This directory comes into play in the pandoc command because pandoc() seems to indirectly rely on
Sys.getenv('R_USER')
.This directory is equivalent to my directory H:/ Thus I created a .Renviron file in H:/ and included in it the single entry R_USER=H:/ I restarted RStudio and the knitting works fine now. Also, looking at the pandoc command, all the weird references to the long/weird representation of H:/ (see image) have been replaced simply with H:/ indicating to me that pandoc() indeed relies on the value of
Sys.getenv('R_USER')
.
I plumbed the depths of Google to find a fix for this problem (on Windows 10) and this was it. My Sys.getenv("R_USER")
location was a network drive, as was the (different) location of my R project and the .Rmd
file I was trying to knit. My steps to fix were:
Sys.getenv("R_USER")
location to my H:/ directory (pretty much any letter would've done).usethis::edit_r_environ()
and added R_USER=H:/
to it.Sys.getenv("R_USER")
to ensure it was now H:/
.Hope this is able to help someone else in future.
I found an easy solution in my case worth sharing. Again the problem seems to stem from the odd representation of a network drive directory. This directory comes into play in the pandoc command because pandoc() seems to indirectly rely on
Sys.getenv('R_USER')
. This directory is equivalent to my directory H:/ Thus I created a .Renviron file in H:/ and included in it the single entry R_USER=H:/ I restarted RStudio and the knitting works fine now. Also, looking at the pandoc command, all the weird references to the long/weird representation of H:/ (see image) have been replaced simply with H:/ indicating to me that pandoc() indeed relies on the value ofSys.getenv('R_USER')
.I plumbed the depths of Google to find a fix for this problem (on Windows 10) and this was it. My
Sys.getenv("R_USER")
location was a network drive, as was the (different) location of my R project and the.Rmd
file I was trying to knit. My steps to fix were:
- Mapped the
Sys.getenv("R_USER")
location to my H:/ directory (pretty much any letter would've done).- Ran
usethis::edit_r_environ()
and addedR_USER=H:/
to it.- Restarted RStudio.
- Re-ran
Sys.getenv("R_USER")
to ensure it was nowH:/
.- Mapped the location of my R project to my G:/ directory (again most letters would've done).
- Opened the R project from my G:/ directory (either via the shortcut or by typing the path out; both worked for me) instead of the network drive.
Hope this is able to help someone else in future.
@jackhannah95 @haroldgil Looking at your responses, it appears that the steps you did would be the solution to my issue. On my end, everything works fine; however, when a third-party contractor executes the same scripts I'm using in a SharePoint site, he's getting the error. Before the error, it appears the script is looking at a UNC path where the rmarkdown package is installed rather than a network drive. In addition, I checked the contractor's libPaths() and it appears that it's showing as a UNC path rather than the mapped network drive format.
To confirm your scenarios, did converting the UNC path to a mapped network drive resolve your issues? Also, up to what UNC path subfolder did you map to the network drive? e.g., only up to the user name or up to the actual R subfolder?
@geopang Yeah converting UNC paths to mapped network drives resolved my issues. They resolved the issues for me alone however - any other user trying to access my scripts on a shared network drive had to convert any UNC paths associated with their account to mapped network drives as well.
I mapped up to username level. It'd probably work at a lower level too but I think mapping the top level drive makes life easier.
I found an easy solution in my case worth sharing. Again the problem seems to stem from the odd representation of a network drive directory. This directory comes into play in the pandoc command because pandoc() seems to indirectly rely on
Sys.getenv('R_USER')
. This directory is equivalent to my directory H:/ Thus I created a .Renviron file in H:/ and included in it the single entry R_USER=H:/ I restarted RStudio and the knitting works fine now. Also, looking at the pandoc command, all the weird references to the long/weird representation of H:/ (see image) have been replaced simply with H:/ indicating to me that pandoc() indeed relies on the value ofSys.getenv('R_USER')
.I plumbed the depths of Google to find a fix for this problem (on Windows 10) and this was it. My
Sys.getenv("R_USER")
location was a network drive, as was the (different) location of my R project and the.Rmd
file I was trying to knit. My steps to fix were:
- Mapped the
Sys.getenv("R_USER")
location to my H:/ directory (pretty much any letter would've done).- Ran
usethis::edit_r_environ()
and addedR_USER=H:/
to it.- Restarted RStudio.
- Re-ran
Sys.getenv("R_USER")
to ensure it was nowH:/
.- Mapped the location of my R project to my G:/ directory (again most letters would've done).
- Opened the R project from my G:/ directory (either via the shortcut or by typing the path out; both worked for me) instead of the network drive.
Hope this is able to help someone else in future.
This solution worked for me. Thanks @jackhannah95!
For those having problems with parallel render()
(pandoc: *.html: openFile: does not exist (No such file or directory)
, see my solution https://github.com/rstudio/rmarkdown/issues/1632#issuecomment-545824711
This workaround works for Win 10 with network drive. Connect to the network drive using the file browser in Rstudio. Choose any folder. Rstudio now has the necessary permission and everything knits perfectly.
R version 3.6.1 (2019-07-05) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows Server x64 (build 14393)
Matrix products: default
locale:
[1] LC_COLLATE=Danish_Denmark.1252 LC_CTYPE=Danish_Denmark.1252 LC_MONETARY=Danish_Denmark.1252 LC_NUMERIC=C
[5] LC_TIME=Danish_Denmark.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.5.0 tools_3.6.1 yaml_2.2.1 rmarkdown_2.2 knitr_1.28 xfun_0.14 digest_0.6.25
[9] rlang_0.4.8 evaluate_0.14
Hi everyone,
Pandoc has made some new fix regarding UNC path on Windows (https://github.com/jgm/pandoc/issues/5127). I wonder if this could be the fix for this issue we have with Pandoc and Rmarkdown.
is someone having the issue able to use Pandoc 2.11 (or above) and try to knit a document ?
Pandoc 2.11+ is shipped with the RStudio 1.4 Preview is one of you is using it. That would be the easiest way to have access to this version as an R user. Otherwise, it is easy to install a release (https://github.com/jgm/pandoc/releases) but you would need to add it to PATH or use rmarkdown::find_pandoc
before calling rmarkdown::render
Thank you !
@cderv I am quite new at this, but I installed pandoc 2.11, used rmarkdown::find_pandoc
(found 2.11), called rmarkdown::render
, and got the same error, unfortunately. I am using Windows 10.
The above-described workaround of mapping R_USER to a network drive does work.
@MTF-UMass thanks a lot ! That is really good to know - that means unfortunately Pandoc still have the issue. Can you paste the error you get with Pandoc 2.11 to see if anything has changed ?
@cderv The error I get is: pandoc.exe: \\: openBinaryFile: does not exist (No such file or directory) Error: pandoc document conversion failed with error 1 Execution halted
pandoc is 2.11.2
Can you share the whole pandoc command, which should be printed in the Rmarkdown pane or console ? I would like to see which path fails exactly. Thanks
@cderv absolutely, sorry about that
"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS 03-params.utf8.md --to html4 --from markdown+autolink_bare_uris+tex_math_single_backslash --output 03-params.html --lua-filter "\\umaaffp\users\mtaftferguso\R\win-library\4.0\rmarkdown\rmarkdown\lua\pagebreak.lua" --lua-filter "\\umaaffp\users\mtaftferguso\R\win-library\4.0\rmarkdown\rmarkdown\lua\latex-div.lua" --email-obfuscation none --self-contained --standalone --section-divs --template "\\umaaffp\users\mtaftferguso\R\win-library\4.0\rmarkdown\rmd\h\default.html" --no-highlight --variable highlightjs=1 --variable "theme:bootstrap" --include-in-header "C:\Users\MTAFTF~1\AppData\Local\Temp\RtmpKomXKh\rmarkdown-str42503354e80.html" --mathjax --variable "mathjax-url:https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"
pandoc.exe: \\: openBinaryFile: does not exist (No such file or directory)
Error: pandoc document conversion failed with error 1
Execution halted
Thanks a lot for your help !
I am having the same problem on mac.
rmarkdown::render("Analysis/presentation/presentation.Rmd")
#> pandoc: Documentation/references.bib: openBinaryFile: does not exist (No such file or directory)
#> Error: pandoc document conversion failed with error 1
knitr::knit2pdf("Analysis/presentation/presentation.Rmd")
#> Error in tinytex::latexmk(basename(out), engine = compiler, ...) :
#> The input file 'presentation.md' does not have the .tex extension
@Eyayaw I don't think this is the same issue. i.e an issue with network drive as the last and recent comments are showing.
Pandoc will throw this error: openBinaryFile: does not exist (No such file or directory)
when a file needed for the rendering is not found - but sometimes it is an indicator of an issue in the source file.
In your case, Pandoc is warning that the bib file referenced in your Rmd document is not found. You should check the bibliography
field and the path of the file. Can you confirm that everything is ok on this side ?
Also about knitr:::knit2pdf
, I believe this is for Rnw or Rrst document. see ?knit2pdf
.
Thank you.
@Eyayaw I don't think this is the same issue. i.e an issue with network drive as the last and recent comments are showing.
Pandoc will throw this error:
openBinaryFile: does not exist (No such file or directory)
when a file needed for the rendering is not found - but sometimes it is an indicator of an issue in the source file.In your case, Pandoc is warning that the bib file referenced in your Rmd document is not found. You should check the
bibliography
field and the path of the file. Can you confirm that everything is ok on this side ?Also about
knitr:::knit2pdf
, I believe this is for Rnw or Rrst document. see?knit2pdf
.Thank you.
@cderv Thank you for the quick explanation. Yeah, it works when I copy the 'references.bib' file to the folder where the '.Rmd' file lives. However, I still find it puzzling why rmarkdown/pandoc
does not find the Documentation/references.bib
file. In fact, I set the Evaluate Chunks in Directory option to Project
and I expect that to work. I am missing something here? Thank you.
Hi,
I am not sure if is the same issue, but when I execute a script in RStudio in Remote Session on Machine Learning Server to create a Rmarkdown (pdf) file I got an error.
=======
Error:
Hi @leonvictorlima,
I am not sure if is the same issue
it is always preferred to open a new issue that could link to this one instead of commenting in another issue because discussion will always be mixed up.
It would be best to follow if you opened a new issue and use correct formatting at least for code block part. See issue guide: https://yihui.org/issue/
By the way, when the same code is executed inside the Server (server console) this works fine!
It probably means that there is no issue with rmarkdown otherwise it would not work in R console I think.
when I execute a script in RStudio in Remote Session on Machine Learning Server
It could come from something in RStudio IDE or the ML server. Are you using Pro version of those services ? You could ask there support if so to help find the issue.
Anyway, rmarkdown issue board is not the best place for generic question. It is a place for issue found on the package, or feature request for the package. It would be better to ask in place like https://community.rstudio.com if you don't have access to paid support regarding your tools.
Unfortunately, I don't have anything to test and look more into it. And I don't think this is the same issue the one discussed in this GH ticket.
Hello, @cderv ,
Thank you a lot for your comments. I will check it carefully in order to not mix this one and have a topic specific for it!
In addition, I am gonna ask support for them as well.
I agree with you when say this is not a directly package issue. Maybe it is something in the middle, I mean, among the execution on Server instance and my local. But, I need more tests to confirm it.
Thank you, take care!
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:
https://github.com/jgm/pandoc/commit/26ed7fb4f9e95a00607ab9cfddc48267c717d24b
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.
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.
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:
Rmarkdown version:
pandoc version
sessionInfo():
here is the shiny server log: