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

Lab can't even open notebooks/text files when .ipynb_checkpoints directory lacks execute permissions #12235

Open
fperez opened this issue Mar 18, 2022 · 2 comments
Labels

Comments

@fperez
Copy link
Contributor

fperez commented Mar 18, 2022

Description

If the checkpoints dir happens to lack execute permissions, when trying to simply open any file with the text editor or the notebook client, the open operation crashes with a rather obscure message, and can't open the file at all.

Reproduce

On a *nix system, running

chmod u-x .ipynb_checkpoints/

in a folder will remove the user's execute (access) permissions. This can be run from a notebook as !chmod u-x .ipynb_checkpoints/. Once this has been done, saving any already open notebook in that folder will produce this error, which at least is somewhat informative:

image

Unfortunately if the user made the chmod change accidentally from a terminal without other open files there, instead what will happen is that when opening any file in that folder, they will get:

image

Which makes it much harder to debug what is going on.

Many thanks to @rcthomas for diagnosing this on a hosted hub!

Expected behavior

At a minimum, when the problem happens on open, we should be providing the same more informative dialog as when the problem happens on save of an existing file. That will already make it much easier for the user to understand what's happening and go fix it themselves. This is still suboptimal as the save operation won't succeed and there's a potential for data loss, but it's already a big improvement, and should be easier to make.

An even better fix would be to proceed with the local save, but exposing a warning that checkpointing has been disabled due to a non-accessible checkpoints directory. The user at least doesn't lose unsaved data, and can decide whether to fix the problem under the hood or live with the warning.

Context

  • JupyterLab version: 3.3.0
@fperez fperez added bug status:Needs Triage Applied to new issues that need triage labels Mar 18, 2022
@jhgoebbert
Copy link

jhgoebbert commented Mar 20, 2022

For us this is also an issue as users share a project directory, which is meant to be a place where project members can exchange files and data.
We patched our JupyterLab installation so that users can open the notebooks other project members have stored with read-permissions in that shared space.

@fperez
Copy link
Contributor Author

fperez commented Aug 31, 2022

FWIW, the Classic notebook handles this much more gracefully, as it still opens/saves the notebook, and at least shows on the screen the underlying error message (not very nicely, but enough that you can diagnose it and know what to do):

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants