-
Notifications
You must be signed in to change notification settings - Fork 131
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
PermissionError for nbextensions on startup with v1.29+ #611
Comments
I have learned a bit more on this. I think my issue comes from this existence check here. It seems that paths returned by: from jupyter_core.paths import jupyter_path
jupyter_path("nbextensions") do not always exist (which is why the function is calling However,
It worked when I updated the directory permissions to:
While this does solve my issue, I think the code could be more robust here. If the user doesn't have permission to a folder or file, shouldn't that be considered the same as "does not exist"? That is, maybe the call to |
Hi Brian, thank you for the detailed explanation. This should be a relative easy fix (although difficult to test in CI). Regards, Maarten |
Do you feel comfortable opening a PR for this? https://solara.dev/documentation/advanced/development/setup should guide you though it. |
Hi @maartenbreddels, sure, I'd like to give it a try 🙂. I might need some guidance on the testing bit. I just tried setting up a development environment, but I ran into some issues creating a virtual environment from With Python 3.9:
With Python 3.10:
I'm not sure if it is okay to ignore these? |
Hey @brian-c-ogorman! It looks like |
@brian-c-ogorman the dev install should work now! |
jupyter_core.paths.jupyter_path("nbextensions") may return directories that do not exist. However, the user may not have permission to read some of these paths, leading to a PermissionError when calling pathlib.Path.exists(), which crashes the application. This change catches the PermissionError and logs it as a warning, preventing the application from crashing. Essentially: if the user does not have permission to the path, it might as well not exist. See widgetti#611
jupyter_core.paths.jupyter_path("nbextensions") may return directories that do not exist. However, the user may not have permission to read some of these paths, leading to a PermissionError when calling pathlib.Path.exists(), which crashes the application. This change catches the PermissionError and logs it as a warning, preventing the application from crashing. Essentially: if the user does not have permission to the path, it might as well not exist. See #611 Co-authored-by: Brian O'Gorman <brian.ogorman@gettyimages.com>
I'm getting the following error when attempting to run Solara with version 1.29+:
Everything works fine on 1.28.0 though. I started a thread in the discord questions channel, but it seems like an issue might be more appropriate.
This is the logging output with the stacktrace:
It looks like it is related to this change, though whether that change is the cause or simply exposed the issue, I do not know.
The text was updated successfully, but these errors were encountered: