Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Users can get "stuck" inside RStudio interface #35

Open
batpad opened this issue May 27, 2024 · 3 comments
Open

Users can get "stuck" inside RStudio interface #35

batpad opened this issue May 27, 2024 · 3 comments

Comments

@batpad
Copy link
Collaborator

batpad commented May 27, 2024

We got this from a user last week:

"I do not use R, but accidentaly started an Rstudio through https://hub.openveda.cloud/. Now I could not get out that environment. I am automatically directed to the R environment after log in through my github and could no longer see the list of environment choice. This may be a bug. Need your help. Thanks a lot."

The solution / workaround for this currently is to manually change the URL to https:///hub/home to get to the server management screen where you can Stop the R Studio server and when you start a new one, you will be taken to the profile options screen.

This is not at all intuitive from a user perspective and it would be nice to have a way to get to the Stop Server screen from within the RStudio interface without needing to manually change the URL. The problem is that in the R Studio container, we just render the R Studio interface, and don't have a straightforward way of modifying it.

Of course, this is an issue that other folks have run into, and there is this issue open for 4+ years: jupyterhub/jupyter-rsession-proxy#90 . The problem is that over-riding the logout button in the R Studio interface is not so straightforward.

There would be a slightly "ugly" way to do this. From conversation with @yuvipanda -

We already have a function that takes a request and returns a response: https://github.com/jupyterhub/jupyter-rsession-proxy/blob/216d9e5e65f0a16af34cf1bafc418c4daa1e08d6/jupyter_rsession_proxy/__init__.py#L34

"all you gotta do is:

  • Check if it's for the /rstudio/ URL
  • at the end of the response, append a <script> tag"

In this script tag, we can write a bit of javascript to over-ride the handling of the logout button. From looking at the rendered output on /rstudio/, the markup structure is a bit awful with tables inside tables, and we'd have to be very careful about error handling and making sure we "fail gracefully".

@yuvipanda - you also mentioned about checking for an environment variable - I forget the details and can't find in our chat - could you drop that detail here?

The markup on /rstudio/ does seem a bit crazy to work with, so I doubt we'd be able to do anything beyond changing the behaviour / link of the "Logout" button in the interface. I would not recommend attempting to change any styling.

It's a little bit ugly, and I imagine something that could be a bit brittle when versions of RStudio change, etc. But it also seems simple enough to implement.

Checking if this is something you've seen people bump into @wildintellect - I can definitely see how a user can quite easily get into a state where it's not clear how they "exit" RStudio.

cc @slesaad @yuvipanda

@yuvipanda
Copy link
Collaborator

This has historically been a problem for upstream (jupyterhub/jupyter-rsession-proxy#90, but also elsewhere). The pathway to fixing this that I suggested to @batpad should be acceptable to upstream I think. @ryanlovett, one of the creators of jupyter-rsession-proxy, may also have thoughts.

The env var is JUPYTERHUB_BASE_URL, which should let you construct the URL to redirect users to for control panel. But also only do the override if running inside a JupyterHub

@yuvipanda
Copy link
Collaborator

I believe this was one of the pieces of feedback from the GHG hub workshop - this did happen to users.

@batpad
Copy link
Collaborator Author

batpad commented Jul 1, 2024

@yuvipanda I think the feedback from workshop users was a little bit different from what's outlined in this ticket. There, I think it was more about instability issues with the R kernel, that seemed hard to reproduce. Unless I missed something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants