How to download data into Rstudio via "Rblpapi"? - r

Good afternoon. Recently I've experienced a problem with downloading data from Bloomberg information system into RStudio via "Rblpapi" package. In order to get this package on my PC I executed the following commands:
install.packages("Rblpapi")
library(Rblpapi)
This code was proceeded succesfully. Further, in order to establish the connection between my PC and Blooberg I did the following:
blpConnect()
Then I received the error message:
25MAR2021_12:27:10.598 4484:7384 ERROR blpapi_platformtransporttcp.cpp:671 blpapi.session.transporttcp.{4}.localhost:8194 Connection failed
25MAR2021_12:27:10.598 4484:7384 WARN blpapi_platformcontroller.cpp:371 blpapi.session.platformcontroller.{4} Platform: 0 failed 1 consecutive connect attempts, stopped trying to reconnect.
Error in blpConnect_Impl(host, port, appName) :Failed to start session.
Therefore, I couldn`t establish the connection between my PC and Bloomberg.
Could you, please, tell me, how this problem can be solved?
Thank you for your effort.

Related

How can I get past this 'SSL connect error' when using jsonlite::fromJSON in R?

Issue
I get the following error whenever I run
all_companies <- jsonlite::fromJSON("https://www.sec.gov/files/company_tickers_exchange.json")
Warning: URL 'https://www.sec.gov/files/company_tickers_exchange.json': status was 'SSL connect error'Error in open.connection(con, "rb") :
cannot open the connection to 'https://www.sec.gov/files/company_tickers_exchange.json'
Thank you in advance for any help!
What I've tried
I am trying to run this on a new work computer, it runs fine on my old work computer but the new one gives me this error.
It seems the difference causing this issue is that I am using {jsonlite} 1.8.2 on my new computer and 1.8.0 on my old computer. Deep in the definition of the fromJSON() function, the working version seems to use curl::curl() to establish a connection whereas the not-working version uses base::url().
The following example line from the help documentation runs fine on the new computer with version 1.8.2
data1 <- fromJSON("https://api.github.com/users/hadley/orgs")
I can access the JSON file I am trying to read on an internet browser.
I do not have permission to install Rtools on my computer to be able to compile an older version of {jsonlite}.

Getting: "Failed to fetch metadata" when starting up Jupyter

I am using JupyterLab as my IDE and I have a couple of packages installed. Namely, the 'jupyterlab-dash' and 'juptyerlab-plotly' packages. My issue is when I go to launch 'juptyer lab' from terminal, I notice the following error:
Failed to fetch package metadata for 'jupyterlab-dash': URLError(gaierror(8, 'nodename nor servname provided, or not known'))
I'm not sure why this error is popping up but I've noticed this error only pops up when I have no internet connection (working on a train etc.). Could it be because these packages are trying to call something as I launch and because I don't have an internet connection it raises the error?
In the end I am able to use JupyterLab and the packages as intended (at-least it seems), but I'm curious why this error to 'fetch metadata' appears?
Thanks,

InternetOpenUrl failed: A connection with the server could not be established

I get this error on old Windows systems. I have an up to date Linux machine, there the following test runs fine:
length(readLines(file('https://saezlab.org/')))
On the same computer I have a Windows 7 virtual machine. There I get InternetOpenUrl failed: A connection with the server could not be established error. However for other URLs it works with no error:
length(readLines(file('https://google.com/')))
I tried to set the option download.file.method to wininet, internal, libcurl, without success. Also the webpage which fails from R (https://saezlab.org/) can be opened from Firefox. Searching for the error I got mostly irrelevant hits. My question is also about how to investigate further this issue? How can I get something similar to curl -vvv output, where I can see exactly where the communication fails? I see InternetOpenUrl sometimes gives more specific error messages (e.g. timeout, DNS issue, SSL error) but this message sounds quite vague: what's the reason why the connection can't be established? A little more background: I encountered this error when Bioconductor reported failed tests for my package on their Windows Server 2012 build machine (also an old Windows) while on their Windows Server 2019 machine the tests run fine. I used everywhere the latest R (4.0.2).

R Code works fine in RStudio but not in terminal - ODBC SQL - Failed to load the security library: (libgssapi_krb5.dylib)

I have some R code made in RStudio. It connects to SQL-Server, runs a query and saves out a csv.
It runs fine in RStudio but i want it to run in terminal so I can schedule it daily.
I have tried googling the error message for I can't seem to find what im looking for.
The SQL server authenticates with Windows Auth. Therefor im not suppling a username and password.
library(odbc)
con <- dbConnect(odbc::odbc(),.connection_string = "Driver={Simba SQL Server ODBC Driver};
Server=MYSERVER;
Database=TEST;
trusted_connection=true")
This is the error message I'm getting:
Error: nanodbc/nanodbc.cpp:950: HY000: [Simba][Support] (50366) Failed to load the security library: (libgssapi_krb5.dylib)
Execution halted
I'm really new to R so I'm not too sure whats happening, any help would be really appreciated.
Thanks!

"Cannot open the connection" - HPC in R with snow

I'm attempting to run a parallel job in R using snow. I've been able to run extremely similar jobs with no trouble on older versions of R and snow. R package dependencies prevent me from reverting.
What happens: My jobs terminate at the parRapply step, i.e., the first time the nodes have to do anything short of reporting Sys.info(). The error message reads:
Error in checkForRemoteErrors(val) :
3 nodes produced errors; first error: cannot open the connection
Calls: parRapply ... clusterApply -> staticClusterApply -> checkForRemoteErrors
Specs: R 2.14.0, snow 0.3-8, RedHat Enterprise Linux Client release 5.6. The snow package has been built on the correct version of R.
Details:
The following code appears to execute fine:
cl <- makeCluster(3)
clusterEvalQ(cl,library(deSolve,lib="~/R/library"))
clusterCall(cl,function() Sys.info()[c("nodename","machine")])
I'm an end-user, not a system admin, but I'm desperate for suggestions and insights into what could be going wrong.
This cryptic error appeared because an input file that's requested during program execution wasn't actually present. Each node would attempt to load this file and then fail, but this would result only in a "cannot open the connection" message.
What this means is that almost anything can cause a "connection" error. Incredibly annoying!

Resources