Erasing stale files to get rJava working on Docker

rstudioserver
rjava

#1

Redirecting from an issue I filed on the RStudio issues tracker:

I have a docker image on which I'm running RStudio Server (as well as some other things). Essential details I believe are:

  • Docker is using a persistent mount of my home directory (in particular the .rstudio config folder is persistent across Docker images)
  • After docker image is created, a run is triggered of a bootstrap.sh script which is where RStudio Server is started via gdebi of a persistent .deb file
  • The Docker image installs conda R; I don't have as much control over the details of the Dockerfile. bootstrap.sh is where GNU R and my package library are installed.

At some point in this admittedly messy setup, something happens to RStudio Server that prevents rJava from configuring correctly & the initial instance is doomed. No amount of restarting or R CMD javareconf can save it.

However, after the bootstrap.sh script runs, if I rstudio-server stop and then restart, the problem goes away.

I suspect there are some stale files being cached in my .rstudio folder; if I could identify these and include an rm of them in my bootstrap.sh folder, I think all would be well.

(I could also just rm -rf .rstudio but that would mean tossing the baby with the bathwater -- that folder also keeps my Global Options such as visual theme)

Any ideas of what might be causing the issue? Here are the contents of that folder:

ls -hl .rstudio/
total 36K
-rw-r--r--  1 michael.chirico michael.chirico    3 Sep 17 07:01 addin_registry
drwxrwxr-x  2 michael.chirico michael.chirico  130 Sep 17 07:01 client-state
drwxr-xr-x  2 michael.chirico michael.chirico   58 Sep 17 06:37 console06
drwxr-xr-x  2 michael.chirico michael.chirico    6 Sep 17 07:01 ctx
drwxr-xr-x  4 michael.chirico michael.chirico   42 Sep  7 07:54 dictionaries
-rw-r--r--  1 michael.chirico michael.chirico  15K Sep 17 06:29 history_database
drwxr-xr-x  6 michael.chirico michael.chirico   82 Sep  7 07:51 monitored
drwxr-xr-x  2 michael.chirico michael.chirico   31 Sep  7 07:51 notebooks
drwxrwxr-x  2 michael.chirico michael.chirico  140 Sep 17 07:01 pcs
-rw-r--r--  1 michael.chirico michael.chirico  442 Sep 17 06:27 persistent-state
drwxr-xr-x  2 michael.chirico michael.chirico    6 Sep  7 07:51 presentation
drwxr-xr-x  2 michael.chirico michael.chirico    6 Sep  7 07:51 profiles-cache
drwxr-xr-x  2 michael.chirico michael.chirico   59 Sep 17 03:51 projects_settings
drwxr-xr-x  2 michael.chirico michael.chirico   86 Sep  7 07:56 rversion-settings
-rw-r--r--  1 michael.chirico michael.chirico   27 Sep 17 07:01 saved_source_markers
drwxr-xr-x  3 michael.chirico michael.chirico   20 Sep  7 07:51 sessions
drwxr-xr-x  4 michael.chirico michael.chirico   35 Sep 17 04:03 sources

sources folder seemed pretty promising... Are internals documented somewhere where I could check what each of these objects/folders is intended for?