# URL with tree doesn't work with auto workspace

**URL:** <https://discourse.jupyter.org/t/url-with-tree-doesnt-work-with-auto-workspace/3729>\
**Category:** JupyterLab\
**Created:** [March 24, 2020, 3:01pm UTC](https://discourse.jupyter.org/t/url-with-tree-doesnt-work-with-auto-workspace/3729 "2020-03-24T15:01:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dlukes](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/dlukes/32/666_2.png) [@dlukes](https://discourse.jupyter.org/u/dlukes)\
**Post date:** [March 24, 2020, 3:01pm UTC](https://discourse.jupyter.org/t/url-with-tree-doesnt-work-with-auto-workspace/3729/1 "2020-03-24T15:01:41Z")

</div>

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](https://github.com/jupyterhub/nbgitpuller/issues/118)), JupyterLab’s [file navigation](https://jupyterlab.readthedocs.io/en/stable/user/urls.html#file-navigation-with-tree) 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](https://github.com/jupyterlab/jupyterlab/issues/6772), but has since been [fixed](https://github.com/jupyterlab/jupyterlab/pull/6773). 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 🙂

---

<div class="post-metadata">

**Author:** ![fomightez](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/fomightez/32/495_2.png) [@fomightez](https://discourse.jupyter.org/u/fomightez)\
**Post date:** [March 24, 2020, 4:43pm UTC](https://discourse.jupyter.org/t/url-with-tree-doesnt-work-with-auto-workspace/3729/2 "2020-03-24T16:43:53Z")

</div>

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](http://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](http://MyBInder.org) wasn’t working. But it turned out I had a forgotten window open.

---

<div class="post-metadata">

**Author:** ![dlukes](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/dlukes/32/666_2.png) [@dlukes](https://discourse.jupyter.org/u/dlukes)\
**Post date:** [March 24, 2020, 4:51pm UTC](https://discourse.jupyter.org/t/url-with-tree-doesnt-work-with-auto-workspace/3729/3 "2020-03-24T16:51:36Z")

</div>

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? 🙂

---

<div class="post-metadata">

**Author:** ![fomightez](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/fomightez/32/495_2.png) [@fomightez](https://discourse.jupyter.org/u/fomightez)\
**Post date:** [March 24, 2020, 5:47pm UTC](https://discourse.jupyter.org/t/url-with-tree-doesnt-work-with-auto-workspace/3729/4 "2020-03-24T17:47:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![aflag](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/aflag/32/4549_2.png) [@aflag](https://discourse.jupyter.org/u/aflag)\
**Post date:** [June 4, 2021, 8:54am UTC](https://discourse.jupyter.org/t/url-with-tree-doesnt-work-with-auto-workspace/3729/5 "2021-06-04T08:54:45Z")

</div>

I hit the same issue. Has this been solved in a newer version of jupyterlab? I couldn’t find any issues related to this in the github repo. Is there a workaround?

---

<div class="post-metadata">

**Author:** ![fomightez](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/fomightez/32/495_2.png) [@fomightez](https://discourse.jupyter.org/u/fomightez)\
**Post date:** [June 4, 2021, 3:44pm UTC](https://discourse.jupyter.org/t/url-with-tree-doesnt-work-with-auto-workspace/3729/6 "2021-06-04T15:44:48Z")

</div>

@aflag , you may want to check out [this recent post](https://discourse.jupyter.org/t/mybinder-jupyterlab-link-to-a-repo-subfolder-works-but-not-to-a-specific-notebook-in-that-folder/9443/3), as well as, some of the earlier & subsequent discussion in another thread because I think getting Binder to open the right notebook with JupyterLab using a link and workspace behavior may be related.

It seems dependent on browsers. Perhaps? I’m still unclear 100% on that since my version of Firefox was old. Besides that, one work-around is to encourage your users to open things in incognito/stealth mode. Or encourage them to refresh, (see below). Or try to leave (or demonstrate) guidance on how to navigate to notebooks.  
The @dlukes here in the original post in this thread said reloading helped. And indeed Command-R on my mac in Chrome did trigger a hard refresh and correct loading of the specified notebook (via workspaces behind-the-scenes) in a MyBinder launched instance when I already had a fresh instance launched in another Chrome window.

You don’t say if you are actually using JupyterLab locally or through JupyterHub. The initial post said JupyterLab locally was fine. So I assumed you were using JupyterHub. Binder is a public BinderHub, which is a JupyterHub with extra tech (such as repo2docker, etc.) and so some of the findings with Binder and workspaces, I thought may be pertinent and that’s whyI redirected you to that other thread.

You also don’t say which version of JupyterLab you are using. I’m still still not sure there isn’t an issue with workspaces in JupyterLab 3. See my ‘caveat’ [here](https://discourse.jupyter.org/t/mybinder-jupyterlab-link-to-a-repo-subfolder-works-but-not-to-a-specific-notebook-in-that-folder/9443/9) where I describe that none of the ideas seems to be allowing the JupyterLab demo from the ‘Try Jupyter’ site [Project Jupyter | Try Jupyter](https://jupyter.org/try). So maybe the work-around would be to use older JupyterLab? Don’t know for sure on that as this uses an imported workspace and others don’t.
