Problem
Our End User fails to produce html files, gets this error:
Error: pandoc document conversion failed with error 61
Execution halted
TS Performed
We set up the proxy for a previous error message.
This previous error was:
pandoc.exe: Could not fetch \\HHBRUNA01.hq.corp.eurocontrol.int\alazarov$\R\win-library\3.5\rmarkdown\rmd\h\jquery\jquery.min.js
ResponseTimeout
Error: pandoc document conversion failed with error 67
Execution halted
For this we added "self_contained: no" to RProfile.Site>
We also tried "Self_Contained: yes" .
Current Error Message
Could not fetch http://?/UNC/server.contoso.int/username$/R/win-library/3.5/rmarkdown/rmd/h/default.html
HttpExceptionRequest Request {
host = ""
port = 80
secure = False
requestHeaders = []
path = "/"
queryString = "?/UNC/server.contoso.int/username$/R/win-library/3.5/rmarkdown/rmd/h/default.html"
method = "GET"
proxy = Just (Proxy {proxyHost = "pac.contoso.int", proxyPort = 9512})
rawBody = False
redirectCount = 10
responseTimeout = ResponseTimeoutDefault
requestVersion = HTTP/1.1
}
(InvalidDestinationHost "")
Error: pandoc document conversion failed with error 61
Execution halted
I had the same issue on Windows 10, with user path located on a network drive.
Could not fetch http://?/UNC/...
Error: pandoc document conversion failed with error 61
The solution was to run R as administrator, remove the package 'rmarkdown', and reinstall it.
Additional to the answer by Malte: When you do not have administrator rights you can just change the library directory towards a directory where you have full rights, C: for example. The default option is your network folder "?/UNC/server.contoso.int/username$/R/win-library/3.5/rmarkdown/rmd/h/default.html", where you have not sufficient rights and therefore R can not knit the markdown file.
In RStudio, click on Tools>Install Packages.. Under "Install to library" you can see the default option (in your case it should be "?/UNC/server.contoso.int/username$/R/win-library/3.5/rmarkdown/rmd/h/default.html"). The second option here should be "C:/Program Files/R/R-3.6.2/library".
To change this order, i.e. to make the "C:/Program Files/R/R-3.6.2/library" folder the default folder, you have to use the following code (execute the code in a new R file) :
bothPaths <- .libPaths() # extract both paths
bothPaths <- c(bothPaths [2], bothPaths [1]) # change order
.libPaths(bothPaths ) # modify the order
After that, you might have to install the markdown package again. This time, it will be directly installed into the "C:/Program Files/R/R-3.6.2/library" folder.
Now, knitting should be working, because R will use the package straight from a folder where you have full rights.
Aand issue was resolved. Someone changed a rule on the server hosting the files without documenting/logging....
Related
I am writing an R package and one of its functions download and unzips a file from a link (it is not exported to the user, though):
download_f <- function(download_dir) {
utils::download.file(
url = "https://servicos.ibama.gov.br/ctf/publico/areasembargadas/downloadListaAreasEmbargadas.php",
destfile = file.path(download_dir, "fines.rar"),
mode = 'wb',
method = 'libcurl'
)
utils::unzip(
zipfile = file.path(download_dir, "fines.rar"),
exdir = file.path(download_dir)
)
}
This function works fine with me when I run it within some other function to compile an example in a vignette.
However, with R CMD check in github action, it fails consistently on ubuntu 16.04, release and devel. It [says][1]:
Error: Error: processing vignette 'IBAMA.Rmd' failed with diagnostics:
cannot open URL 'https://servicos.ibama.gov.br/ctf/publico/areasembargadas/downloadListaAreasEmbargadas.php'
--- failed re-building ‘IBAMA.Rmd’
SUMMARY: processing the following file failed:
‘IBAMA.Rmd’
Error: Error: Vignette re-building failed.
Execution halted
Error: Error in proc$get_built_file() : Build process failed
Calls: <Anonymous> ... build_package -> with_envvar -> force -> <Anonymous>
Execution halted
Error: Process completed with exit code 1.
When I run devtools::check() it never finishes running it, staying in "creating vignettes" forever. I don't know if these problems are related though because there are other vignettes on the package.
I pass the R CMD checks with mac os and windows. I've tried switching the "mode" and "method" arguments on utils::download.file, but to no avail.
Any suggestions?
[1]: https://github.com/datazoompuc/datazoom.amazonia/pull/16/checks?check_run_id=2026865974
The download fails because libcurl tries to verify the webservers certificate, but can't.
I can reproduce this on my system:
trying URL 'https://servicos.ibama.gov.br/ctf/publico/areasembargadas/downloadListaAreasEmbargadas.php'
Error in utils::download.file(url = "https://servicos.ibama.gov.br/ctf/publico/areasembargadas/downloadListaAreasEmbargadas.php", :
cannot open URL 'https://servicos.ibama.gov.br/ctf/publico/areasembargadas/downloadListaAreasEmbargadas.php'
In addition: Warning message:
In utils::download.file(url = "https://servicos.ibama.gov.br/ctf/publico/areasembargadas/downloadListaAreasEmbargadas.php", :
URL 'https://servicos.ibama.gov.br/ctf/publico/areasembargadas/downloadListaAreasEmbargadas.php': status was 'SSL peer certificate or SSH remote key was not OK'
The server does not allow you to download from http but redirects to https, so the only thing to do now is to tell libcurl to not check the certificate and accept what it is getting.
You can do this by specifying the argument -k to curl
download_f <- function(download_dir) {
utils::download.file(
url = "https://servicos.ibama.gov.br/ctf/publico/areasembargadas/downloadListaAreasEmbargadas.php",
destfile = file.path(download_dir, "fines.rar"),
mode = 'wb',
method = 'curl',
extra = '-k'
)
utils::unzip(
zipfile = file.path(download_dir, "fines.rar"),
exdir = file.path(download_dir)
)
}
This also produces some download progress bar, you can silence this by setting extra to -k -s
This now opens you up to a Machine In The Middle Attack. (You possibly already are attacked this way, there is no way to check without verifying the current certificate with someone you know at the other side)
So you could implement an extra check, e.g. check the sha256sum of the downloaded file and see if it matches what you expect to receive before proceeding.
myfile <- system.file("fines.rar")
hash <- sha256(file(myfile))
I am trying to make a blog with blogdown using my windows machine, but get this error message when I use RStudio (File/New Project/New Directory/Website using blogdown/ ... and enter Directory name: "new"):
setwd("C:/Users/AndrésLagerlöf/OneDrive - Andrés Lagerlöf Konsulttjänst AB/R/blog")
'C:\Users\Andr‚sLagerl”f\AppData\Roaming\Hugo\hugo.exe" new site "new' is not recognized as an internal or external command,
operable program or batch file.
Error in shell(cmd, mustWork = TRUE, intern = intern) :
'"C:\Users\AndrésLagerlöf\AppData\Roaming\Hugo\hugo.exe" new site "new" --force -f toml' execution failed with error code 1
I do not know what to make out of this error message. Does anyone know how to fix this?
I use R version 4.0.0 and RStudio Version 1.2.5033.
Kind regards,
Andrés
You may consider installing Hugo to a path that does not contain multibyte characters. Per documentation ?blogdown::install_hugo:
If you want to install Hugo to a custom path, you can set the global option blogdown.hugo.dir to a directory to store the Hugo executable before you call install_hugo(), e.g., options(blogdown.hugo.dir = '~/Downloads/hugo_0.20.1/').
This is also mentioned in Appendix D.1 in the blogdown book. You'd better set this option in your .Rprofile (see Section 1.4 for how), so the setting won't be lost after you restart R.
I am using OSX (Catalina) and I am trying to sent rsync up and I am failing at it.
I have the following configuration:
port = 3001
pid file = /path/to/pid.log
lock file = /path/to/rsync.lock
log file = /path/to/rsync.log
[repo]
path = /path/to/dir/
comment = This a directory
read only = yes
list = yes
use chroot = false # used true, same result
use chdir = false # used true, same result
Attempting to list by running:
rsync -rdt rsync://IPADDR:RsyncPort/
or attempting to copy a file by running:
rsync -rdt rsync://IPADDR:RsyncPort/DirectoryName/File /DestinationDirectory/
Always leads to same error:
#ERROR: chdir failed
rsync error: error starting client-server protocol (code 5) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-54/rsync/main.c(1402) [receiver=2.6.9]
What am I doing wrong? How can this be fixed?
The problem was I forgot to create the dir in /path/to/dir/. In my research I found two reasons that could be responsible for this error. Either permission issues, or the file/directly does not exist. In my case it was the directory not existing, and rsync does not report a useful descriptive error message.
I thought of deleting this question, but I guess this can be useful to someone else.
I have written a Shiny App which runs perfectly in my local machine. I have used RJDBC to connect to the DB2 database in IBM Cloud. The code is as follows.
#Load RJDBC
dyn.load('/Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home/lib/server/libjvm.dylib')
# dyn.load('/Users/parthamajumdar/Documents/Solutions/PriceIndex/libjvm.dylib')
library(rJava)
library(RJDBC)
As the path is hard coded, I copied the file libjvm.dylib to the Project directory and pointed to that. When I do this, R gives a fatal error.
I remove the absolute path and replaced with "./libjvm.dylib" and deployed the application on ShinyApp.io website. When I run the program, it gives a fatal error.
#Values for you database connection
dsn_driver = "com.ibm.db2.jcc.DB2Driver"
dsn_database = "BLUDB" # e.g. "BLUDB"
dsn_hostname = "dashdb-entry-yp-lon02-01.services.eu-gb.bluemix.net" # e.g. replace <yourhostname> with your hostname, e.g., "Db2 Warehouse01.datascientstworkbench.com"
dsn_port = "50000" # e.g. "50000"
dsn_protocol = "TCPIP" # i.e. "TCPIP"
dsn_uid = "<UID>" # e.g. userid
dsn_pwd = "<PWD>" # e.g. password
#Connect to the Database
#jcc = JDBC("com.ibm.db2.jcc.DB2Driver", "/Users/parthamajumdar/lift-cli/lib/db2jcc4.jar");
jcc = JDBC("com.ibm.db2.jcc.DB2Driver", "db2jcc4.jar");
jdbc_path = paste("jdbc:db2://", dsn_hostname, ":", dsn_port, "/", dsn_database, sep="");
conn = dbConnect(jcc, jdbc_path, user=dsn_uid, password=dsn_pwd)
Similarly, I copied the file "db2jcc4.jar" to my local project directory. If I point to the local project directory for this file in my local machine, the program works. However, when I deploy on ShinyApp.io, it gives fatal error.
Request your please letting me know what I need to do so that the application runs properly on the ShinyApp.io website.
The error is as follows when I run the application from Shiny server:
Attaching package: ‘lubridate’
The following object is masked from ‘package:base’:
date
Loading required package: nlme
This is mgcv 1.8-23. For overview type 'help("mgcv-package")'.
Error in value[[3L]](cond) :
unable to load shared object '/srv/connect/apps/ExpenseAnalysis/Drivers/libjvm.dylib':
/srv/connect/apps/ExpenseAnalysis/Drivers/libjvm.dylib: invalid ELF header
Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
Execution halted
What works for me is the following and it is independent of OS.
Create your own R package that contains the file you need somewhere in the extdata folder. As an example, your package could be yourpackage and the file would be something like extdata/drivers/mydriver.lib. Typically this would be stored at this location inst/extdata/drivers. See http://r-pkgs.had.co.nz/inst.html for details.
Store this package on github and if you want privacy you will need to work out how to grant an access token.
Use the devtools package to install it. The command would be something like this, devtools::install_github("you/yourpackage", auth_token = "youraccesstoken"). Do this once before deploying to Shiny.io. Ensure that you also do library(yourpackage). The package submission process will work out that it needs to fetch from Github.
Use the following R code to find the file.
system.file('extdata/drivers/mydriver.lib, package='yourpackage'). This will give you the full path to the file and you can use it.
OS- Windows 7
R version 3.0.3
What I typed on R console :
if(!file.exists("data")){dir.create("data")}
fileUrl <- "https://data.baltimorecity.gov/api/views/dz54-2aru/rows.xlsx?accessType=DOWNLOAD"
download.file(fileUrl,destfile="./data/cameras.xlsx",method="curl")
dateDownloaded <- date()
What I got on R console
Warning messages:
1: running command 'curl "https://data.baltimorecity.gov/api/views/dz54-2aru/rows.xlsx?accessType=DOWNLOAD" -o "./data/cameras.xlsx"' had status 127
2: In download.file(fileUrl, destfile = "./data/cameras.xlsx", method = "curl") :
download had nonzero exit status
How do I make it right ?
Your code works for me. You probably don't have cURL installed on your system. See ?download.file:
For methods "wget", "curl" and "lynx" a system call is made to the tool given by method, and the respective program must be installed on your system and be in the search path for executables.
Install cURL and make sure it is in your path.
After removing the method="curl" parameter, it works well on Windows.