Fresh new session for rstudio-server

25,127

Solution 1

I found this page, which deals with resetting the rstudio-desktop version. In my home directory, I found the folder ~/.rstudio. I renamed/deleted this folder and this loads a new rstudio-server instance.

In fact, there is a folder called suspended session in the ~/.rstudio folder, which I suspect is the thing where suspended data is stored, so maybe deleting this folder is sufficient?

Solution 2

If there is a directory inside ~/.rstudio/sessions/active/, deleting it (in the way like rm -rf ~/.rstudio/sessions/active/session-*) might be sufficient to solve the problem.

Solution 3

I have tried the above solutions which didn't work for me. I tried to kill the rsession which is causing the problem. just run this command to find out pid of user session.
ps -u userid
Find out the pid that is causing the rsession to stall. Kill that process and you're good to go.

Solution 4

Your question is a while back but after running into this problem a zilion times i found a way to reset the Rstudio Shiny Server session without the need for admin rights on Rstudio Shiny Server:

  • put temporarily as first line in server.r : quit("yes") # FORCE CLOSE OF SESSION server

  • go to the site and it will crash (the session closes straight away)

  • delete or comment out: # quit("yes") # FORCE CLOSE OF SESSION server
  • go to the site and you will have the shiny app with a new session =^)

Works for me and saves a lot of time searching through all kind of system folders or the need to enter a part of the system that you are not allowed to go or needing admin rights on Rstudio Shiny Server.

I hope this helps.

Share:
25,127
Alex
Author by

Alex

Updated on February 05, 2022

Comments

  • Alex
    Alex over 2 years

    I am running rstudio-server on a virtualised (vmware-player) ubuntu machine, and processing lots of data into the ram. I find that after some inactivity that the session suspends the data. The problem is that it takes a VERY long time to resume this session and it is making both the host machine and virtual machine lag very badly.

    I just want to kill the session and start a new fresh session of rstudio-server, but so far the only way I have found which does this is to reisub my ubuntu machine. Does anyone know a better solution?

    As a side note, I think entering session-timeout-minutes=0 in /etc/rstudio/rsession.conf as per here should fix the problem of the session suspending.

  • Jot eN
    Jot eN over 9 years
    Deleting a folder called suspended session is enough. Thanks
  • Islam El Hosary
    Islam El Hosary over 9 years
    The suspended session was the problem on my case.
  • Alex
    Alex almost 8 years
    while this looks to be a very useful hack for users running Shiny on shiny-server, my question is actually about rstudio server edition, not shiny server :)
  • irJvV
    irJvV almost 8 years
    Sorry, i mean running a Shiny app with R studio Server. To get a new session in R studio / R studio server you can just select Restart R in the Session menu (if this is what you mean)
  • MLavoie
    MLavoie almost 7 years
    the link is dead!
  • Alex
    Alex almost 7 years
    @MLavoie Thanks, I have updated it with what I think is the new link.
  • user5359531
    user5359531 over 6 years
    For me, rsession was not listed in ps, I had to use top to find it and then get the process ID and kill it.