Skip to content

ServerApp.preferred_dir wrongly set if root_dir is overwritten in extension app #1181

Open
@fcollonval

Description

@fcollonval

Description

The PR #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:

@default("preferred_dir")
def _default_prefered_dir(self):
return self.root_dir

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions