RStudio server error: "Unable to connect to service" in CentOs 8

Hi everyone

We have bought a new CentOS Linux release 8.4.2105 machine with preinstalled RStudio Server. Although it seems to properly run (

root :> systemctl status rstudio-server.service
ā— rstudio-server.service - RStudio Server
Loaded: loaded (/etc/systemd/system/rstudio-server.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2021-06-09 14:05:34 CEST; 3 weeks 5 days ago
Main PID: 2666 (rserver)
Tasks: 3 (limit: 3355442)
Memory: 49.6M
CGroup: /system.slice/rstudio-server.service
ā””ā”€2666 /usr/lib/rstudio-server/bin/rserver

when trying to log from the web browser we get an error message

"Could not connect to the R session on RStudio Server. Unable to connect to service (1)"

Is it a permission problem? Everything under /usr/lib/rstudio-server is owned by root

What should we check? There is no any log file under /var/log/rstudio-server

Thanks in advance

Hi Pacoceam,

Please check the rstudio server configure file under

/etc/rstudio/rserver.conf 

provide the port number, ip address and point rsession using the below link. And also Don't forget to check the SELinux and Firewall status.

Hi Shiva

rserver.conf and rsession.conf files in /etc/rstudio are empty. When connecting to RStudio Server we try LOCALIP:8787

# getenforce
Enforcing
# 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:      32

sudo systemctl status firewalld

ā— firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2021-06-09 18:03:40 CEST; 3 weeks 6 days ago
Docs: man:firewalld(1)
Main PID: 43124 (firewalld)
Tasks: 3 (limit: 3355442)
Memory: 34.3M
CGroup: /system.slice/firewalld.service
ā””ā”€43124 /usr/libexec/platform-python -s /usr/sbin/firewalld --nofork --nopid

jun 09 18:03:39 tabarca2 systemd[1]: Starting firewalld - dynamic firewall daemon...
jun 09 18:03:40 tabarca2 systemd[1]: Started firewalld - dynamic firewall daemon.
jun 09 18:03:40 tabarca2 firewalld[43124]: WARNING: AllowZoneDrifting is enabled. This is considered an insecure configu>
jun 09 18:04:27 tabarca2 firewalld[43124]: WARNING: AllowZoneDrifting is enabled. This is considered an insecure configu>
jun 09 18:04:29 tabarca2 firewalld[43124]: WARNING: AllowZoneDrifting is enabled. This is considered an insecure configu>
jun 10 14:02:30 tabarca2 firewalld[43124]: WARNING: AllowZoneDrifting is enabled. This is considered an insecure configu>
jun 10 14:04:36 tabarca2 firewalld[43124]: WARNING: AllowZoneDrifting is enabled. This is considered an insecure configu>
jun 10 14:06:18 tabarca2 firewalld[43124]: WARNING: AllowZoneDrifting is enabled. This is considered an insecure

Following your indications I've read something on selinux and tried to set it to "permissive" with

setenforce 0

and now everything is working fine.

1 Like

Hi Pacoceam,

Great. Good to know you can able to run Rstudio-server.

Also, please remember that "setenforce 0" will switch off SELinux temporarily until the Linux box is rebooted. Please plan for it. -Thank you.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.