rstudio / rmarkdown

Dynamic Documents for R
https://rmarkdown.rstudio.com
GNU General Public License v3.0
2.88k stars 974 forks source link

html_document not working with latest version of pandoc (1.13.0.1) #228

Closed justacec closed 9 years ago

justacec commented 10 years ago

I installed the most recent version of pandoc (version 1.13.0.1) so that I could experiment with the docx header/footer support. After installing that, I am unable to generate html_documents. I am on a Win7 machine with the following versions of software:

RStudio: 0.98.1036 RMarkdown: 0.2.64 knitr: 1.6

The Rmd file that I attempted to compile is:


---
title: "Test Document"
output: html_document

---

This is a test

The output from the RMarkdown window is:

  |.................................................................| 100%
  ordinary text without R code

processing file: localizationAccuracy.Rmd
output file: localizationAccuracy.knit.md

C:/Users/XXXX/AppData/Local/Pandoc/pandoc localizationAccuracy.utf8.md --to html --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --output localizationAccuracy.html --smart --email-obfuscation none --self-contained --standalone --section-divs --template C:\Users\XXXX\Documents\R\win-library\3.1\rmarkdown\rmd\h\default.html --variable theme:bootstrap --include-in-header C:\Users\XXXX\AppData\Local\Temp\1\Rtmp6DGqNH\rmarkdown-str1d1071531514.html --mathjax --variable mathjax-url:https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML --no-highlight --variable highlightjs=C:\Users\XXXX\Documents\R\win-library\3.1\rmarkdown\rmd\h\highlight 
pandoc.exe: Could not fetch C:\Users\XXXX\Documents\R\win-library\3.1\rmarkdown\rmd\h\jquery-1.11.0\jquery.min.js
InvalidUrlException "C:%5CUsers%5CXXXX%5CDocuments%5CR%5Cwin-library%5C3.1%5Crmarkdown%5Crmd%5Ch%5Cjquery-1.11.0%5Cjquery.min.js" "Invalid scheme"
Error: pandoc document conversion failed with error 67
In addition: Warning message:
running command 'C:/Users/XXXX/AppData/Local/Pandoc/pandoc localizationAccuracy.utf8.md --to html --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --output localizationAccuracy.html --smart --email-obfuscation none --self-contained --standalone --section-divs --template C:\Users\XXXX\Documents\R\win-library\3.1\rmarkdown\rmd\h\default.html --variable theme:bootstrap --include-in-header C:\Users\XXXX\AppData\Local\Temp\1\Rtmp6DGqNH\rmarkdown-str1d1071531514.html --mathjax --variable mathjax-url:https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML --no-highlight --variable highlightjs=C:\Users\XXXX\Documents\R\win-library\3.1\rmarkdown\rmd\h\highlight' had status 67 
Execution halted
liuyadong commented 10 years ago

I have the same problem, but no error if uninstalled the pandoc(version1.13.0.1).

jmcphers commented 10 years ago

It looks like there's been a change in how pandoc handles paths on Windows, so we'll need to update rmarkdown to output paths in a format it accepts.

This happens while pandoc is bundling up everything into a single standalone file (i.e. self-contained: yes). You can work around it until we have a fix in by setting self_contained: no:

---
title: "Test Document"
output: 
  html_document:
    self_contained: no
---
justacec commented 10 years ago

Great! Thanks for the info on the temporary workaround...

jmcphers commented 10 years ago

Just pushed a fix, let me know if that doesn't resolve it for you. I've also opened an issue on the pandoc side: https://github.com/jgm/pandoc/issues/1558

jgm commented 10 years ago

I'm pretty sure this problem is due to the bug reported in jgm/pandoc#1558, which is fixed in HEAD and will be fixed in the next point release.

jjallaire commented 10 years ago

Great, thanks for letting us know that is resolved. @jmcphers perhaps we should revert our workaround once the pandoc fix is available in the public binaries? Reopening this case in the event that we want to do that.

jmcphers commented 10 years ago

Yes, we should roll this back after the public binaries are out.

ojperezl commented 8 years ago

I have the same problem. I had "?" in the chunk header: "'{r Which types of events are most harmful to health population?} ". Only delete '? " and works.

jules32 commented 7 years ago

Hi @jmcphers and @jjallaire,

I wanted to let you know that we just started getting a similar error, but solved it with your self_contained: no fix from above. I have pandoc v1.19.2, rmarkdown v1.3, RStudio v1.0.136.

Without self_contained: no, I can still knit but pandoc was unable to fetch the pngs from Google Drawings (which has not been a problem in the past). Here is the error:

output file: modify_goal_models_1.knit.md

