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

jupyter notebook /path/to/notebook not working when ServerApp.use_redirect_file=false #7043

Closed
randomir opened this issue Sep 13, 2023 · 3 comments
Labels
bug status:Needs Triage Applied to issues that need triage

Comments

@randomir
Copy link

randomir commented Sep 13, 2023

Description

With notebook~=6.0, this:

jupyter notebook --NotebookApp.use_redirect_file=false /path/to/notebook

opens the specified notebook in browser, skipping the /tree view.

Now, with notebook~=7.0 (and after changing NotebookApp --> ServerApp), this:

jupyter notebook --ServerApp.use_redirect_file=false /path/to/notebook

does not open the expected notebook, but instead opens the /tree path.

Note: both commands need token and password set to an empty string for the open to work smoothly (assuming safe environment here).

Reproduce

  1. Install notebook~=7.0
  2. Run:
jupyter notebook --ServerApp.use_redirect_file=false --ServerApp.token='' --ServerApp.password='' /path/to/notebook
  1. A tree view is launched in the browser (e.g. http://localhost:8888/tree), instead of the notebook asked, on e.g. http://localhost:8888/notebooks/path/to/notebook.

Expected behavior

According to docs, opening a specific notebook from the CLI should still work.

It turns out it doesn't work just when the redirect file is not used, i.e. it does work when use_redirect_file=true.

For some use cases, use of local redirect files is not an option (e.g. an online IDE, like GitPod or Codespaces).

Now, my question is, is this really the expected/desired behavior?

A workaround

jupyter notebook --JupyterNotebookApp.default_url='notebooks/<path/to/notebook>'

Opens the specified notebook, but it has a few drawbacks.

Context

  • Operating System and version: any linux
  • Browser and version: any browser
  • Jupyter versions:
IPython          : 8.15.0
ipykernel        : 6.25.2
ipywidgets       : not installed
jupyter_client   : 7.4.9
jupyter_core     : 5.3.1
jupyter_server   : 2.7.3
jupyterlab       : 4.0.5
nbclient         : 0.8.0
nbconvert        : 7.8.0
nbformat         : 5.9.2
notebook         : 7.0.3
qtconsole        : not installed
traitlets        : 5.9.0
@randomir randomir added bug status:Needs Triage Applied to issues that need triage labels Sep 13, 2023
@krassowski
Copy link
Member

It might be an omission rather than intentional behaviour. I would suggest enquiring over on https://github.com/jupyter-server/jupyter_server/ repository, looking at more recent related pull requests jupyter-server/jupyter_server#415 and maybe opening your own pull request if you are able to figure out a solution.

@randomir
Copy link
Author

Thanks, @krassowski! This indeed seems to be a jupyter-server issue. Notebook 7 compatibility break led me astray.

@randomir
Copy link
Author

Migrated this issue jupyter-server/jupyter_server#1325.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug status:Needs Triage Applied to issues that need triage
Projects
None yet
Development

No branches or pull requests

2 participants