RStudio Server immediately freezes and crashes browser after starting - rstudio-server

I have an Rstudio Server installation on a Linux Azure VM that seems frozen and also crashes any browser I try to login with.
I have restarted the VM and separately restarted RStudio Server (similarly to the solution in this post) a number of times, but it does not change the behavior. I didn't think I had it set to reload an environment or operation upon restart, but perhaps I accidentally did. The last thing I was doing with the server was a large sparse matrix operation that turned out to be too much for it.
Since the problem occurs immediately after the app loads, I'm not sure how to reset its state. I tried following these instructions but it didn't work:
I renamed ~/.rstudio to ~/.rstudio.backup while RStudio Server was stopped and it was recreated on the next start, but it still resumed in the same state. I saw mentions of ~/.local/share/rstudio/ and ~/.config/rstudio in the support docs, but they do not seem to exist in this Azure Ubuntu installation.
I also moved and renamed the folder of the last used R project, but it had no effect. There is a .config/R/ folder but it only contains a rsconnect folder and 2 empty subfolders.

I finally got it. After shutting down and restarting RStudio Server it was necessary to run this command immediately after RStudio Server loaded:
sudo rstudio-server suspend-all

Related

Switching between tabs not possible online

I wrote a shiny app which works fine on my machine and on my server. Now I migrated the app to another virtual server (running Ubuntu 22.04 LTS). I can access the virtual server via a GUI and when I run the app on that virtual server in Rstudio it works fine. When I access the app (running with free shinyserver) from the internet, I reach the application and can see the dashboard. It actually looks fine, all the links work and so on, but I cannot switch between dashboard tabs. When I click on a tab, the webpage changes from "webpage/" to "webpage/#tab-2470-2" (or some other number behind "#tab-") but nothing happens.
Since the R code and the shiny config on my server (where everything works) and the new virtual server is exactly the same, I presume that the virtual server is missing some packages. It's a fresh installation aside from R, Rstudio, shinyserver, the required dependencies and all updates. The problem is that I do not get any error messages (shiny log directory is empty), so I do not even know where to start troubleshooting.
So I am wondering if anyone experienced the same behaviour or has an idea what I am missing?
Thanks in advance!

RStudio Server on Microsoft Azure instance

I am currently running R on a Microsoft Azure instance (Ubuntu virtual machine) using RStudio as my IDE, to which I connect simply through my browser. I am trying to run some commands that take quite some time to complete from within RStudio and figured that I could simply close my tab with RStudio open and the process would keep running. However, when I try to reconnect to see how the process is doing, the page keeps loading but I am unable to see RStudio.
I have a few questions regarding running RStudio on a server:
First, am I correct in thinking that I can close my tab and keep the process running?
Second, is it normal behaviour that I am unable to connect to the server while the process is running?
Third, am I going about this the correct way or are there better ways?
Yes, you can close your tab and keep it running.
RStudio Server waits on updates from the R process to update the UI. This means that if you have a long-running computation, your tab may not fully reload until it's finished. You may also have seen this in the middle of a session: when R is busy, you can have problems saving scripts that are open in the editor pane.
Logging out in the middle of a computation should be safe, but be aware that RStudio will save your workspace and shut R down after a period of inactivity. It then reloads everything when you log back in. But this only extends to objects in memory; if you have any files saved in your temp directory, they'll have disappeared when you come back. They're probably still on the disk, but since your new R session has a new temp directory, you'll have to do a manual search for them.

Meteor killed by ubuntu while trying to "run Meteor" on a server

My goal is to follow "Deploying a Meteor app with Nginx from scratch" tutorial available here
After installing Meteor, Node, Forever and Git, do the npm install, I try to "run meteor" to see if it works.
After downloading meteor-tools, the process begins to extract meteor-tools... looks like it is hanging for a couple minutes and then stops without any warning.
So my guess is that something causes the extraction to quit, but i don't know what exactly.
Yes, Meteor likes plenty of RAM. I would recommend using Phusion Passenger with nginx for Meteor, it's very easy to set up, and their tutorials/getting started is very good:
https://www.phusionpassenger.com/library/install/nginx/install/oss/
I haven't found the exact reason. However, I got it working. I was using a DigitalOcean server (512Mb/20G). I tried with a big server (16G/160G) and it works.
So I guess my server Ram OR Disk capacity was too small.
Edit:
setting up smaller configuration, i noticed that the minimum for Meteor to work is: 2Gb of RAM and 40Gb Disk.

RStudio Server on ec2 - Not persistent when closing browser tab

I am running RStudio server on an ec2 instance (using Louis Aslett's AMI) and connect through the browser.
I have some long scripts to run and thought I would be able to leave them running and close the browser tab/turn off my computer.
However, when I do this it seems to interrupt the console and when I log back into the server (pasting address into address bar and logging back in) I am met with an alert telling me that the R session terminated and my workspace is completely reset (working directory reset, and any data or variables lost).
Note that I am not terminating the instance, I am simply closing the browser tab that RStudio is loaded in.
Am I doing something wrong? Is there a proper way to disconnect safely and prevent this from happening?
Thanks
The author of the AMI implies that the AMI is based on Linux, so you can run screen before launching your RStudio server session.
The screen package is bundled with most Linux distributions. The author doesn't mention which distro his AMI is based on or list all of the included packages, but if the AMI doesn't have it, then you can use a package manger to install it:
sudo apt-get install screen -y
if your package manager is apt. The installation using the yum package manager is similar.

Fresh new session for rstudio-server

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.
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?
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.
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.
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.
Note that with newer versions of Rstudio, this folder is now under
~/.local/share/rstudio/sessions/
while in some older versions, it can also be seen in ~/.rstudio-desktop, see documentation page
A quick solution would be to rename ~/.rstudio and reopen the webpage using rstudio url.

Resources