postcards icon indicating copy to clipboard operation
postcards copied to clipboard

Problem fetching bootstrap

Open elinw opened this issue 3 years ago • 14 comments

Back on November 27 I was able to create postcards on RStudioServer. But now when I try it with the current version of Postcards I get

output file: jolla.knit.md

Could not fetch https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css HttpExceptionRequest Request { host = "stackpath.bootstrapcdn.com" port = 443 secure = True requestHeaders = [] path = "/bootstrap/4.5.0/css/bootstrap.min.css" queryString = "" method = "GET" proxy = Nothing rawBody = False redirectCount = 10 responseTimeout = ResponseTimeoutDefault requestVersion = HTTP/1.1 proxySecureMode = ProxySecureWithConnect } (ConnectionFailure Network.Socket.getAddrInfo (called with preferred socket type/protocol: AddrInfo {addrFlags = [AI_ADDRCONFIG], addrFamily = AF_UNSPEC, addrSocketType = Stream, addrProtocol = 0, addrAddress = 0.0.0.0:0, addrCanonName = Nothing}, host name: Just "stackpath.bootstrapcdn.com", service name: Just "443"): does not exist (Name does not resolve)) Error: pandoc document conversion failed with error 61 Execution halted

Maybe this has to do with cross-site scripting or something like that. Do you have any thoughts?

elinw avatar Jan 30 '21 15:01 elinw

Was this on a hosted RStudioServer session or were you running it locally?

seankross avatar Jan 31 '21 03:01 seankross

Hosted. I'm pretty sure the answer is to detect whether you are on RStudioServer and then, if so, not do the injections that were added.

elinw avatar Jan 31 '21 04:01 elinw

Which injections exactly? This sounds like something I can tweak in the pandoc arguments.

seankross avatar Jan 31 '21 04:01 seankross

So I tried deleting the actual not injected and

    $for(header-includes)$
      $header-includes$
    $endfor$

And the one at the end, but I don't think that's the issue. (Just a coincidence of timing maybe).

elinw avatar Jan 31 '21 04:01 elinw

So what I was able to do is to remove the and

elinw avatar Jan 31 '21 20:01 elinw

https://github.com/seankross/postcards/compare/main...elinw:rsserver?expand=1 Seems to have things working on my server ... I don't know how to know if there is a more general problem or if it is my particular combination of libraries, version and server.

Having done this, it seems like there are still problems with jolla-blue if I make a lot of postcards in a row. (took out jolla which seems to work now but jolla blue is not picking up the css). update: for some reason when jolla-blue knits it is stripping the "https://" from the bootstrap and google fonts links. So strange, I do not see anything obvious that would cause that.

elinw avatar Feb 01 '21 04:02 elinw

Hi, I also encounter similar issues.

Below is my sessionInfo.

==================================================================

sessioninfo::session_info()

  • Session info --------------------------------------------------------------------------------------- setting value
    version R version 4.0.3 (2020-10-10) os Windows 10 x64
    system x86_64, mingw32
    ui RStudio
    language (EN)
    collate English_United States.1252
    ctype English_United States.1252
    tz America/New_York
    date 2021-02-02

  • Packages ------------------------------------------------------------------------------------------- ! package * version date lib source
    assertthat 0.2.1 2019-03-21 [1] CRAN (R 4.0.0) cli 2.2.0 2020-11-20 [1] CRAN (R 4.0.3) crayon 1.3.4 2017-09-16 [1] CRAN (R 4.0.0) D digest 0.6.27 2020-10-24 [1] CRAN (R 4.0.3) evaluate 0.14 2019-05-28 [1] CRAN (R 4.0.0) fansi 0.4.2 2021-01-15 [1] CRAN (R 4.0.3) D glue 1.4.2 2020-08-27 [1] CRAN (R 4.0.2) htmltools 0.5.1.1 2021-01-22 [1] CRAN (R 4.0.3) knitr 1.31 2021-01-27 [1] CRAN (R 4.0.3) postcards * 0.2.0 2021-01-06 [1] CRAN (R 4.0.3) rlang 0.4.10 2020-12-30 [1] CRAN (R 4.0.3) rmarkdown 2.6 2020-12-14 [1] CRAN (R 4.0.3) rstudioapi 0.13 2020-11-12 [1] CRAN (R 4.0.3) sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 4.0.0) withr 2.4.1 2021-01-26 [1] CRAN (R 4.0.3) xfun 0.20 2021-01-06 [1] CRAN (R 4.0.3) yaml 2.2.1 2020-02-01 [1] CRAN (R 4.0.0)

[1] C:/Users/phere/Dropbox/My PC (DESKTOP-5O211OK)/Documents/R/win-library/4.0 [2] C:/Program Files/R/R-4.0.3/library

D -- DLL MD5 mismatch, broken installation.

==============================================================

And error messages are like below:

