URL with tree doesn't work with auto workspace

I’m trying to share links to a JupyterHub instance via /user-redirect/..., and apart from the fact that the redirect is lost upon login when it uses nbgitpuller (which is a JupyterHub/nbgitpuller issue I’m investigating separately), JupyterLab’s file navigation feature with /tree doesn’t work in conjunction with auto-generated workspaces.

The issue manifests even if I cut /user-redirect out of the loop, i.e. even if I just try to open a URL which is already targeted at a specific user. Say the URL ends with /user/test-user/lab/tree/test.ipynb:

  • The first time I visit that in a browser, JupyterLab loads test.ipynb, as expected, and removes the part of the URL starting with /tree from the browser location.
  • When I do it a second time in another tab however, a new workspace is first automatically created, but test.ipynb is not loaded and the part of the URL starting with /tree stays in the location. I have to refresh the page in order to nudge JupyterLab to go forward with these two things.

The strange thing is that when I run JupyterLab locally (i.e. not behind JupyterHub), this works as expected. Judging by the GitHub tracker, this has been an issue in the past, but has since been fixed. Which leads me to think it may have been fixed in a way which doesn’t play nice with JupyterHub or additional proxies?

Or maybe these features are generally finicky and the fact that they don’t work reveals that there’s something wrong with my Nginx/JupyterHub setup? I’d be grateful for any suggestions on where to look, and happy to provide additional information, though I realize there’s a lot of moving parts here, so it’s not a particularly appealing bug to tackle :slight_smile:

This might or might not be related? If it is related, it might make it more reproducible / more easily tested…
I’ve noticed if I still happen to have JupyterLab 2.01 open from a repo using MyBinder.org (which at its heart is a JupyterHub), the directed links to a specific notebook don’t work when I launch again. (It just brings up the launcher page when the session starts.) If I launch with no other JupyterLab open in my browser, then it forwards to the specified notebook.

Initially, this made me think with JupyterLab 2.0 that the forwarding mechanism by URL via MyBInder.org wasn’t working. But it turned out I had a forgotten window open.

This sounds like the same issue to me! If you already have a session open in another browser tab, then opening a new one should autogenerate a new workspace (you can check if the URL in that case contains /workspaces/auto-...).

So at least it looks like it might not be a config snafu on my part? :slight_smile:

Indeed, the new one that I open by hand has workspace appended in the URL, but it won’t get there on its own.