Notebook: Jupyter Notebook is broken in Firefox

Created on 20 Mar 2019  Â·  20Comments  Â·  Source: jupyter/notebook

Screen Shot 2019-03-20 at 12 53 44 AM

When I run 'jupyter notebook' it will open the html file in the filesystem and will be displayed incorrectly in the Firefox 67 and 68 (current Betas, I haven't tested 66). This issue does not happen in Chrome or Safari.
file:///Users/eduardomorales/Library/Jupyter/runtime/nbserver-81921-open.html

The only way to fix this is to access the URL provided in the terminal instead.
http://localhost:8888/?token=57035d2f78d7578f424d28e280855612e6d4b6cfb73f5de7

Most helpful comment

Seems to be an issue with the most recent release. Using an older release works:

pip install notebook==5.6.0

All 20 comments

Seems to be an issue with the most recent release. Using an older release works:

pip install notebook==5.6.0

thank you! this fixed it. This is the third thread I found about this issue, btw.

I also have the same problem, only in Firefox. I don't think using an older version of notebook is a fix, though.

Does anyone know why this happens?

Confirmed not working on Firefox 67 (MacOS Mojave)

Cause is this commit, which changed the way Jupyter Notebook is opened in the browser:
https://github.com/jupyter/notebook/commit/270c0f96d761ec3c81e0ef3dae6f39d88677d6b5#diff-f68f5eab41b9092b5b739944f53d5730

Instead of opening <base-url>/?token=<token> directly, an nbserver-<pid>-open.html file is now created which redirects to <base-url>/tree?token=<token>

Safari and Chrome have no problems with this redirect, but Firefox does. I have edited the nbserver-<pid>-open.html file to remove the tree part and can confirm that this does work in Firefox.

By the way: this same problem exists in jupyter lab

the nbserver--open.html is generated new each time the notebook is run so editing the html file only works for a few hours. What exactly is it about firefox that it can't handle the redirect? I was trying to tweak the code directly(open_url, default_url?) but spent hours for such a stupid little fix. At some point the /tree is needed but just not in the final html file creation. I am a newbie so this was definitely learning opp for me. I am following along on my own machine.

Seems to be an issue with the most recent release. Using an older release works:

pip install notebook==5.6.0

This solved my issue too, after spending much time diagnosing and attempting several options in vain!

Still an issue in new versions of notebook (for Opera), had to go back to 5.6.0

I have the same issue!

I am having the same issue ("Access to file was denied") on Ubuntu 18.04.3 (and 16.04) using Firefox and Opera.

My specific issue is because Firefox was installed using Snap. Firefox can't access anything outside the home directory. Moving the nbserver--open.html file to the /home/user/ directory let both Firefox and Opera open it.

It looks like this is the intended way snap-installed apps are meant to function, so I'm not sure there's a good fix for this.

Seems to be an issue with the most recent release. Using an older release works:

pip install notebook==5.6.0

I had the same issue using Opera on Ubuntu 18.04 and this fixed it !

Also broken in notebook=6.0.1 & 6.0.0 when using Chromium on Ubuntu 18.04.3. Had to install version 5.6.0 as suggested... seems weird that there has been a major version change but the issue persists. Make me wonder what I'm doing wrong? :-/
EDIT: fixed "Chrome" reference... it is "Chromium" FWIW

Also broken for me:

  • Jupyterlab 1.1.3
  • Ubuntu 19.04
  • Firefox 69.0.3 (64-bit) Snap for Ubuntu

I consider the same problem with Firefox since some versions currently I am on FF 70 under Arch Linux. I have to copy the URL and directly open it in the browser address field.
BUT I run a sandboxed Firefox via Firejail. When I run a non sandboxed instance directly via /usr/bin/firefox, Jupyter-Notebook – currently version 6.0.1 – starts and runs fine like it used to before.
Although I have in mind everything worked fine with Firejail too I do not remember the versions of Firefox, Firejail or jupyter-notebook when it stopped working.

I have the same issue on Windows Subsystem for Linux (WSL). Because browsers running in Windows can't access files in WSL. I hope to choose either URL access or redirect in settings.

Setting c.NotebookApp.use_redirect_file = False as described here (https://github.com/jupyter/notebook/issues/4353#issuecomment-570564277) solves this for me

yes this command helped me with Ubuntu 20.04 and Chromium / 15th July 2020
pip install notebook==5.6.0

I was also facing the same issue i changed the default setting of browser from Firefox to Chrome it will continue to work

Setting c.NotebookApp.use_redirect_file = False as described here (#4353 (comment)) solves this for me

Not working for me

Ubuntu 18.04
Jupyter Notebook 6.1.3
FF developer edition 80.0b8 64-bit

I have found this is AppArmor for me on ubuntu 20.04, if my default browser is mozilla it opens fine, I have chromium installed from snap store.

if you do a: tail -f /var/log/syslog you may see the reason as below. I have not looked to modify the policy just yet to allow.

apparmor="DENIED" operation="open" profile="snap.chromium.chromium" name="/home/username/.local/share/jupyter/runtime/nbserver-55637-open.html" pid=3385 comm="ThreadPoolForeg" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000

I had this same problem

Kubuntu 20.10
Chromium Version 87.0.4280.88 (Official Build) snap (64-bit)

Two solutions:

  1. Downgrade notebook

pip install notebook==5.6.0

  1. Disable redirect
$ jupyter-notebook --generate-config
Writing default config to: /home/<USER>/.jupyter/jupyter_notebook_config.py

Open that file, uncomment this line and set it to False (it is commented and set to True by default)
c.NotebookApp.use_redirect_file = False
All from command line:

jupyter-notebook --generate-config
sed -i 's/#c\.NotebookApp\.use_redirect_file\s=\sTrue/c\.NotebookApp\.use_redirect_file=False/g' /home/$USER/.jupyter/jupyter_notebook_config.py

Can we push this upstream? It has been almost two years since this issue is open

Was this page helpful?
0 / 5 - 0 ratings