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

NBConvert 6.0+: PermissionError: [Errno 13] Permission denied: '/usr/share/jupyter/nbconvert/templates/conf.json' #1594

Closed
Paperone80 opened this issue Jun 21, 2021 · 11 comments

Comments

@Paperone80
Copy link

Paperone80 commented Jun 21, 2021

Upgrading to NBconvert 6.0+ crashes my Jupyterhub environment when loading any .ipynb with
500 : Internal Server Error.

I tried every version of NBConvert 6.x.

Error does not happen with:
pip install "nbconvert<=6.0"

Works fine with other up-to-date packages:
NBConvert: 5.6.1
Jupyterhub: 1.4.1
Notebook: 6.4.0
Sudospawner: 0.6.0.dev0

Reproducible by upgrading "nbconvert>=6.0" and start Jupyterhub with

$ jupyterhub --port 8080 --no-db --debug \
--JupyterHub.spawner_class='sudospawner.SudoSpawner' \
--SudoSpawner.sudospawner_path='/opt/jupyterhub_env/bin/sudospawner' \
--pid-file='/opt/jupyterhub_env/bin/jupyterhub.pid_file' \
--JupyterHub.db_url='/opt/jupyterhub_env/bin/jupyterhub.sqlite'  \
--JupyterHub.cleanup_proxy=True \
--Spawner.debug=True \
--Spawner.args=[\'--NotebookApp.iopub_data_rate_limit=1000000000\'] \
--Spawner.default_url='tree/home/{username}' \
--Spawner.notebook_dir='/' \
--ConfigurableHTTPProxy.debug=True \
--JupyterHub.cookie_secret_file='/opt/jupyterhub_env/bin/jupyterhub_cookie_secret' \
--ConfigurableHTTPProxy.auth_token='xxxxxxxxx' \
--Spawner.environment={\
\'LD_LIBRARY_PATH\':\'${LD_LIBRARY_PATH}:/usr/local/cuda-10.0/lib:/usr/local/cuda-10.0/extras/CUPTI/lib\'\
\,\'PATH\':\'${PATH}\'\
\,\'CUDA_HOME\':\'/usr/local/cuda-10.0\'\
\,\'CUDA_TOOLKIT_PATH\':\'/usr/local/cuda-10.0\'\
\,\'CUDNN_INSTALL_PATH\':\'/usr/local/cuda-10.0\'\
} \
--Authenticator.admin_users="{'admin'}"

Login with admin and try open any .ipynb. Watch the console for error.

Traceback (most recent call last):
  File "/opt/intelpython3/envs/jupyterhub_env/lib/python3.6/site-packages/tornado/web.py", line 1704, in _execute
    result = await result
  File "/opt/intelpython3/envs/jupyterhub_env/lib/python3.6/site-packages/tornado/gen.py", line 775, in run
    yielded = self.gen.send(value)
  File "/opt/intelpython3/envs/jupyterhub_env/lib/python3.6/site-packages/notebook/notebook/handlers.py", line 101, in get
    get_frontend_exporters=get_frontend_exporters
  File "/opt/intelpython3/envs/jupyterhub_env/lib/python3.6/site-packages/notebook/base/handlers.py", line 516, in render_template
    return template.render(**ns)
  File "/opt/intelpython3/envs/jupyterhub_env/lib/python3.6/site-packages/jinja2/environment.py", line 1304, in render
    self.environment.handle_exception()
  File "/opt/intelpython3/envs/jupyterhub_env/lib/python3.6/site-packages/jinja2/environment.py", line 925, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/opt/intelpython3/envs/jupyterhub_env/lib/python3.6/site-packages/notebook/templates/notebook.html", line 1, in top-level template code
    {% extends "page.html" %}
  File "<template>", line 2, in top-level template code
  File "/opt/intelpython3/envs/jupyterhub_env/lib/python3.6/site-packages/notebook/templates/page.html", line 154, in top-level template code
    {% block header %}
  File "/opt/intelpython3/envs/jupyterhub_env/lib/python3.6/site-packages/notebook/templates/notebook.html", line 115, in block 'header'
    {% for exporter in get_frontend_exporters() %}
  File "/opt/intelpython3/envs/jupyterhub_env/lib/python3.6/site-packages/notebook/notebook/handlers.py", line 40, in get_frontend_exporters
    for name in get_export_names():
  File "/opt/intelpython3/envs/jupyterhub_env/lib/python3.6/site-packages/nbconvert/exporters/base.py", line 141, in get_export_names
    e = get_exporter(exporter_name)(config=config)
  File "/opt/intelpython3/envs/jupyterhub_env/lib/python3.6/site-packages/nbconvert/exporters/base.py", line 102, in get_exporter
    if getattr(exporter(config=config), 'enabled', True):
  File "/opt/intelpython3/envs/jupyterhub_env/lib/python3.6/site-packages/nbconvert/exporters/templateexporter.py", line 323, in __init__
    super().__init__(config=config, **kw)
  File "/opt/intelpython3/envs/jupyterhub_env/lib/python3.6/site-packages/nbconvert/exporters/exporter.py", line 115, in __init__
    self._init_preprocessors()
  File "/opt/intelpython3/envs/jupyterhub_env/lib/python3.6/site-packages/nbconvert/exporters/templateexporter.py", line 489, in _init_preprocessors
    conf = self._get_conf()
  File "/opt/intelpython3/envs/jupyterhub_env/lib/python3.6/site-packages/nbconvert/exporters/templateexporter.py", line 507, in _get_conf
    if conf_path.exists():
  File "/opt/intelpython3/envs/jupyterhub_env/lib/python3.6/pathlib.py", line 1336, in exists
    self.stat()
  File "/opt/intelpython3/envs/jupyterhub_env/lib/python3.6/pathlib.py", line 1158, in stat
    return self._accessor.stat(self)
  File "/opt/intelpython3/envs/jupyterhub_env/lib/python3.6/pathlib.py", line 387, in wrapped
    return strfunc(str(pathobj), *args)
PermissionError: [Errno 13] Permission denied: '/usr/share/jupyter/nbconvert/templates/conf.json'

Btw, /usr/share/jupyter/nbconvert/templates/ is empty. Changing chown and chmod permissions didn't help.

@k-nayak
Copy link

k-nayak commented Jun 28, 2021

facing same issue any solutions?

@k-nayak
Copy link

k-nayak commented Jun 30, 2021

Downgrading nbconvert to 5.6.1, fixed the Permission issue for me.

@sakoarts
Copy link

Having the same issue, removing both:
/usr/share/jupyter
and
/usr/local/share/jupyter

Works as well, but it seem like a bug that it tries to use these files from a local conda environment anyway.

@rraadd88
Copy link

Giving permissions to all users worked in my case:

chmod -R 777 /usr/share/jupyter/nbconvert/templates/
chmod -R 777 /usr/local/share/jupyter/nbconvert/templates/

@Mithil467
Copy link

#1430 has been re-opened to address this issue.

@jasongrout
Copy link
Member

Thanks, yes, let's consolidate the conversation over to #1430 since that is the earlier issue.

@meeseeksmachine
Copy link

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

@ultraNick
Copy link

I have same issue

PermissionError: [Errno 13] Permission denied: '/usr/local/share/jupyter/conf.json'

blow works for me. Thanks

Having the same issue, removing both: /usr/share/jupyter and /usr/local/share/jupyter

Works as well, but it seem like a bug that it tries to use these files from a local conda environment anyway.

I think this bug is not fixed in latest version yet

Selected Jupyter core packages...
IPython          : 8.4.0
ipykernel        : 6.9.1
ipywidgets       : 7.6.5
jupyter_client   : 7.2.2
jupyter_core     : 4.10.0
jupyter_server   : 1.18.1
jupyterlab       : 3.4.4
nbclient         : 0.5.13
nbconvert        : 6.4.4
nbformat         : 5.3.0
notebook         : 6.4.12
qtconsole        : 5.3.1
traitlets        : 5.1.1

@orionarcher
Copy link

@rraadd88 solution worked for me, thanks!

@Logy777
Copy link

Logy777 commented Dec 3, 2022

@rraadd88 solution is not enough in my case
To solve this issue I had to change rights for this:

chmod -R 755 /usr/share/jupyter/
chmod -R 755 /usr/local/share/jupyter/

@rdewald
Copy link

rdewald commented Aug 22, 2023

done

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

No branches or pull requests