RevolutionAnalytics / RRO

Revolution R Open
http://mran.revolutionanalytics.com/download/
GNU General Public License v2.0
86 stars 25 forks source link

RRO-3.2.2 broke RStudio Server v0.99.483 #241

Closed sergrous closed 8 years ago

sergrous commented 9 years ago

It was working fine with 3.2.1 for the exception of missing GraphicsDevice capabilities. I've done purging and complete reinstalls of RStudio server, RRO-3.2.1 and RRO-3.2.2. I was able to successfully reproduce the error below w/ 3.2.2 and recover after purging and reinstalling 3.2.1

# uname -a
Linux host 3.13.0-63-generic #103-Ubuntu SMP Fri Aug 14 21:42:59 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

# aptitude show rstudio-server
Package: rstudio-server                  
State: installed
Automatically installed: no
Version: 0.99.483
Priority: optional
Section: devel
Maintainer: RStudio <info@rstudio.com>
Architecture: amd64
Uncompressed Size: 275 M
Depends: psmisc, libapparmor1, libedit2, libc6 (>= 2.7)
Recommends: r-base (>= 2.11.1)
Description: RStudio Server
 RStudio is a set of integrated tools designed to help you be more productive with
 R. It includes a console, syntax-highlighting editor that supports direct code
 execution, as well as tools for plotting, history, and workspace management.

# aptitude show rro-3.2.1
Package: rro-3.2.1                       
State: installed
Automatically installed: no
Version: 3.2.1-2
Priority: extra
Section: alien
Maintainer: root <root@rro14init>
Architecture: amd64
Uncompressed Size: 80.6 M

Depends: libc6 (>= 2.16), libcurl3 (>= 7.28.0), libgfortran3 (>= 4.3), libgomp1 (>=
         4.2.1), liblzma5 (>= 5.1.1alpha+20120614), libpng12-0 (>= 1.2.13-4),
         libreadline6 (>= 6.0), libtcl8.6 (>= 8.6.0), libtk8.6 (>= 8.6.0),
         libx11-6, libxmu6, libxt6, zlib1g (>= 1:1.1.4)
Description: The "Cran R" program from GNU
 'GNU S' - A language and environment for statistical computing and graphics. R is
 similar to the award-winning S system, which was developed at Bell Laboratories by
 John Chambers et al. It provides a wide variety of statistical and graphical
 techniques (linear and nonlinear modelling, statistical tests, time series
 analysis, classification, clustering, ...). 

 R is designed as a true computer language with control-flow constructions for
 iteration and alternation, and it allows users to add additional functionality by
 defining new functions. For computationally intensive tasks, C, C++ and Fortran
 code can be linked and called at run time. 

 (Converted from a rpm package by alien version 8.90.)

# rstudio-server verify-installation
rstudio-server stop/waiting
rstudio-server start/running, process 13159

# dpkg  -i RRO-3.2.2-Ubuntu-14.4.x86_64.deb
Selecting previously unselected package rro.
(Reading database ... 116156 files and directories currently installed.)
Preparing to unpack RRO-3.2.2-Ubuntu-14.4.x86_64.deb ...
Unpacking rro (3.2.2-2) ...
Setting up rro (3.2.2-2) ...

# which R
/usr/bin/R
# ls -l /usr/bin/R
lrwxrwxrwx 1 root root 41 Sep  8 13:33 /usr/bin/R -> /usr//lib64/RRO-3.2.2/R-3.2.2/lib/R/bin/R

# rstudio-server verify-installation
rstudio-server stop/waiting
08 Sep 2015 17:35:54 [rserver] ERROR R did not return any output when queried for directory location information; LOGGED FROM: bool rstudio::core::r_util::{anonymous}::detectRLocationsUsingR(const string&, rstudio::core::FilePath*, rstudio::core::FilePath*, rstudio::core::config_utils::Variables*, std::string*) /home/ubuntu/rstudio/src/cpp/core/r_util/REnvironmentPosix.cpp:491

08 Sep 2015 17:35:54 [rserver] ERROR Unable to determine R home directory; LOGGED FROM: bool rstudio::core::r_util::{anonymous}::detectRLocationsUsingScript(const rstudio::core::FilePath&, rstudio::core::FilePath*, rstudio::core::FilePath*, rstudio::core::config_utils::Variables*, std::string*) /home/ubuntu/rstudio/src/cpp/core/r_util/REnvironmentPosix.cpp:435

R did not return any output when queried for directory location information; Unable to determine R home directory

rstudio-server start/running, process 14589
sfweller commented 9 years ago

I get the same behavior - this can be normal on Ubuntu systems and some specific Rstudio environment variables need to be set:

Please try the following(this worked for me):

1). From a Linux shell prompt, type:

%export RSTUDIO_WHICH_R=/usr/bin/R

2). Make sure that a link '/usr/bin/R' exists in your install and points to the following: /usr//lib64/RRO-3.2.2/R-3.2.2/lib/R/bin/R

3). Make sure that port 8787 is open on your system.

4). Open a web browser and point it to: http://:8787

This should open Rstudio with a login prompt.

5). If you want to permanently set the environment variable, 'RSTUDIO_WHICH_R' add it to your .bash_profile file in your user home directory.

Stephen Weller Revolution R Open Technical Support

sergrous commented 9 years ago

