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

Proxy for shiny app doesn't seem to work #24

Closed lsetiawan closed 6 years ago

lsetiawan commented 6 years ago

Overview

When trying to launch a new shiny app from RStudio Server, it opens a new browser window but fails with an error /p/3773/ not found

Notes

  1. Currently, when just running a simple Docker RStudio, there is a shiny server that runs, I am not sure how to check within R or docker whether this is running in the background.
[2018-01-19 20:34:18.132] [INFO] shiny-server - Shiny Server v1.5.4.847 (Node.js v6.10.3)
[2018-01-19 20:34:18.134] [INFO] shiny-server - Using config file "/etc/shiny-server/shiny-server.conf"
[2018-01-19 20:34:18.166] [WARN] shiny-server - Running as root unnecessarily is a security risk! You could be running more securely as non-root.
[2018-01-19 20:34:18.169] [INFO] shiny-server - Starting listener on 0.0.0.0:3838
  1. When the shiny-server above is running, the application works.

R cmd interface:

> shiny::runApp('testshine')
Loading required package: shiny

Listening on http://127.0.0.1:3971

screenshot from 2018-01-19 12-37-55

  1. When doing the samething within a jupyterhub server, it seems like there is no proxy to the appropriate port, which I think is causing the not found error.

R cmd interface on jupyterhub:

> shiny::runApp('testshiny')
Loading required package: shiny

Listening on http://127.0.0.1:3773
yuvipanda commented 6 years ago

The problem here is that RStudio seems to be doing the following:

  1. Starts a new process that's listening on some port (3773)
  2. It then proxies things itself to that port (via /p/3773/)
  3. However, since we're already proxying, it doesn't seem to know to use a prefix - so it should be proxying via /user//rstudio/p/3773, not /p/3773.

So if we can figure out how to tell rsession what its web prefix should be, I think that should solve this.

lsetiawan commented 6 years ago

Thanks @yuvipanda.

@bbest Do you know how to set this in RSession?

yuvipanda commented 6 years ago

I'm going to spend a few minutes on this right now to see if I can make this work.

lsetiawan commented 6 years ago

Thank you @yuvipanda

yuvipanda commented 6 years ago

I spent a lot of time a while ago and it's all fixed up now!

lsetiawan commented 6 years ago

Thanks again @yuvipanda. Will there be a release that I can try soon?

yuvipanda commented 6 years ago

I already pushed out the latest release to PyPI a week or so ago, so that should work!

On Wed, Feb 7, 2018 at 7:52 AM, Landung Setiawan notifications@github.com wrote:

Thanks again @yuvipanda https://github.com/yuvipanda. Will there be a release that I can try soon?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jupyterhub/nbrsessionproxy/issues/24#issuecomment-363812830, or mute the thread https://github.com/notifications/unsubscribe-auth/AAB23tRMXTtj99Dag3eJfwIzsCzBESc9ks5tScaggaJpZM4RlBlZ .

-- Yuvi Panda T http://yuvi.in/blog