Rstudio Server reloading IDE every few minutes


I have seen a strange issue with the Rstudio Server app. Using a Singularity container with Rstudio installed and it seems to work but it seems to constantly refresh every few minutes which is a bit annoying for the user (e.g. the whole IDE disappears and a spinning wheel shows it refreshing/reloading and it comes back to the IDE interface). It seems to do this randomly and I tried tracing what was triggering the refresh using the Web Developer tools but couldnt pin point it. Tried multiple versions of Rstudio and it all experiences this. Anyone else seen this or know what can trigger this. Running directly to the compute node using ssh port forwarding seems to be fine.

Thoughts or things to try welcome.


Just to update. Having looked with the Web developer tools it does seem to be linked to accessing features (such as history via get_recent_history) and returns:

{"error":{"code":3,"message":"Client unauthorized","error":null}}

This then triggers a reauth and refreshes the page due to that process. Trying to understand whats missing in the configuration to maybe increase the lifetime of cookies or alike.

Finally tracked it down, I tried adding support for Rstudio 1.4 by setting the csrf-token cookie as described in another post. It seems that didnt work as expected and was causing this odd behaviour. Since view.html.erb seems not to inherit the context object to allow different behaviour depending on version of R (version is option in submission form) I have disabled the newer version of R for now and fallen back to 1.3 for now.

1 Like

Just for the record. Having seen the update to the big thread on Rstudio it looks like it was possibly due to the csrf-token being regenerated since it was directly in view.html.erb rather than generated once in and exported to connections. Rstudio 1.3 and 1.4 seem to both work now using the same view.html.erb