How To Fix Jupyter 500 Internal and 403 Forbidden Error

Overview

This article talks about generic errors that Jupyter users encouter when using Jupyter in CloudBolt.

Jupyter is provided as a content library item for CMP users in CloudBolt. Since this is a Content Library item, any error that you may run into should be treated specifically to Jupyter and the errors are irrelevant to the CMP source code.

Considerations

You should have root access to CB Appliance

Procedure

Step 1 Make sure the Jupyter package version is the latest version

  1. Run pip install --upgrade jupyter pip install 'ipykernel<5.0.0' 'MarkupSafe<2.1.0' 'Jinja2<3.0'
            This should update the following pip packages:
    argon2-cffi-20.1.0 async-generator-1.10 attrs-20.2.0 backcall-0.2.0 bleach-3.2.1 cffi-1.14.3 decorator-4.4.2 entrypoints-0.3 importlib-metadata-2.0.0 ipykernel-5.3.4 ipython-7.16.1 ipywidgets-7.5.1 jedi-0.17.2 jinja2-2.11.2 jupyter-client-6.1.7 jupyter-console-6.2.0 jupyter-core-4.6.3 jupyterlab-pygments-0.1.2 mistune-0.8.4 nbclient-0.5.0 nbconvert-6.0.7 nbformat-5.0.7 nest-asyncio-1.4.1 notebook-6.1.4 packaging-20.4 parso-0.7.1 pexpect-4.8.0 pickleshare-0.7.5 prometheus-client-0.8.0 prompt-toolkit-3.0.8 ptyprocess-0.6.0 pycparser-2.20 pygments-2.7.1 pyparsing-2.4.7 pyrsistent-0.17.3 pyzmq-19.0.2 qtconsole-4.7.7 qtpy-1.9.0 setuptools-50.3.0 six-1.15.0 terminado-0.9.1 testpath-0.4.4 tornado-6.0.4 traitlets-4.3.3 wcwidth-0.2.5 widgetsnbextension-3.5.1 zipp-3.3.0

Step 2 Load Jupyter

  1. Try to access jupyter notebook and check if you are getting 403 or still 500?   

  2. Open /var/log/messages to get more information about the error you are seeing in the UI

    Most of the time, the messages would mention something like this: 

    jupyterd: [W 07:59:48.395 NotebookApp] Blocking request with non-local 'Host' t00norcbolt001.corp.tmnas.com (t00norcbolt001.corp.tmnas.com). If the notebook should be accessible at that name, set NotebookApp.allow_remote_access to disable the check.

Step 3 Generate config file

  1. Switch to the jupyter or as a root user, generate the jupyter config using the following command, which will tell you where it is writing the config to so you can find it for the next step:

    We run this: 

    jupyter notebook --generate-config 
  2. Modify the property below from False to True in config file.
    c.NotebookApp.allow_remote_access = True

  3. Restart jupyter service  

     service jupyterd restart 

Additional information

https://jupyter-notebook.readthedocs.io/en/stable/

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.