8

While login to Rstudio Server with my user name and password, I received the following

Rstudio Initilization Error 
unable to connect to service

I installed Rstudio Server in the following way:

apt-get install gdebi-core r-base r-base-dev 
wget -c https://download2.rstudio.org/rstudio-server-0.99.489-amd64.deb
sudo gdebi rstudio-server-0.99.489-amd64.deb

sudo usermod -a -G rstudio lorencm
sudo service rstudio-server start

id  lorencm
uid=1000(lorencm) gid=1000(lorencm) groups=1000(lorencm),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),108(lpadmin),111(sambashare),999(docker),1001(rstudio)

What did I do wrong?

3
  • 6
    Does the user you are trying to log in as have a home directory? E.g. /home/rstudio? Nov 10, 2015 at 8:43
  • 1
    Please also show output from /var/log/syslog. Nov 10, 2015 at 8:44
  • Yes, /home/rstudio was missing. Thank you.
    – user977828
    Nov 10, 2015 at 10:11

4 Answers 4

Reset to default

Trending sort

Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.

It falls back to sorting by highest score if no posts are trending.

13

In my experience this might happen because of permission to your home directory or you don't have any home directory. possibly created by defauly with no home directory. to solve this, just create a home directory for the username that you are tryin to use or use an exisiting username with valide home directory

usermod -md /home/username username 

or just create one

sudo mkdir /home/username
sudo chown -R username /home/username

Good luck

1

I am running a Fedora server with SELinux, I used cockpit to look at the SELinux logs and could see that the Rhistory file was being blocked for access. In adding in the policy SELinux advised, I was then able to login without any issues.

0

I was facing same issue & resolved by following:

  • disabling SELinux and rebooting the server.
  • The user with which you are logging in should be part of "rstudio-server" group.
  • rstudio-server:x:986:rconnect_admin
  • to add that user to rstudio-server group use usermod -a -G rstudio-server <username>

Here is the test process. I refer to the web page here: disable SELINUX ,

I tested the hypothesis about SELinux.

[testuser@third-test ~]$ sestatus
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Memory protection checking:     actual (secure)
Max kernel policy version:      31

I changed the directive SELinux=enforcing to SELinux=disabled

[testuser@third-test ~]$ sudo vi /etc/sysconfig/selinux

Then I reboot my system.

[testuser@third-test ~]$ sudo shutdown -r now

Now the SELinux is disabled.

[testuser@third-test ~]$ sestatus
SELinux status:                 disabled

Then the rstudio-server status looks good.

[testuser@third-test ~]$ sudo rstudio-server status
● rstudio-server.service - RStudio Server
   Loaded: loaded (/etc/systemd/system/rstudio-server.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2019-12-12 21:42:54 UTC; 2min 0s ago
  Process: 1091 ExecStart=/usr/lib/rstudio-server/bin/rserver (code=exited, status=0/SUCCESS)
 Main PID: 1135 (rserver)
​    Tasks: 3 (limit: 22408)
   Memory: 58.7M
   CGroup: /system.slice/rstudio-server.service
​           └─1135 /usr/lib/rstudio-server/bin/rserver

Dec 12 21:42:54 third-test systemd[1]: Starting RStudio Server...
Dec 12 21:42:54 third-test systemd[1]: Started RStudio Server.
[testuser@third-test ~]$ sudo rstudio-server status
● rstudio-server.service - RStudio Server
   Loaded: loaded (/etc/systemd/system/rstudio-server.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2019-12-12 21:42:54 UTC; 3min 37s ago
  Process: 1091 ExecStart=/usr/lib/rstudio-server/bin/rserver (code=exited, status=0/SUCCESS)
 Main PID: 1135 (rserver)
​    Tasks: 8 (limit: 22408)
   Memory: 141.0M
   CGroup: /system.slice/rstudio-server.service
​           ├─1135 /usr/lib/rstudio-server/bin/rserver
​           └─1662 /usr/lib/rstudio-server/bin/rsession -u testuser2 --launcher-token A8F380C6

Dec 12 21:42:54 third-test systemd[1]: Starting RStudio Server...
Dec 12 21:42:54 third-test systemd[1]: Started RStudio Server.

Another suggestion: It's always prefer not to use local authentication for login & use LDAP, Googleauth etc for login to the server.

0

i experienced the same problem on fedora 32 and then i removed R packages & rstudio-server and reinstall them again and worked fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.