pandoc: Could not fetch https://docs.google.com/drawings/d/1adaERJXxzBxCxqBtmvp8uf5g68mHFfakR-Edbh2wwWo/pub?w=1677&h=687
TlsExceptionHostPort (HandshakeFailed Error_EOF) "docs.google.com" 443
Error: pandoc document conversion failed with error 67
Execution halted

Hope you're doing well. RMarkdown is seriously upgrading our science, thank you!

jjallaire commented 7 years ago

It may be that the version of pandoc we have bundled can no longer talk the SSL protocol required to talk to the Google Docs server. What happens if you install pandoc using the main pandoc installer from here: https://github.com/jgm/pandoc/releases/tag/1.19.2

jules32 commented 7 years ago

I just this morning installed pandoc 1.19.2 using the pandoc-1.19.2-osx.pkg installer, is that what you were asking?

Earlier, with pandoc 1.11.1 I had a similar but more verbose error message:

image

jjallaire commented 7 years ago

Hmmm...I wonder if it's actually an error in pandoc 1.19.2 then?

On Thu, Feb 2, 2017 at 3:29 PM, Julia Stewart Lowndes < notifications@github.com> wrote:

I just this morning installed pandoc 1.19.2 using the pandoc-1.19.2-osx.pkg installer, is that what you were asking?

Earlier, with pandoc 1.11.1 I had a similar but more verbose error message:

[image: image] https://cloud.githubusercontent.com/assets/5891909/22567008/07b13b74-e943-11e6-83e2-766e77909016.png

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/rstudio/rmarkdown/issues/228#issuecomment-277073801, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGXx0r79mOw440Na-jgfzbidosIuB29ks5rYjyTgaJpZM4CZ9dZ .

jules32 commented 7 years ago

Let me know if you need me to test out anything. I don't have 1.19.2 installed on my other computer yet

jjallaire commented 7 years ago

I think it's almost certainly a problem in pandoc (that's pandoc's error message not ours) so trying different version of pandoc is the way to go. If you can reproduce the problem w/ pandoc 1.19.2 it's also worth filing a bug report.

On Thu, Feb 2, 2017 at 3:34 PM, Julia Stewart Lowndes < notifications@github.com> wrote:

Let me know if you need me to test out anything. I don't have 1.19.2 installed on my other computer yet

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/rstudio/rmarkdown/issues/228#issuecomment-277075228, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGXx-DhUJ7GPENWxc4wN47GbPvBen6_ks5rYj3dgaJpZM4CZ9dZ .

jules32 commented 7 years ago

OK thanks!

On Thu, Feb 2, 2017 at 12:35 PM, JJ Allaire notifications@github.com wrote:

I think it's almost certainly a problem in pandoc (that's pandoc's error message not ours) so trying different version of pandoc is the way to go. If you can reproduce the problem w/ pandoc 1.19.2 it's also worth filing a bug report.

On Thu, Feb 2, 2017 at 3:34 PM, Julia Stewart Lowndes < notifications@github.com> wrote:

Let me know if you need me to test out anything. I don't have 1.19.2 installed on my other computer yet

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <https://github.com/rstudio/rmarkdown/issues/228#issuecomment-277075228 , or mute the thread https://github.com/notifications/unsubscribe-auth/AAGXx- DhUJ7GPENWxc4wN47GbPvBen6_ks5rYj3dgaJpZM4CZ9dZ

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rstudio/rmarkdown/issues/228#issuecomment-277075547, or mute the thread https://github.com/notifications/unsubscribe-auth/AFnnRVL4Hy8YdkY1c7GDeQa0UZfDYFzsks5rYj4jgaJpZM4CZ9dZ .

--

Julia Stewart Lowndes, PhD Ocean Health Index National Center for Ecological Analysis and Synthesis (NCEAS) University of California, Santa Barbara (UCSB) website http://jules32.github.io/ • ohi-science http://ohi-science.org/ • github https://github.com/jules32 • twitter https://twitter.com/juliesquid

RMHogervorst commented 7 years ago

This is still happening on pandoc 19.2.1 (in a relatively new daily Rstudio Version 1.1.361) using windows 10,

Weird thing is, there is a markdown document as result. It works just fine, but the tls handshaky thing fails in pandoc

TlsExceptionHostPort (HandshakeFailed Error_EOF) "img.shields.io" 443
Error: pandoc document conversion failed with error 67

this is the entire command:

running command '"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS README.md --to html --from markdown_github-ascii_identifiers --output README.html --standalone --self-contained --highlight-style pygments --template "D:\RmhDocs\Documents\R\win-library\3.4\rmarkdown\rmarkdown\templates\github_document\resources\preview.html" --variable "github-markdown-css:D:\RmhDocs\Documents\R\win-library\3.4\rmarkdown\rmarkdown\templates\github_document\resources\github.css" --email-obfuscation none' had status 67

ghost commented 7 years ago

I only get a similar error when I add css styling in ioslides.Rmd e.g., css: "complex-css.css"

