Note that there are two "system" library paths, one for R 4.2.1 and one for R 4.2.2.
They used module load CBI rstudio-server-controller, which depends on the r module, which in turn loads the most recent R version. In contrast to the RStudio Server, running R in the terminal would report on a normal library path:
Looking back at the RStudio Console output, we found:
R version change [4.2.1 -> 4.2.2] detected when restoring session; search path not restored
This suggests that the RStudio session was launched on R 4.2.1 and then saved. But since then, the default R module load CBI r has been updated to R 4.2.2. When the user launched RStudio this time, the above message was generated, and then we got that mix-and-match .libPaths().
Resolution
Restarting the R session in RStudio by selecting 'Session' -> 'Restart R (Ctrl+Shift+F10)'. This restarted R (= R 4.2.2) and after that we got:
Have rsc detect when this can happen and produce an informative error instead of launch the RStudio Server. Maybe it's possible to automatically resolve it. Maybe ask RStudio to update the message to say that R should be restarted;
R version change [4.2.1 -> 4.2.2] detected when restoring session; search path not restored.
Because of this, there is a risk that R will not work properly. To resolve this, please restart R
under the RStudio menu 'Session'.
Alternatively, if possible, launch the RStudio Server, but inject a big message saying that 'Session' -> 'Restart R (Ctrl+Shift+F10)' is required.
Background
A user on C4 reported that they could not install R packages from their personal RStudio Server instance. They got errors such as:
They later reported that their R package library path was:
Note that there are two "system" library paths, one for R 4.2.1 and one for R 4.2.2.
They used
module load CBI rstudio-server-controller
, which depends on ther
module, which in turn loads the most recent R version. In contrast to the RStudio Server, running R in the terminal would report on a normal library path:Troubleshooting
Looking back at the RStudio Console output, we found:
This suggests that the RStudio session was launched on R 4.2.1 and then saved. But since then, the default R
module load CBI r
has been updated to R 4.2.2. When the user launched RStudio this time, the above message was generated, and then we got that mix-and-match.libPaths()
.Resolution
Restarting the R session in RStudio by selecting 'Session' -> 'Restart R (Ctrl+Shift+F10)'. This restarted R (= R 4.2.2) and after that we got:
and
install.packages()
works again.Suggestion
Have
rsc
detect when this can happen and produce an informative error instead of launch the RStudio Server. Maybe it's possible to automatically resolve it. Maybe ask RStudio to update the message to say that R should be restarted;Alternatively, if possible, launch the RStudio Server, but inject a big message saying that 'Session' -> 'Restart R (Ctrl+Shift+F10)' is required.