Jupyter Creating Notebook failed: FORBIDDEN

29,579

Solution 1

Another alternative to confirm the issue is to open your Jupyter Session in another browser and you might be redirected to a screen like the following:

enter image description here

If you open a new console and type

jupyter notebook list

You'll see your current notebook and the URL will contain a token. Open that in a new tab and problem solved.

Output command should look like this:

Currently running servers:
http://localhost:8888/?token=cbad1a6ce77ae284725a5e43a7db48f2e9bf3b6458e577bb :: <path to notebook>

Solution 2

I had to enable cookies in the browser (which I had intentionally disabled). Then the "Forbidden" error disappeared, everything is OK now.

The generally accepted solution to prevent XSRF is to cookie every user with an unpredictable value and include that value as an additional argument with every form submission on your site.

From: http://tornado.readthedocs.io/en/latest/guide/security.html#cross-site-request-forgery-protection

Solution 3

I had this problem just now, but I noticed that it worked in Edge. Deleting all browser cache including cookies in Chrome solved this in my case.

Solution 4

Jupyter blocks non-local requests. To access Jupyter from an external address we can execute it with the following parameters:

jupyter notebook --NotebookApp.allow_origin=* --NotebookApp.allow_remote_access=1
Share:
29,579

Related videos on Youtube

Mauro Gentile
Author by

Mauro Gentile

Updated on July 09, 2022

Comments

  • Mauro Gentile
    Mauro Gentile almost 2 years

    I have just upgraded Jupyter to the version 4.3.1 While I can open previously created ipynb files, I cannot create new ones.

    When I try to create a new notebook file, I get a pop up windows saying:
    Creating Notebook Failed
    An error occurred while creating a new notebook
    Forbidden

    In the terminal I notice this output:

    [W 12:53:23.375 NotebookApp] 403 POST /api/contents (::1): '_xsrf' argument missing from POST
    [W 12:53:23.383 NotebookApp] 403 POST /api/contents (::1) 8.92ms referer=http://localhost:8888/tree?token=e7fbbb58516dc1359fcc26a1079093166a1f713ee5b94ccd
    

    I use Jupyter with Python 3.5.2 and IPython 5.1.0

  • Brick
    Brick about 5 years
    This applies if you've got a book open that suddenly stops allowing checkpoints to be saved. Apparently the password times out? Opening a new window and entering the password in the new window will re-enable the save function on the open tab.
  • debaonline4u
    debaonline4u over 4 years
    i simply pasted the token in the browser, and now it worked

Related