-
Notifications
You must be signed in to change notification settings - Fork 324
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
Symlinks with inaccessible targets cause filemanager to not list anything in the same directory #495
Symlinks with inaccessible targets cause filemanager to not list anything in the same directory #495
Comments
Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗 |
Hi @rcthomas - thank you for moving this issue here and thank you for the great instructions for reproducing the issue. Unfortunately, I'm unable to get Here's what I did to model your instructions...
Do you happen to be using a mounted filesystem by chance? Regardless, this doesn't change what should happen regarding reworking |
This was first observed on a mounted filesystem, yes (GPFS) but I was able to reproduce it in a Docker container on my laptop, with paths inside the container. The traceback I included comes from that Docker attempt. But, both my setups are using JupyterHub to launch JupyterLab. And, I realized in both places I have set:
Removing that from my Docker setup made things better. Does that change anything for you in terms of being able to reproduce the JupyterLab behavior? |
The GPFS and Docker FS clues make perfect sense as we've experienced these kinds of issues previously - mostly related to securely writing out the kernel's connection file. It's strange that the removal of |
I've created a complete Dockerfile-based reproducer. The process helped me notice there's another variable I missed, permissions on at least the directory enclosing the target. The Dockerfile includes commands to fiddle with permissions with a single line that can change the behavior. In this case, if you create the target directory in a directory that is itself accessible to the user, there is no problem in any case. It doesn't matter if jupyter_server is being used or not. But if you create the inaccessible target directory in a directory that is also not accessible to the user, then you get a See my reproducer below. I've left out the cmd setting to make
Thanks for looking into this, I hope this points in a helpful direction. Dockerfile
For completeness here's pip3 freeze for the image
|
Thanks again for the great information! So, it looks like this was essentially resolved in Notebook via jupyter/notebook#4670 to address recursive symlinks. I think we should simply add
I have the PR ported to jupyter_server and the patch for checking You should find that Jupyter Server's log output is clean, while Notebook's will still produce the logged exception above (but relative to notebook code). |
Description
It seems that in jupyter_core, in
is_file_hidden_posix()
an exception is raised if it comes across a symlink where the target path is not accessible to the user (PermissionError). This has the effect of stopping the file contents manager in JupyterLab 3 from displaying the contents of a directory containing such links.The traceback looks like the following, where the symlink points to a directory that is not accessible to user1:
Reproduce
touch a b c
in the same directory as their symlinkExpected behavior
The file listing should just omit the disallowed link since but list everything else that can normally be listed.
I think this means that jupyter_server should handle the exception. See also jupyter/jupyter_core#224
Context
The text was updated successfully, but these errors were encountered: