[BUG] "Path to a notebook file" functionality unexepectedly changed, not working for notebooks in subfolders

Until recently (and for years), I was able to provide notebooks in subfolders on the MyBinder landing page


Binder link: https://mybinder.org/v2/gh/qmrlab/t1_notebooks/master?filepath=ir_blog%2FInversionRecovery.ipynb

and the link would open that notebook once the build was done. However, now I get a 404: Note found, You are requesting a page that does not exist! error.

despite my notebook being in the correct location: t1_notebooks/InversionRecovery.ipynb at e70b459633711f5f81a2ffd81e4351255cb8c7e7 · qMRLab/t1_notebooks · GitHub

If I open a MyBinder session without the “Path to a notebook file” input (https://mybinder.org/v2/gh/qmrlab/t1_notebooks/master), the main directory is correctly opened and has the notebook in the correct subfolder.

Was this bug maybe introduced in your recent change to JupyterLab? Because I also used to have no problem connecting to the correct Jupyter Notebook in the subfolder using JupyterLab using with this syntax, https://mybinder.org/v2/gh/qMRLab/t1_notebooks/master?urlpath=lab/tree/content%2F01%2Fir_blog%2FInversionRecovery.ipynb (note the urlpath=lab), however now although I don’t get the error as above, it just shows me the main folder instead of opening the notebook in the subfolder (I cant share more than one screenshot due to my user level here).

Thanks.

It’s related to the switch to JupyterLab.

filepath=ir_blog%2FInversionRecovery.ipynb redirects to doc/tree/ir_blog/InversionRecovery.ipynb. the doc endpoint provides a simpler interface as opposed to user the tree endpoint. doc was added in Jupyter 3, but it looks like you’re running JupyterLab version 0.34.0 which is obviously quite old!

2 Likes

Hmm, yes, I think I froze JupyterLab inside my Binderfile ~2-3 years ago, as the version of Plotly and/or SoS I froze at were incompatible with newer version of JupyterLab. Upgrading the Plotly and/or SoS to current version would be require an enormous amount of work, and may be impossible.

Sigh, so much for long-term project stability. Thanks.

This link should continue to work, specifying an explicit URL, rather than letting Binder pick the default UI:

https://mybinder.org/v2/gh/qmrlab/t1_notebooks/HEAD?urlpath=%2Ftree%2Fir_blog%2FInversionRecovery.ipynb

While the default interpretation of filepath follows the default UI switch to lab, urlpath can be used to specify any URL, including the classic UI. urlpath doesn’t get interpreted, so you can use ?urlpath=/tree/ir_block/InversionRecovery.ipynb. Just like lab users had to use urlpath when the old notebook UI was default, the situation is now reversed - you can opt-in to classic notebook with urlpath now that lab is the default.

1 Like