We tried updating pandoc as suggested but the error persisted. However, we found a solution. In case others have the same issue I'm going to post this solution. We get users to create a .Renviron file (tutorial here ). This file sets the library path to the mapped drive rather than the UNC path. In our case (see original question for why) the file contains this text: ``` R_LIBS_USER = "N:/Documents/R/win-library/3.6" R_USER = "N:/Documents" ``` ITS managed to use an app management system that creates this file automatically for users when the boot up RStudio, however, if users need to create this file themselves, you can get them to run the following script (edited to fit your drive location): ``` user_renviron = path.expand(file.path("~", ".Renviron")) if(!file.exists(user_renviron)) # check to see if the file already exists file.create(user_renviron) conn = file(user_renviron) writeLines('R_LIBS_USER="N:/Documents/R/win-library/3.6"\nR_USER="N:/Documents"', con = conn) close(conn) ``` Knitting works like a charm now. andy On Monday, 8 April 2019 15:57:31 UTC+1, Andy Field wrote: > > I work at a UK university where I teach R Studio and R Markdown. We have a > problem with knitting Markdown documents to HTML when students are working > on networked university PCs. > The problem in brief > > - R Markdown documents knitted to html fail with with error 67 > - Changing the YAML to self_contained: no results in a successfully > knitted document, but this doesn’t help us because (obviously) the html is > no longer self-contained and instead images and other references are stored > in a separate folder. Students can’t submit non-self-contained html for > assessment. We need the resulting html files to be self-contained. > - Knitting to Word works > - I recently asked ITS to do a test install of latex and try knitting > to PDF. That worked (on a test file) too. > > Contextual information > > - Students work on networked PCs. > - The R library is set up for each user within their Documents folder > on the network mapped to a drive: N:/Documents/R/win-library/3.5 > - We have had an issue with *some* (but not all) packages needing us > to specify the library path (e.g., install.packages('package_name'), > lib = N:/Documents/R/win-library/3.5). Reading around, this seems to > be to do with UNC paths, but I don’t know enough about UNC paths to > understand what the issue is and ITS don’t understand enough about R Studio > to know why UNC paths are a problem:-) > > More detail on the error > > This is the error from pandoc when knitting the default R markdown > template document: > > pandoc.exe: Could not fetch \xx.xx.xx.ac.uk-library.5-1.11.3.min.js > FailedConnectionException2 “xx.xx.xx.ac.uk” 80 False connect: failed > (Connection timed out (WSAETIMEDOUT)) Error: pandoc document conversion > failed with error 67 Execution halted` > > xx.xx.xx.ac.uk is the home drive of the university network (with xs to > replace the actual path) and ‘username’ would be the users username. The > error looks as though it is looking for ‘jquery.min.js’ but timing out > before finding it. The file jquery.min.js exists at the specified location > (\xx.xx.xx.ac.uk-library.5-1.11.3) > Questions > > I’m hitting a brick wall with this issue. My ITS support are *really* helpful > but they don’t know anything about pandoc or R Studio. Conversely, I know > nothing about networking, so they say ‘it’s a pandoc issue you’ll have to > ask the developers’, but everything I have read on error 67 suggests > firewalls/UNC paths as the issue, which I have no control over (unless I > can give ITS some specific info on *why* UNC paths/firewalls messes up > knitting to html and a way to resolve it). Despite many hours on the > internet, I haven’t found a way to resolve the issue other than setting > self_contained: no in the YAML, which doesn’t help me. > > We’re changing all of our UG teaching in my school to R next year, and > it’d really make life a lot easier if we can have students not to > self-contained html. So, my questions: > > 1. If it is a UNC path/firewall issue does anyone have a workaround > other than putting self_contained: no in the YAML? If you do have a > solution that involves knowing about networking or UNC paths can you > possibly give me info that will make sense to to my ITS staff (or point me > somewhere for more info). > 2. If it’s not a UNC path/firewall issue, what is the problem and is > there a solution? > > -- You received this message because you are subscribed to the Google Groups "pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/56c19d18-b126-48b0-adc3-53aeb5d09d82%40googlegroups.com.