jupyterhub / jupyter-rsession-proxy

Jupyter extensions for running an RStudio rsession proxy
BSD 3-Clause "New" or "Revised" License
118 stars 87 forks source link

Internal Server Error: `rsession did not start in time` #36

Closed chiroptical closed 5 years ago

chiroptical commented 6 years ago

Hello All,

This package looks like exactly what I need! However, I am having an issue where I get a 500 Internal Server Error when hitting /user/{user}/rstudio that says rsession did not start in time. I have the rstudio-server service running and followed the installation instructions. Unfortunately, I don't know where to go from here. Any help is appreciated.

Thanks.

ryanlovett commented 6 years ago

Are you starting rstudio-server via systemd, upstart, or some other init system? If so, nbrsessionproxy is currently incompatible with that. It expects that the notebook user can invoke rserver --www-port={some_port} which will want to write to /tmp/rstudio-server as the notebook user. If the init system has started rstudio-server on its own as a system user, the notebook user won't be able to write there. You can verify this by manually running the above rserver command (perhaps /usr/lib/rstudio-server/bin/rserver --www-port={some_port}).

This also means that only one user can launch rstudio-server on a multi-user system if /tmp/ hasn't been namespaced.

chiroptical commented 6 years ago

I see. I am starting via systemd. This is helpful.

Multi-user environment would be great.

Closing.

chiroptical commented 5 years ago

@ryanlovett By namespacing did you mean pam_namespace? I am having a hard time getting this to work. We use a slightly modified version of https://github.com/cwaldbieser/jhub_remote_user_authenticator and it appears as though I don't get namespaced /tmp unless I log in via ssh. Any help is appreciated.

ryanlovett commented 5 years ago

Yes, I've used pam_namespace to namespace /tmp; I just looked but couldn't find other methods. It looks like the remote user authenticator doesn't do anything with respect to PAM so I think you'd need to run a custom authenticator that takes bits from or subclasses PAMAuthenticator and the remote user authenticator. pam_namespace runs from the session module type and that is handled by pre_spawn_start.

chiroptical commented 5 years ago

Thanks @ryanlovett. I think I am going to move towards https://github.com/jupyterhub/systemdspawner. Closing.