OSC / bc_osc_rstudio_server

Batch Connect - OSC RStudio Server
https://osc.github.io/Open-OnDemand/
MIT License
10 stars 18 forks source link

Unable to run an RStudio Server session after another user runs that session. #2

Closed brianmcmichael closed 7 years ago

brianmcmichael commented 7 years ago

When an RStudio Server session is run on a node, the application creates a file at /tmp/rstudio-server/secure-cookie-key with permissions 0600 and owned by the user.

This file is not cleaned up on application close and that becomes problematic when another system user launches the rserver application.

This error is not captured in app logs and was identified after running an interactive job.

12 Jan 2017 15:08:01 [rserver] ERROR system error 2 (No such file or directory) [path=/tmp/rstudio-server/secure-cookie-key]; OCCURRED AT: rstudio::core::Error rstudio::core::FilePath::open_r(boost::shared_ptr<std::basic_istream<char> >*) const /usr/local/src/rstudio/rstudio-rstudio-aac679f/src/cpp/core/FilePath.cpp:1076; LOGGED FROM: int main(int, char* const*) /usr/local/src/rstudio/rstudio-rstudio-aac679f/src/cpp/server/ServerMain.cpp:433

An easy solution for this has not been identified. The path is hardcoded at https://github.com/rstudio/rstudio/blob/54cd3abcfc58837b433464c793fe9b03a87f0bb4/src/cpp/server/ServerSecureKeyFile.cpp#L40 in the RStudio Server application, so we can't specify a parameter or environment variable.

Some solutions considered:

  1. Submit a PR to RStudio server to use another path or select a path parameter.
  2. Find a way to preload some C libraries that wrap the relevant calls.
  3. Consider the feasibility of a software flag that would have an associated task to clean the contents of /tmp/rstudio-server/... prior to launching the job.
brianmcmichael commented 7 years ago

This issue was resolved with the implementation of proot