10

I have a new version of R installed on an aws-machine (which always come with an old version for some reason and it's near impossible to just have yum or apt-get to work). I want rstudio to point to this new version which I've built from source without throwing the old version away. I therefore go to /etc/rstudio/rserver.conf (documentation) and change the contents to:

# Server Configuration File
rsession-which-r=/root/R-3.2.1/bin/R

I can confirm that at this location a new version of R is installed but then I get an error after rstudio-server restarts.

root@ip-172-31-40-49 rstudio]$ rstudio-server restart
initctl: Unknown instance:

What am I to do?

cantdutchthis
  • 31,949
  • 17
  • 74
  • 114

3 Answers3

28

Below worked for me:

1) check the process that used 8787

sudo fuser 8787/tcp

2) with the -k option to kill all process.

sudo fuser -k 8787/tcp

3) Start RStudio Server

sudo rstudio-server start

The solution above is provided here by Leon Zhang.

user3081234
  • 406
  • 4
  • 4
  • 1
    this is the correct answer. my answer just gets around the problem but this one actually frees up the tcp port. thanks for the answer and the link – zach Dec 05 '15 at 19:55
  • Thanks a lot, I had "ERROR system error 98 (Address already in use)". This worked everything else didn't. – Alexandre georges May 09 '22 at 14:40
6

The first thing to do is to check your configuration with:

rstudio-server verify-installation

a number of times when updating R or RStudio I have run into the same error as you have and get the following error message.

-bash-4.1$ sudo rstudio-server verify-installation
29 Sep 2015 18:24:11 [rserver] ERROR system error 98 (Address already in use); OCCURRED AT: rstudio::core::Error rstudio::core::http::initTcpIpAcceptor(rstudio::core::http::SocketAcceptorService<boost::asio::ip::tcp>&, const std::string&, const std::string&) /root/rstudio/src/cpp/core/include/core/http/TcpIpSocketUtils.hpp:103; LOGGED FROM: int main(int, char* const*) /root/rstudio/src/cpp/server/ServerMain.cpp:436
rstudio-server start/running, process 48632

Although I have never been able to figure out the cause, I can suggest the following workaround:

1. change the port /etc/rstudio/rserver.conf for example from 8787 to 8788
2. open the new ports in your firewall settings. (allow access to the new port in /etc/sysconfig/iptables)
3. update your firewall: sudo /sbin/service iptables restart
4. restart Rstudio server: sudo rstudio-server restart

This has worked for me each of the ~4-5 times this has happened. Although I am not 100% sure this can help with your use case, it may. As an alternative, if you can use containers in your AWS setup, you may be interested in a great off-the shelf docker image with the latest R/Rstudio.

zach
  • 29,475
  • 16
  • 67
  • 88
0

It happened for me on my Cento-7.x machine while I upgraded from old RStudio server to the new version. Rebooting the machine seems to have fixed the problem.

smishra
  • 3,122
  • 29
  • 31