-
Notifications
You must be signed in to change notification settings - Fork 568
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
Permission denied problem with nbconvert #1430
Comments
what are the permissions on the try: |
I got permissions denied on both of them. What permissions should they have? |
Or, alternatively, how can I set things for the user to use a local version? |
This are the defaults created by the latest version of nbconvert
You should have a local copy somewhere in your path. Try
afaik the local version was created when jupyter was installed by pip. |
So the issue might be that I have two accounts on this machine, one that's admin, and the other on which I'm running the jupyter lab server. On the administrative account I have:
while on the jupyter account, I have:
But, the
while
I would not to give the |
I thing the solution is to change the permissions on recursively This feels pretty ugly, but will probably solve your problem. You can use the find command to do this:
|
Yup, that did it. |
Hi @gideonsimpson , I found that if I install jupyterhub and jupyterlab using conda with root, the permission of |
I am getting an outpu like this: also not able to create or open any .ipynb files in jupyter notebook and jupyterhub. Both installed on the same linux machine. Any solution to this error? |
This Permission error is caused due to the version of nbconvert. nbconvert 6.1.0 was the reason for this error. I have downgraded the nbconvert to 5.6.1 and it fixed the issue for me. I no longer face the Permission error any more while trying to open .ipynb files. |
I administer jupyterhub/lab for two separate institutions, and this has bit us both places. As @k-nayak helpfully points out, the workaround is to downgrade to 5.6.1 (thanks!), but I would recommend this issue re-open as it's a significant break for multi-user applications of this. |
I have this problem as well and downgrading worked but is never the best solution |
@k-nayak - can you elaborate on this? What do you think 6.1.0 did that was wrong? @jxu, do you have any insights? @bklaas? We're in the release process for 6.2.0, and if we have some clues as to why 6.1.0 seems to have a problem, but 5.6 does not, it would really help. Is it a permission problem when 6.1.0 is installed, but somehow 5.6 does not have the permission problem? Typically permissions are dealt with by the installer, so it's a bit puzzling. @SylvainCorlay - did nbconvert 6.0 switch where it put templates, causing some of these permission issues? |
Investigating this, nbconvert 5.6 stores its templates in site-packages:
while nbconvert 6.1 stores its templates in the share directory:
Plenty of Jupyter packages store data in the If you install, for example, JupyterLab, Jupyter Notebook, ipywidgets, etc. in the same way, are their |
I just checked, and making those So again, are people that are seeing this issue able to install JupyterLab, ipywidgets, Jupyter Notebook in the same way and see their |
@jasongrout it seems that the culprit is this snippet: nbconvert/nbconvert/exporters/templateexporter.py Lines 550 to 555 in 4607ed2
and more specifically the call to |
dont know if this helps but I came across this issue on a multi-user shared jupyterhub installation, I think user1 wrote the file, then user2 tried to write the file and failed with permission denied. I "solved" the issue by re-installing everything and removing write permissions of all users, but I'm not sure if this will break something on nbconvert. on a multi-user install I would rather not have any user writing files on the install dir, if the file is required by nbconvert it should be installed by the package manager, otherwise write it in a user-specific directory. |
yeah, if the faulty part of the code is the one I mentioned about, we should be able to not have any file or directory created by users. |
nice ! I missed that post actually, looks like that could be it. although I think I remember a "conf" file inside the directory, I might be misremembering tho, sorry. |
I have a pretty messy python environment from years of sometimes using sudo for install, sometimes local user install. I guess it is something weird between running as sudo and normal user. |
So (reconstructing might be happening) - this is somehow called by root once, which creates these directories with permission 700, and then those directories are not readable by other users? |
Fixes jupyter#1430 Many users are reporting that nbconvert 6.x has permission errors when queried or converting files. These seem to arise when nbconvert is installed as root, then used as a user. We hypothesize that the code removed in this commit, which attempts to create template directories throughout the jupyter path hierarchy, succeeds in creating template directories when running as root. Note that it creates the template directories with permission 700. Those permissions as root mean that regular users won’t be able to read these directories, and those are the sort of permission errors we are seeing reported. This directory creation was originally introduced in jupyter#1028, where I think it was limited to a single user configuration directory (based on the PR discussion). In jupyter#1056, this code appears to have been copied over and applied to the entire Jupyter directory hierarchy.
* Do not attempt to create additional template paths. Fixes #1430 Many users are reporting that nbconvert 6.x has permission errors when queried or converting files. These seem to arise when nbconvert is installed as root, then used as a user. We hypothesize that the code removed in this commit, which attempts to create template directories throughout the jupyter path hierarchy, succeeds in creating template directories when running as root. Note that it creates the template directories with permission 700. Those permissions as root mean that regular users won’t be able to read these directories, and those are the sort of permission errors we are seeing reported. This directory creation was originally introduced in #1028, where I think it was limited to a single user configuration directory (based on the PR discussion). In #1056, this code appears to have been copied over and applied to the entire Jupyter directory hierarchy. * Filter additional template paths to existing paths to be consistent.
Sorry for the late response, i don't think i have an explaination for the issue as it was something i came accross while searching multiple forums. |
We just released 6.2.0rc2, which fixes at least one situation that we think might cause the error (i.e., a situation where we think nbconvert will create directories with restrictive permissions that will give permission errors later when a different user accesses them). |
If there are other people who still hit this with the 6.2 release - in our case this happens when we're converting some notebooks in our CI which runs in a sandbox and can't access diff --git a/nbconvert/exporters/templateexporter.py b/nbconvert/exporters/templateexporter.py
index a3991b87..47cf59ed 100644
--- a/nbconvert/exporters/templateexporter.py
+++ b/nbconvert/exporters/templateexporter.py
@@ -516,9 +516,12 @@ class TemplateExporter(Exporter):
conf = {} # the configuration once all conf files are merged
for path in map(Path, self.template_paths):
conf_path = path / 'conf.json'
- if conf_path.exists():
- with conf_path.open() as f:
- conf = recursive_update(conf, json.load(f))
+ try:
+ if conf_path.exists():
+ with conf_path.open() as f:
+ conf = recursive_update(conf, json.load(f))
+ except PermissionError:
+ continue
return conf
@default('template_paths') |
….1.0, could cause permission denied errors when run in a shared environment. See jupyter/nbconvert#1430 . This was fixed in PR jupyter/nbconvert#1646 . Since many EasyBuild users work in shared environments, I think this is a relevant fix to have included.
This issue has been mentioned on Jupyter Community Forum. There might be relevant details there: https://discourse.jupyter.org/t/500-error-on-loading-notebook/12929/5 |
This issue has been mentioned on Jupyter Community Forum. There might be relevant details there: https://discourse.jupyter.org/t/500-error-on-loading-notebook/12929/6 |
In deed, this issue still exists with nbconvert 7.0.0 and 6.4.4. and it is about the permission of /usr/local/share/jupyter/nbconvert/templates/. using sudo to change permission helped. |
Looks like it's a problem of pathlib.
after giving execute permission to the html folder, the problem is resolved
|
I have a conda installation of jupyter and, after a recent update, my ability to export and otherwise convert jupyter notebooks has been curtailed. For instance, I'm having the following problem at the command line:
The text was updated successfully, but these errors were encountered: