Web Service Error: Package or namespace load failed. RRS feed

  • Question

  • Hello!

    I have configured a cluster of Microsoft R Server 9.1 with 2 Web Nodes and 2 Compute Nodes and I have successfully deployed some models. I'm having an error while trying to execute a model using dplyr library. The webservice call returns "package or namespace load failed for 'dplyr'".

    The second problem is that the execution fails randomly. I asume that some times it gets executed in one of the Cluster Node and some times in the other. I have been installing the packages following this instructions using minicran in both cluster nodes and I can load the package succesfully using R Studio or Rgui.exe.

    I have installed the package as administrator so it was installed in the main installation path (C:\Program Files\Microsoft\R Server\RSERVER\library), also it is installed in a personal library created with the Documents folder of the Administrator User. I have used the same procedure in both machine but clearly there is some difference.

    Any thougths?


    Tuesday, August 22, 2017 12:36 PM


  • I could solve the problem. I'll write my experience here. All this info is with a deployment on Windows.

    When you execute a Web Service, the code has Access to 2 libraries. (You can check this executing .libPaths() when logged in REMOTE Session):

    • The connection folder of the Compute Node - C:\Program Files\Microsoft\R Server\R_SERVER\o16n\RServe\workdir\connXXXX
    • The main library of the server - C:\Program Files\Microsoft\R Server\R_SERVER\library

    When installing a new Package, make sure you're logged as Administrator, if not, packages will be installed in the Documents folder of the logged user and web service will not use them (Package not Found)

    If you install a Package in the REMOTE Session, it will be installed in the connection folder.

    Connection folders can be reused and they are not deleted once the sesión is over neither when the server is restarted. So, if you install a Package in the REMOTE Session, it will live in the connection folder and everytime the web services reuses that folder to execute code it will find the library. (This was my problem)


    Monday, August 28, 2017 6:07 PM