1

When I try to load data.table package in a remote session on a MS R Server, I get an error:

REMOTE> library(data.table)
Error: package or namespace load failed for 'data.table'

Using the namespace directly I get more colour:

REMOTE> data.table::data.table(x = 1)
Error: .onLoad failed in loadNamespace() for 'data.table', details:
  call: assign("cbind.data.frame", tt, envir = asNamespace("base"), inherits = FALSE)
  error: cannot change value of locked binding for 'cbind.data.frame'

Any advice on how to resolve this?

Here some more information about the way R server is set up and how I install packages:

  1. R server runs on a separate machine (call it A) from the one where I start the remote session. The machine A is configured as one-box i.e. the web-node and compute-node both run on that machine.
  2. I am running the R client on my local machine (call it B) via Microsoft Visual Studio Professional 2015 Version 14.0.25431.01 Update 3, Microsoft .NET Framework Version 4.6.01038 with R Tools for Visual Studio, 1.0.30228.1316 RC2.
  3. I installed data.table package directly on the machine A by running 'Rgui' console with this command: install.packages('data.table'). The library installs into lib C:\RglobalPkgs specified by R_LIBS system environment variable on the machine A.
  4. I create a remote session on the machine B running these commands:

    library(mrsdeploy) remoteLogin("http://machineA:12800", username = "admin", password = "xyz", session = TRUE, commandline = TRUE)

  5. In the remote session I try to load the data.table package as described above at the beginning of my question which fails. Running .libPath() in the remote session gives:

    REMOTE> .libPaths() [1] "C:/RglobalPkgs" [2] "C:/Program Files/Microsoft/R Server/R_SERVER/library"

Pavel
  • 13
  • 4

1 Answers1

0

I emailed the dev team about this. Response below:

We're aware of the issue and will push a fix in the next release. A workaround is to go to C:\Program Files\Microsoft\R Server\R_SERVER\deployr\RServe\RScripts\source.R on the machine with the compute node and comment out

#  unlockBinding("unlockBinding",b)
#  assign("unlockBinding", deployr.unlock, envir=b)
#  lockBinding("unlockBinding", b)

Then go to services and restart the RServe9.0.0 service.

Hong Ooi
  • 56,353
  • 13
  • 134
  • 187
  • Thanks for replies. I am not running a one-box configuration. R server is on a separate machine. The error occurs whether I install data.table on the server machine or in the remote session. – Pavel Mar 09 '17 at 13:39
  • Use `library (*, lib.loc=path)` to point R to where you installed data.table – Hong Ooi Mar 09 '17 at 13:43
  • I did that: library(data.table, lib.loc = "C:/RglobalPkgs"). Still the same error. It does not seem to be the problem of R not finding the package. It fails while loading it. – Pavel Mar 09 '17 at 13:58
  • You should put all that in the question, including how you installed data.table. – Hong Ooi Mar 09 '17 at 23:21
  • Done. See my question above. Thank you again for your time. – Pavel Mar 13 '17 at 15:27
  • R_LIBS is a system variable. I put the result of running .libPath() within the remote session on the machine B in my original question. – Pavel Mar 13 '17 at 16:12
  • Try running `install.packages` from within the remote session. It may not have permission to read/write to that directory. – Hong Ooi Mar 13 '17 at 16:28
  • install.packages('data.table') from the remote session runs successfully but when I subsequently do library(data.table) I get the same error as in my original question. – Pavel Mar 13 '17 at 16:38
  • Okay, I can reproduce this on my own machine. Looks like an unexpected interaction between mrsdeploy and data.table. I'll notify the dev team. – Hong Ooi Mar 13 '17 at 17:01
  • 30-minute turnaround time on the email! – Hong Ooi Mar 13 '17 at 17:29