RStudio Startup Issue on Open OnDemand

Hello all,

We’ve observed that RStudio hangs when loading large datasets/environments from previous sessions upon startup of a new RStudio session, therefore creating issues with users losing access to RStudio. The app itself would launch but it just remains as a blank page.

We’ve tried the option of setting the load workspace as false in .config/rstudio/rstudio-prefs.json as follows but it still did not work:

{
    "load_workspace": false,
    "initial_working_directory": "~",
    "posix_terminal_shell": "bash",
    "default_project_location": <project location>
}

This is what we see on the project level (.Rproj):

Version: 1.0
RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default
EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8
RnwWeave: Sweave
LaTeX: pdfLaTeX

Would anyone be able to advise on the best way to troubleshoot this recurring issue?

Hi and welcome!

It maybe restore_last_project you’re looking for. I found that by toggling the setting in the rstudio UI (below), but looking at the UI it may also be an .RData file in the workspace?

{
    "reuse_sessions_for_project_links": true,
    "jobs_tab_visibility": "shown",
    "restore_source_documents": false,
    "initial_working_directory": "~",
    "restore_last_project": false,
    "posix_terminal_shell": "bash"
}

Other than that you may be able to find big files in ~/.rstudio or ~/.rstudio-desktop depending on the version. Once you find them, there could be a way to safely delete them if that’s the course of action you’d want to take.

Hi Jeff,

This issue is still persisting for us especially when a user loads a large dataset – RStudio would freeze and the GUI would become unresponsive. Because of this, we are unable to disable “Restore .RData into workspace at startup” on the GUI but at the same time the user that is facing this problem now have not been saving the .RData file but the RStudio server still shows that 8.1GB memory is used on the dashboard, which tells me that the data is still getting loaded from somewhere. The user was able to clear the environment but nothing seems to work still.

Is there a workaround for this through the terminal? Also where can I find the path to ~/.rstudio or ~/.rstudio-desktop? The version that is installed on our open ondemand is R 4.1.2

Thank you,
Jamie

RStudio’s docs are sort of all over the place (meaning the’yre not great to find at all and very sparse).

It’s not so much the R version that’s important, but the version of Rstudio itself here that’s important as I believe they’ve changed this local user configuration from one directory to another.

Because we use several versions, I have both (and ~/.config/rstudio) so the config you’re looking for could be anywhere.

https://docs.posit.co/ide/user/ide/guide/productivity/custom-settings.html

That said - please share whatever you can if you can share it because we’ve had users at OSC with the same issue and I cannot really replicate as I’m not an R user myself. So if you have a way to replicate that’d be super helpful.

At our site we have slowly been trying to isolate RStudio’s configuration, session data, and temporary run files using Apptainer bind mounts.

An example from template/script.sh · master · NMSU_HPC / ood_bc_rstudio · GitLab is like so:

# Setup Bind Mounts
BPath="$TMPDIR:/tmp"
BPath+=",$TMPDIR/rstudio-server/var/lib:/var/lib/rstudio-server"
BPath+=",$TMPDIR/rstudio-server/var/run:/var/run/rstudio-server"
BPath+=",logging.conf:/etc/rstudio/logging.conf"
BPath+=",rsession.conf:/etc/rstudio/rsession.conf"
BPath+=",rserver.conf:/etc/rstudio/rserver.conf"
BPath+=",Renviron.site:$renv_path"
BPath+=",sessions:${HOME}/.local/share/rstudio/sessions"
echo "$BPath"

# Launch the RStudio Server
echo "TIMING - Starting RStudio Server at: $(date)"
if [ "$gpu_job" == "no" ]; then
	apptainer -vvv exec --bind="$BPath" "$RSTUDIO_SERVER_IMAGE" rserver
else
	apptainer -vvv exec --nv --bind="$BPath" "$RSTUDIO_SERVER_IMAGE" rserver
fi

The important one here is the sessions directory as it can cause RStudio to get confused when you have multiple instances of the interactive app.

Even so we are still tracking down isolation issues with how RStudio behaves that can causes multiple instances of RStudio to crash each other when running on the same node under certain conditions.

I believe the error your running into is due to RStudio wanting to load a previous session upon startup. Isolating the sessions directory per job may solve this issue as it won’t have a previous session to automatically load.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.