pandoc.exe: Could not fetch https://fonts.googleapis.com/css?family=Roboto HttpExceptionRequest Request { host = "fonts.googleapis.com" port = 443 secure = True requestHeaders = [] path = "/css" queryString = "?family=Roboto" method = "GET" proxy = Nothing rawBody = False redirectCount = 10 responseTimeout = ResponseTimeoutDefault requestVersion = HTTP/1.1 } (InternalException (HandshakeFailed Error_EOF)) Error: pandoc document conversion failed with error 67 In addition: Warning message: running command '"F:/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS 02_05_ioslides.utf8.md --to html --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output 02_05_ioslides.html --smart --email-obfuscation none --self-contained --variable transition=0.4 --template "F:\R-3.4.1\library\rmarkdown\rmd\ioslides\default.html" --include-in-header "C:\Users\mkras\AppData\Local\Temp\Rtmpg7Xlkd\rmarkdown-stra3c464933b6.html" --mathjax --variable "mathjax-url:https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"' had status 67 Execution halted

dchiu911 commented 6 years ago

It would be nice if the self_contained option was available for the github_document output format. On my mac, the following test-badge.Rmd knits successfully, when attempting to add a CRAN badge. The issue isn't that major, as badges are usually placed in README.Rmd, which is added to .Rbuildignore. But it's just annoying when I knit the README.Rmd and the HTML preview fails to render.

---
output:
  html_document:
    self_contained: no
---
[![CRAN status](http://www.r-pkg.org/badges/version/dplyr)](https://cran.r-project.org/package=dplyr)

but when changed to github_document it fails

---
output:
  github_document
---
[![CRAN status](http://www.r-pkg.org/badges/version/dplyr)](https://cran.r-project.org/package=dplyr)

with error message

/Applications/RStudio.app/Contents/MacOS/pandoc/pandoc +RTS -K512m -RTS test-badge.utf8.md --to markdown_github-ascii_identifiers --from markdown+autolink_bare_uris+tex_math_single_backslash --output test-badge.md --standalone --template /Users/dchiu/Library/R/3.4/library/rmarkdown/rmarkdown/templates/github_document/resources/default.md 
/Applications/RStudio.app/Contents/MacOS/pandoc/pandoc +RTS -K512m -RTS test-badge.md --to html --from markdown_github-ascii_identifiers --output test-badge.html --standalone --self-contained --highlight-style pygments --template /Users/dchiu/Library/R/3.4/library/rmarkdown/rmarkdown/templates/github_document/resources/preview.html --variable 'github-markdown-css:/Users/dchiu/Library/R/3.4/library/rmarkdown/rmarkdown/templates/github_document/resources/github.css' --email-obfuscation none 
pandoc: Could not fetch http://www.r-pkg.org/badges/version/dplyr
TlsExceptionHostPort (HandshakeFailed Error_EOF) "www.r-pkg.org" 80
Error: pandoc document conversion failed with error 67
Execution halted

Software versions

system("pandoc --version")
# pandoc 1.19.2.1
# Compiled with pandoc-types 1.17.0.4, texmath 0.9, skylighting 0.1.1.4
# Default user data directory: /Users/dchiu/.pandoc
# Copyright (C) 2006-2016 John MacFarlane
# Web:  http://pandoc.org
# This is free software; see the source for copying conditions.
# There is no warranty, not even for merchantability or fitness
# for a particular purpose.
packageDescription("rmarkdown")$Version
# [1] "1.8"
sessioninfo::platform_info()
# setting  value                       
# version  R version 3.4.3 (2017-11-30)
# os       macOS High Sierra 10.13.3   
# system   x86_64, darwin15.6.0        
# ui       RStudio                     
# language (EN)                        
# collate  en_CA.UTF-8                 
# tz       America/Vancouver           
# date     2018-02-22  
rstudioapi::getVersion()
# [1] ‘1.1.423’
dchiu911 commented 6 years ago

I updated to

system("pandoc --version")
# pandoc 2.1.1
# Compiled with pandoc-types 1.17.3.1, texmath 0.10.1, skylighting 0.6
# Default user data directory: /Users/dchiu/.pandoc
# Copyright (C) 2006-2018 John MacFarlane
# Web:  http://pandoc.org
# This is free software; see the source for copying conditions.
# There is no warranty, not even for merchantability or fitness
# for a particular purpose.

using brew install pandoc and now it works.

ibecav commented 6 years ago

Had the same problem on my Mac and found that @dchiu911 solution of installing a newer version of Pandoc via Brew solved the problem

rstudioapi::getVersion() [1] ‘1.1.383’ sessionInfo() R version 3.4.3 (2017-11-30) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: macOS High Sierra 10.13.3

github-actions[bot] commented 4 years ago

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.