jupyter_server
jupyter_server copied to clipboard
`ServerApp.preferred_dir` wrongly set if `root_dir` is overwritten in extension app
Description
The PR https://github.com/jupyter-server/jupyter_server/pull/1162 induces a failure on the example job of JupyterLab:
[C 2023-01-13 07:44:49.027 ServerApp] Bad config encountered during initialization: /tmp/tmp9jpdh334 is outside root contents directory
The trouble comes from:
https://github.com/jupyter-server/jupyter_server/blob/4e9d105d42b16df901cc35e06ab235a242cf25a1/jupyter_server/serverapp.py#L1685-L1687
The root_dir is the current working directory and not the overwritten root_dir set at
https://github.com/jupyterlab/jupyterlab/blob/d4688fe784c2b7d8cb9af8a153af88c91fd8dcc8/examples/example_check.py#L44
Hence the error.
I will fix this in JupyterLab by setting the preferred_dir to be identical to the root_dir. But I don't know if something must be done in jupyter-server.
Reproduce
See https://github.com/jupyterlab/jupyterlab/actions/runs/3913713828/jobs/6689933733
Expected behavior
No error
Context
- Operating System and version:
- Browser and version:
- Jupyter Server version: 2.0.7 or above