RStudio server error: [rserver] ERROR system error 2

Hello,

I am trying to install RStudio server on my ubuntu server. The installation seems to be fine but when I run:

$ sudo rstudio-server verify-installation

It does not return anything. Then I tried running:

$ sudo rstudio-restart
rsession: no process found

I have looked at some other posts with similar problems and it seems mostly it is recommended to disable AppArmor, but when I attempt to do this with the following commands I get these errors:

$ sudo ln -s /etc/apparmor.d/rstudio-server /etc/apparmor.d/disable/
ln: failed to create symbolic link '/etc/apparmor.d/disable/rstudio-server': File exists

$ sudo apparmor_parser -R /etc/apparmor.d/rstudio-server
File /etc/apparmor.d/rstudio-server not found, skipping...

It didn't appear as though I actually disabled apparmor but I reloaded AppArmor anyway like this:

$ sudo invoke-rc.d apparmor reload 

After reloading AppArmor I tried to run the verify-installation command again and get the following output:

$ sudo rstudio-server verify-installation
26 Mar 2018 16:52:16 [rserver] ERROR system error 2 (No such file or directory) [path=/var/lib/rstudio-server/secure-cookie-key]; OCCURRED AT: rstudio::core::Error rstudio::server::key_file::readSecureKeyFile(const string&, std::string*) /home/ubuntu/rstudio/src/cpp/server/ServerSecureKeyFile.cpp:55; LOGGED FROM: int main(int, char* const*) /home/ubuntu/rstudio/src/cpp/server/ServerMain.cpp:435

I then tried looking at posts about this type of problem and I came across one that said:
Can you check the permissions on that /var/lib/rstudio-server directory and make sure its readable (and see if there is a secure-cookie-key file in it)?

The /var/lib/rstudio-server directory is owned buy root and has 755 permissions. I then checked the contents of the directory and this is what I have:

drwxr-xr-x 2 root root     4096 Feb 16 14:38 body
drwxr-xr-x 2 root root     4096 Feb 16 14:38 conf
drwxr-xr-x 2 root root     4096 Feb 16 14:38 proxy
-rw-r--r-- 1 root root 63544178 Mar 12 11:37 rstudio-server-1.1.442-amd64.deb
-rw------- 1 root root        0 Mar 26 09:57 secure-cookie-key

I'm really at a loss now as to what my problem is. Can anyone shine some light on this situation?

Thanks

R is installed, right?

did you try running:

$ sudo systemctl status rstudio-server

or:

$ sudo systemctl stop rstudio-server
$ sudo systemctl start rstudio-server
1 Like

Yes, R is installed. I can use R in the command line. I followed this installation: https://www.rstudio.com/products/rstudio/download-server/

When I run:

$ sudo systemctl status rstudio-server

It gives me this output:

lozzib@helix2-admin:/usr/share/doc$ sudo systemctl status rstudio-server
● rstudio-server.service - RStudio Server
   Loaded: loaded (/etc/systemd/system/rstudio-server.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2018-03-27 08:46:56 CDT; 28s ago
  Process: 11099 ExecStart=/usr/lib/rstudio-server/bin/rserver (code=exited, status=0/SUCCESS)
 Main PID: 11100 (code=exited, status=1/FAILURE)

Mar 27 08:46:56 helix2-admin systemd[1]: rstudio-server.service: Unit entered failed state.
Mar 27 08:46:56 helix2-admin systemd[1]: rstudio-server.service: Failed with result 'exit-code'.
Mar 27 08:46:56 helix2-admin systemd[1]: rstudio-server.service: Service hold-off time over, scheduling restart.
Mar 27 08:46:56 helix2-admin systemd[1]: Stopped RStudio Server.
Mar 27 08:46:56 helix2-admin systemd[1]: rstudio-server.service: Start request repeated too quickly.
Mar 27 08:46:56 helix2-admin systemd[1]: Failed to start RStudio Server.
Mar 27 08:46:56 helix2-admin systemd[1]: rstudio-server.service: Unit entered failed state.
Mar 27 08:46:56 helix2-admin systemd[1]: rstudio-server.service: Failed with result 'exit-code'.

Have you made changes to your /etc/rstudio/rserver.conf or /etc/rstudio/rseesion.conf? I am not sure exactly as I have not had this issue with rstudio server but when I have had issues with restarting the shiny server typically it is because I have made a typo in the configuration files.