This is not normal. I have not seen this till 3.2.2 upgrade. As I have shown above it was working as expected with RRO 3.2.1. You instructions do not make any sense to me. rstudio server is started by a system process with root level privileges. Here is what I get

# export RSTUDIO_WHICH_R=/usr/bin/R
# ls -l /usr/bin/R
lrwxrwxrwx 1 root root 41 Sep  8 13:33 /usr/bin/R -> /usr//lib64/RRO-3.2.2/R-3.2.2/lib/R/bin/R
# rstudio-server version
0.99.484
# rstudio-server status
rstudio-server stop/waiting
# rstudio-server test-config
# rstudio-server verify-installation
20 Sep 2015 05:26:24 [rserver] ERROR R did not return any output when queried for directory location information; LOGGED FROM: bool rstudio::core::r_util::{anonymous}::detectRLocationsUsingR(const string&, rstudio::core::FilePath*, rstudio::core::FilePath*, rstudio::core::config_utils::Variables*, std::string*) /home/ubuntu/rstudio/src/cpp/core/r_util/REnvironmentPosix.cpp:491
20 Sep 2015 05:26:24 [rserver] ERROR Unable to determine R home directory; LOGGED FROM: bool rstudio::core::r_util::{anonymous}::detectRLocationsUsingScript(const rstudio::core::FilePath&, rstudio::core::FilePath*, rstudio::core::FilePath*, rstudio::core::config_utils::Variables*, std::string*) /home/ubuntu/rstudio/src/cpp/core/r_util/REnvironmentPosix.cpp:435
R did not return any output when queried for directory location information; Unable to determine R home directory
rstudio-server start/running, process 9404
# rstudio-server start
rstudio-server start/running, process 9706
# ps -ef | grep -i rstudio
root     10002  7656  0 01:26 pts/1    00:00:00 grep --color=auto -i rstudio
# netstat --tcp -l
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 *:ssh                   *:*                     LISTEN     
tcp        0      0 localhost:6010          *:*                     LISTEN     
tcp        0      0 localhost:6011          *:*                     LISTEN     
tcp        0      0 *:http                  *:*                     LISTEN     
tcp6       0      0 [::]:ssh                [::]:*                  LISTEN     
tcp6       0      0 localhost:6010          [::]:*                  LISTEN     
tcp6       0      0 localhost:6011          [::]:*                  LISTEN     
tcp6       0      0 [::]:http               [::]:*                  LISTEN     
# 

As you can see there is not point of me trying to browser connection since no service is listening on 8787. And adding export RSTUDIO_WHICH_R=/usr/bin/R to my .bash_profile makes absolutely no sense since server is started during teh system start up by root, not me. And as you can see - it is no longer starting due to upgrade to 3.2.2.

I am running a cluster of ubuntu 14.04 LTS servers w/ RStudio server 0.99.484 on them for web only access for end users. And it is no longer working.

sergrous commented 9 years ago

Btw, if I down grade to 3.2.1 - RStudio server starts just fine and binds to 8787 w/out need to specify RSTUDIO_WHICH_R, except I lose graphics capabilities with 3.2.1

sfweller commented 9 years ago

Good observation. We will investigate the issue and see if we can fix this in a future release.

Stephen Weller Revolution R Open Support

sfweller commented 9 years ago

FYI, port 8787 is the default port that Rstudio uses for web access, that is why I mentioned it in my previous post.

warmdev commented 9 years ago

This might be related to the problem I encountered, in which case the cause is line 4 in /usr/lib64/RRO-3.2.2/R-3.2.2/lib64/R/bin/R which determines R_HOME_DIR based on readlink /proc/$$/fd/255. However that command seems to be implementation dependent and does not work reliably across different Linux distributions or shell environments. After I changed line 4 to the absolute path R_HOME_DIR=/usr/lib64/RRO-3.2.2/R-3.2.2/lib64/R everything works.

sergrous commented 9 years ago

In my case it was setting to /usr/lib64/RRO-3.2.2/R-3.2.2/lib/R, but that did the trick! Thank you so much.

ahmeier commented 9 years ago

had the same issue on ubuntu 14.04, setting R_HOME_DIR to /usr/lib64/RRO-3.2.2/R-3.2.2/lib/R worked for me, too. Thanks!

yipcma commented 8 years ago

@warmdev the editing of line 4 works for me as well. ubuntu 14.04

kmattyy commented 8 years ago

Thanks @warmdev. It worked for me too.

yipcma commented 8 years ago

I cannot believe this. It's still not fixed on MRO-3.2.5. ubuntu 14.04 fix: sudo nano /usr/lib64/MRO-3.2.5/R-3.2.5/lib/R/bin/R change the 4th line to R_HOME_DIR='/usr/lib64/MRO-3.2.5/R-3.2.5/lib/R'

yipcma commented 8 years ago

seriously, it's MRO-3.3.0 and same issue... on ubuntu 14.04 sudo nano /usr/lib64/MRO-3.3.0/R-3.3.0/lib/R/bin/R change the 4th line to R_HOME_DIR='/usr/lib64/MRO-3.3.0/R-3.3.0/lib/R'

I'll keep posting until they fix it.

nathansoz commented 8 years ago

This was fixed in MRO 3.3.1. We've also moved repositories to this new location: https://github.com/Microsoft/microsoft-r-open