R can't connect to Spigot server using ropenscilabs miner package - r

I would like to try out the miner Minecraft API from ROpenSci and am having trouble connecting to the server from R. I am sure this is a networking issue rather than a R or Minecraft issue but I don't really have any experience in this area.
I have followed the vignette and installed spigot on my Arch machine following these instructions and can successfully start the server and connect to it using the Minecraft client.
However when I try to connect through R I am unable to do so. This is what I get:
library(miner)
mc_connect("127.0.0.1")
Error in socketConnection(host = hostname, as.integer(port), open = "r+b", :
cannot open the connection
In addition: Warning message:
In socketConnection(host = hostname, as.integer(port), open = "r+b", :
127.0.0.1:4711 cannot be opened
I also tried "localhost" and adding server-ip=127.0.0.1
This looks like fun so it would be cool to figure out what I'm doing wrong.
This is my server.properties file if it helps:
#Minecraft server properties
#Wed Jul 12 21:30:47 NZST 2017
generator-settings=
force-gamemode=true
allow-nether=true
gamemode=1
enable-query=false
player-idle-timeout=0
difficulty=0
spawn-monsters=true
op-permission-level=4
pvp=true
snooper-enabled=true
level-type=DEFAULT
hardcore=false
enable-command-block=false
max-players=20
network-compression-threshold=256
resource-pack-sha1=
max-world-size=29999984
server-port=25565
debug=false
server-ip=
spawn-npcs=true
allow-flight=false
level-name=world
view-distance=10
resource-pack=
spawn-animals=true
white-list=false
generate-structures=true
online-mode=true
max-build-height=256
level-seed=
prevent-proxy-connections=false
use-native-transport=true
enable-rcon=false
motd=My very own minecraft server```

Related

How to download data into Rstudio via "Rblpapi"?

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.

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).

Kerberos authentication for Windows R

I am trying to connect my HDP cluster from RStudio desktop(Windows) using SparkR package.
Spark init is failing with no credentials error message which seem to be because of missing kerberos credentials. (Exact error messages can be found below) I already have a kerberos ticker but it is found RStudio desktop doesn't support Kerberos authentication and RStudio server pro is what i needed. But, looks like RStudio server Pro can't be installed on Windows.
If i want to stick to my current Windows bases R and RStudio environment, is there any other ways to connect Hadoop?
Also, is there any package in core R itself (without RStudio ) i can use to authenticate with Hadoop cluster?
It looks like i can install Microsoft R on Windows but it doesn't look like it support Kerberos authentication?
sparkR.init(master = "yarn-client",appName = "sparkR", sparkHome = "C:/spark-1.6.2-bin-hadoop2.6",sparkEnvir = list(spark.driver.memory="2g"))
Error in invokeJava(isStatic = TRUE, className, methodName, ...) :
java.io.IOException: Failed on local exception: java.io.IOException: javax.security.sasl.SaslException: GSS initiate failed [Caused by GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt)]; Host Details : local host is: "HostName/IPAddress"; destination host is: "HostName:PORT;
at org.apache.hadoop.net.NetUtils.wrapException(NetUtils.java:772)
at org.apache.hadoop.ipc.Client.call(Client.java:1472)
at org.apache.hadoop.ipc.Client.call(Client.java:1399)
at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:232)
at com.sun.proxy.$Proxy23.getClusterMetrics(Unknown Source)
at org.apache.hadoop.yarn.api.impl.pb.client.ApplicationClientProtocolPBClientImpl.getClusterMetrics(ApplicationClientProtocolPBClientImpl.java:202)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethod
Microsoft R Server on Windows, as a client to the Microsoft R Server running on Hadoop does support Kerberos Authentication. It had been tested with Cloudera, Hortonworks HDP, and MapR.
When setting the compute context on Microsoft R Server (client-side) to RxHadoopMR(), R scripts can be executed remotely on the Hadoop Cluster, and, as long as all Nodes have valid Kerberos Tickets, you should be all set.
Please see: https://msdn.microsoft.com/en-us/microsoft-r/rserver-install-hadoop for installing Microsoft R Server on Hadoop.
and: https://msdn.microsoft.com/en-us/microsoft-r/rserver-install-windows for installing Microsoft R Server on Windows.

R- mongolite on OS X Sierra- No suitable servers found

I am trying to follow the "Getting started with MongoDB in R" page to get a database up and running. I have mongoDB installed in my PATH so I am able to run mongod from the terminal and open an instance. Though when I open an instance in the background and try running the following commands in R:
library(mongolite)
m <- mongo(collection = "diamonds") #diamonds is a built in dataset
It throws an error after that last statement saying:
Error: No suitable servers found (`serverSelectionTryOnce` set): [Failed to resolve 'localhost']
How do I enable it to find the connection I have open? Or is it something else? Thanks.
It could be that mongolite is looking in the wrong place for the local server. I solved this same problem for myself by explicitly adding the local host address in the connection call:
m <- mongo(collection = "diamonds", url = "mongodb://127.0.0.1")

Shiny Server cannot use RODBC to connect to DB2 but RStudio can in a Docker Container

I am working on deploying a shiny application in a Docker container onto Bluemix. I am using the rocker/shiny Docker image (https://hub.docker.com/r/rocker/shiny/) as my initial starting point. I have installed unixODBC-dev, RODBC, ibm data server driver package, the ibmdbR library for R, and all needed dependencies. My only problem is that when I try to access the shiny app from a web browser it fails to execute, the error is:
Warning in odbcDriverConnect("DSN=BLUDB", :
[RODBC] ERROR: state 01000, code 0, message [unixODBC][Driver Manager]Can't open lib '/root/db2_cli_odbc_driver/dsdriver/odbc_cli_driver/linuxamd64/clidriver/lib/libdb2o.so' : file not found
Warning in odbcDriverConnect("DSN=BLUDB; :
ODBC connection failed
Error in idaInit(con) : con is not an open connection, please use idaConnect() to create an open connection to the data base.
Initially I had this same problem whenever I would try to use isql to connect to the database or try to connect from RStudio, I used ldd on that library file and found what was missing and that fixed making connections from the command line and RStudio, however my Shiny-Server still gives me the same error, is there anything I am missing?
I ended up solving the problem myself, turns out the libraries were not accessible by the shiny-server which was running as a service. I moved the db2 odbc drivers over to /usr/local/lib to make it accessible, I also ran the "ldd" command on the library mentioned in the error message and found that I had to install libxml2 as well. After doing that I simply changed my odbcinst.ini file at /etc to reference the new location of the db2 library and now it all works! Hopefully anyone else trying to deploy Shiny Apps that rely on connecting to a DB2 database will find this useful.

Resources