none
How to install CRAN packages in R Server RRS feed

  • Question

  • I am trying to deploy a model to remote R Server which requires some CRAN packages as dependencies.

    For example: randomForest

    While consuming the model as an API, it works fine for the first time but from then on I am getting an error in the compute node error log as below: (It appears the packages is being used by other process. Any help is appreciated)

    [Warning] {"CorrelationId":"36f6f840-5070-4939-880e-aedb4b126611","Subject":{"Message":"The process cannot access the file 'C:\\Program Files\\Microsoft\\R Server\\R_SERVER\\o16n\\rserve\\workdir\\conn4024\\randomForest\\libs\\x64\\randomForest.dll' because it is being used by another process.","StackTrace":"   at System.IO.Win32FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, FileStream parent)\r\n   at System.IO.Win32FileSystem.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, FileStream parent)\r\n   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)\r\n   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync)\r\n   at System.IO.Compression.ZipFileExtensions.ExtractToFile(ZipArchiveEntry source, String destinationFileName, Boolean overwrite)\r\n   at Microsoft.RServer.ComputeNode.IOWrappers.ZipProvider.<ExtractDirectoryAsync>d__3.MoveNext() in C:\\swarm\\workspace\\deployr-9.0.2\\product\\server\\src\\Microsoft.RServer.ComputeNode\\IOWrappers\\ZipProvider.cs:line 77\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.RServer.ComputeNode.RServe.RServeShell.<>c__DisplayClass14_0.<<InternalLoadSnapshotAsync>b__1>d.MoveNext() in C:\\swarm\\workspace\\deployr-9.0.2\\product\\server\\src\\Microsoft.RServer.ComputeNode\\RServe\\RServeShell.cs:line 296\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.RServer.ComputeNode.RServe.RServeShell.<InvokeCommandAsync>d__17.MoveNext() in C:\\swarm\\workspace\\deployr-9.0.2\\product\\server\\src\\Microsoft.RServer.ComputeNode\\RServe\\RServeShell.cs:line 375\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.RServer.ComputeNode.RServe.RServeShell.<InternalLoadSnapshotAsync>d__14.MoveNext() in C:\\swarm\\workspace\\deployr-9.0.2\\product\\server\\src\\Microsoft.RServer.ComputeNode\\RServe\\RServeShell.cs:line 290\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.RServer.ComputeNode.ShellManagement.ShellBase.<>c__DisplayClass71_0.<<LoadSnapshotAsync>b__0>d.MoveNext() in C:\\swarm\\workspace\\deployr-9.0.2\\product\\server\\src\\Microsoft.RServer.ComputeNode\\ShellManagement\\ShellBase.cs:line 230\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.RServer.ComputeNode.ShellManagement.Syncronizer.<>c__DisplayClass4_0.<<InvokeSingleAsync>b__0>d.MoveNext() in C:\\swarm\\workspace\\deployr-9.0.2\\product\\server\\src\\Microsoft.RServer.ComputeNode\\ShellManagement\\Syncronizer.cs:line 26\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.RServer.ComputeNode.ShellManagement.Syncronizer.<InvokeSingleAsync>d__5`1.MoveNext() in C:\\swarm\\workspace\\deployr-9.0.2\\product\\server\\src\\Microsoft.RServer.ComputeNode\\ShellManagement\\Syncronizer.cs:line 38\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.RServer.ComputeNode.ShellManagement.Syncronizer.<InvokeSingleAsync>d__4.MoveNext() in C:\\swarm\\workspace\\deployr-9.0.2\\product\\server\\src\\Microsoft.RServer.ComputeNode\\ShellManagement\\Syncronizer.cs:line 25\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.RServer.ComputeNode.ShellManagement.ShellBase.<LoadSnapshotAsync>d__71.MoveNext() in C:\\swarm\\workspace\\deployr-9.0.2\\product\\server\\src\\Microsoft.RServer.ComputeNode\\ShellManagement\\ShellBase.cs:line 230\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.RServer.ComputeNode.ShellManagement.ServiceCache.<>c__DisplayClass8_1.<<ExecuteAsync>b__4>d.MoveNext() in C:\\swarm\\workspace\\deployr-9.0.2\\product\\server\\src\\Microsoft.RServer.ComputeNode\\ShellManagement\\ServiceCache.cs:li

    Tuesday, June 27, 2017 8:50 PM

All replies

  • Hi,

    I'm facing about the same issue, with another file. I can publish an API, but when I'm trying to execute (the first time) I get this error on the compute node:

    2018-12-21 15:22:27.144 +01:00 [Information] {"CorrelationId":"b6ae19fe-3f99-4c6d-8466-9ea79c9aabff","Subject":"Registering service mtService1545402123 v1.0.0"}
    2018-12-21 15:23:09.181 +01:00 [Information] {"CorrelationId":"8cace930-23f3-4381-8e0f-3c18237b0e4a","Subject":"Executing service mtService1545402123 v1.0.0"}
    2018-12-21 15:23:09.182 +01:00 [Information] {"CorrelationId":"8cace930-23f3-4381-8e0f-3c18237b0e4a","Subject":{"ActiveShellCount":1,"CurrentPoolSize":4,"RuntimeType":"R"}}

    2018-12-21 15:23:16.369 +01:00 [Warning] {"CorrelationId":"8cace930-23f3-4381-8e0f-3c18237b0e4a","Subject":{"Message":"The process cannot access the file 'C:\\Program Files\\Microsoft\\ML Server\\R_SERVER\\o16n\\rserve\\workdir\\conn6496\\DeployREngineConsolec47eafa6-3742-45b6-8226-cd2c0dc333e7.txt' because it is being used by another process.","StackTrace":"   at System.IO.Win32FileSystem.DeleteFile(String fullPath)\r\n   at ....

    But on the web node it is reported as an error:

    2018-12-21 14:41:27.089 +01:00 [Error] {"CorrelationId":"8033041c-4973-40db-8f51-5592abe90a0e","Subject":{"errorId":"24b34f34-2b8e-4944-9632-e1f76cbe6ee7", "exception":{"Type":"System.InvalidOperationException","Message":"Generic BackEnd communication error: StatusCode=NotFound; RequestUri=http://localhost:12805/api/mtService1545399653/v1.0.0/execute Content=IOException: The process cannot access the file 'C:\\Program Files\\Microsoft\\ML Server\\R_SERVER\\o16n\\rserve\\workdir\\conn7052\\DeployREngineConsole3ce42196-1d9f-423c-a542-deb09960d9fc.txt' because it is being used by another process.","StackTrace":"

    This txt file contains some stdout stuff from the successful execution of an R script.

    Did you ever resolve this? Or does someone else have a clue?

    Regards,

    Roel



    • Edited by Roelver Friday, December 21, 2018 2:32 PM
    Friday, December 21, 2018 2:28 PM
  • Have you installed the packages as indicated in the documentation at adding / removing R and Python packages for ML Server on Windows?
    Wednesday, December 26, 2018 10:16 PM
    Owner