Could not fetch https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css HttpExceptionRequest Request { host = "stackpath.bootstrapcdn.com" port = 443 secure = True requestHeaders = [] path = "/bootstrap/4.5.0/css/bootstrap.min.css" queryString = "" method = "GET" proxy = Nothing rawBody = False redirectCount = 10 responseTimeout = ResponseTimeoutDefault requestVersion = HTTP/1.1 } (InternalException (HandshakeFailed (Error_Misc "Network.Socket.recvBuf: invalid argument (Invalid argument)"))) Error: pandoc document conversion failed with error 61 Execution halted

pherephobia avatar Feb 03 '21 01:02 pherephobia

Hey @elinw and @pherephobia in the environment where you are encountering this error what version of pandoc are you using? (check with rmarkdown::pandoc_version())

seankross avatar Feb 03 '21 21:02 seankross

@seankross When I encounter the issue, I reinstalled the markdown pandoc using

  • remotes::install_github("rstudio/rmarkdown")

And the version is like below:

rmarkdown::pandoc_version() [1] ‘2.11.2’

pherephobia avatar Feb 03 '21 22:02 pherephobia

@pherephobia that is good for me to know, so now is it still not working?

seankross avatar Feb 03 '21 22:02 seankross

@seankross It still shows the same error when I try to knit the index.Rmd.

Could not fetch https://code.jquery.com/jquery-3.5.1.slim.min.js HttpExceptionRequest Request { host = "code.jquery.com" port = 443 secure = True requestHeaders = [] path = "/jquery-3.5.1.slim.min.js" queryString = "" method = "GET" proxy = Nothing rawBody = False redirectCount = 10 responseTimeout = ResponseTimeoutDefault requestVersion = HTTP/1.1 } (InternalException (HandshakeFailed (Error_Misc "Network.Socket.recvBuf: invalid argument (Invalid argument)"))) Error: pandoc document conversion failed with error 61 Execution halted

pherephobia avatar Feb 03 '21 22:02 pherephobia

@pherephobia would you mind trying the following?

  1. Install postcards from a new branch: remotes::install_github("seankross/postcards@self-contained")
  2. Restart R
  3. Change the yaml like so:
output:
  postcards::jolla:
    self_contained: false
  1. Then try to knit again.

seankross avatar Feb 03 '21 22:02 seankross

SOLVED: Dear @seankross, It knitted HTML but it broke.

When I changed my directory to local, it works perfectly. I have used my project in Dropbox before.

pherephobia avatar Feb 03 '21 22:02 pherephobia

SOLVED: Dear @seankross, It knitted HTML but it broke.

When I changed my directory to local, it works perfectly. I have used my project in Dropbox before.

(ConnectionFailure Network.Socket.getAddrInfo (called with preferred socket type/protocol: AddrInfo {addrFlags = [AI_ADDRCONFIG], addrFamily = AF_UNSPEC, addrSocketType = Stream, addrProtocol = 0, addrAddress = 0.0.0.0:0, addrCanonName = Nothing}, host name: Just "www.youtube.com", service name: Just "443"): does not exist (Try again))
错误: pandoc document conversion failed with error 61

Based on the error above, that's socket 443 issue...

443端口:即网页浏览端口,主要是用于HTTPS服务,是提供加密和通过安全端口传输的另一种HTTP。

443端口:HTTPS服务一般是通过SSL(安全套接字层)来保证安全性的,但是SSL漏洞可能会受到黑客的攻击,比如可以黑掉在线银行系统,盗取信用卡账号等

https://zhuanlan.zhihu.com/p/99950177

https://sectigostore.com/blog/port-443-everything-you-need-to-know-about-https-443


(ConnectionFailure Network.Socket.getAddrInfo (called with preferred socket type/protocol: AddrInfo {addrFlags = [AI_ADDRCONFIG], addrFamily = AF_UNSPEC, addrSocketType = Stream, addrProtocol = 0, addrAddress = 0.0.0.0:0, addrCanonName = Nothing}, host name: Just "stackpath.bootstrapcdn.com", service name: Just "443"): does not exist (Name does not resolve))
Error: pandoc document conversion failed with error 61
Execution halted

SOLVED: Dear @seankross, It knitted HTML but it broke.

When I changed my directory to local, it works perfectly. I have used my project in Dropbox before.

https://github.com/seankross/postcards/issues/29#issuecomment-772869864

That's same error which is socket 443 problem as well... The problem for me is that my local Linux 🐧 same with RStudio.Cloud... Somebody take a look and discuss?

  • Believed that the socket 443 has love scammer concerns
  • Don't get involve my families (all ✈️MH17 victims since Ukraine event which do not get involved in gambling nor scammer) and I am also victim used to cheat by recruitment agency to Philippines year 2019, I am not scammer but only quantitative trading in financial market (but not gambling market nor scammer).

englianhu avatar Mar 13 '22 09:03 englianhu