-
Notifications
You must be signed in to change notification settings - Fork 315
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
Server insists preferred_path
be a path on local disk
#961
Comments
Thanks for raising this @vidartf - this seems a bit messy. (Here's what I've learned while looking into this just now and I'm sharing (hopefully) for the sake of others, as well as my understanding.) As I'm sure you've found, As a result, I'm curious if you'd run into similar validation issues running the command: > jupyter server --ServerApp.root_dir="/not-a/file/path" I'm guessing that there must be some "understanding" when using non-FS-based contents managers, that one must NOT configure If we were to add a > jupyter server --ContentsManager.preferred_dir="/not-a/file/path" would that be sufficient to get the benefit of the preferred dir functionality? |
@kevin-bates The link between the two values that you indicated is not the correct one. For FS-based CMs, the link is in its default generator: jupyter_server/jupyter_server/services/contents/filemanager.py Lines 40 to 45 in 6dc7d53
A non-FS-based CM will not use that default generator, so there is no issue. I agree that the jupyter_server/jupyter_server/services/kernels/kernelmanager.py Lines 65 to 70 in 19c716b
|
I'm working on a fix for this. |
Fixed by #1162 |
Description
The current validator for
ServerApp.preferred_dir
insists on the value being a path on the file system, even if the contents manager is not file-based. If the value is not configured, it will use theroot_dir
value, which will cause clients like JupyterLab to query the contents manager for the FS based path, which will always pop up an error on session startup "Directory not found". I will open a separate issue on the JupyterLab repo for the fact that this happens even if you have a/tree/...
path in the URL. Since I cannot even specify "/" for the preferred dir since it is not a subdir ofroot_dir
, this basically breaks non-FS based contents managers from version 1.10.0 (in the sense that a pop-up at every page load of JupyterLab is breaking).Reproduce
Configure a non-FS based value for
preferred_dir
:Expected behavior
You can specify any path for which the configured contents manager returns true for
dir_exists
.Context
preferred_path
was introduced in #549, with one of the conditions in the description being "is required to be an existing directory residing at or within root_dir". This is a fine condition if the contents manager is file-based, but makes no sense for other contents managers.Workarounds
Override the
ServerApp
from jupyter-server.The text was updated successfully, but these errors were encountered: