15

When I run

jupyter notebook 

in the terminal, jupyter appears to launches correctly, but any attempt to view the page at localhost:8888 in chrome ends with a timeout. It works just fine in Safari, but it looks like notebook is getting malformed request headers from chrome. Does anyone have suggestions for how to fix this problem?

The output from jupyter reads:

[I 17:32:43.538 NotebookApp] [nb_conda_kernels] enabled, 3 kernels found [I 17:32:43.799 NotebookApp] ✓ nbpresent HTML export ENABLED [W 17:32:43.799 NotebookApp] ✗ nbpresent PDF export DISABLED: No module named nbbrowserpdf.exporters.pdf [I 17:32:43.802 NotebookApp] [nb_conda] enabled [I 17:32:43.846 NotebookApp] [nb_anacondacloud] enabled [I 17:32:43.852 NotebookApp] Serving notebooks from local directory: /Users/ianriley/Development/kaggle [I 17:32:43.852 NotebookApp] 0 active kernels [I 17:32:43.852 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/ [I 17:32:43.852 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). 

However when I navigate to localhost:8888, nothing shows up, and the connection eventually times out. Jupyter then prints the following to console:

[I 17:53:15.524 NotebookApp] Malformed HTTP message from ::1: Malformed HTTP headers: '' 

Perhaps the weirdest part of this is that I was able to run jupyter notebook just a couple of days ago, and I've not updated since then, to my knowledge. In case it is helpful, I'm running jupyter 4.2.0 on a macbook pro running sierra, and attempting to view the webpage with chrome v 56.0.2924.87. Thanks in advance for any help. Please let me know if I can supply additional information.

3
  • Did you manage to resolve this? I'm having the same issue where the page won't load in Chrome but it's fine in IE. Commented Jun 28, 2017 at 11:20
  • @NeilMountford, didn't get it resolved, ended up having to reinstall the whole OS for other reasons, and it's worked fine ever since. Commented Oct 26, 2017 at 21:09
  • I got annoyed the first time this happened as I had to fill all chrome passwords after resetting Chrome. So I have moved on to using Visual Studio Code. I don't think I will go back to Jupyter notebook now. VS Code is a gold mine. Commented Jun 16, 2023 at 16:04

5 Answers 5

9

For anyone stumbling across this thread in 2021 like I did I found that Chrome HSTS was responsible for auto forwarding from http to https in my local development environment. I was able to get around this by:

  • Going to chrome://net-internals/#hsts in my Chrome browser and entering the domain you are having issues with under Delete domain security and clicking on the Delete button.
Sign up to request clarification or add additional context in comments.

Comments

6

I had the same issue and managed to get it to load again by resetting my Chrome profile by going to chrome://settings/resetProfileSettings

Prior to this I tried clearing the cache/history but that didn't help, I'm guessing some part of the profile was corrupt.

3 Comments

Thanks, will check this as an answer since it at least solved your problem. As I stated above, I ended up having to do a fresh install of the OS, so I'll never know in my case.
I checked and the issue gets resolved with this fix. Something seriously gets messed up.. thanks for the solution.
Resetting browser as a fix? and putting that up as a link to click on, are you completely ...
4

Two solutions worked for me:

1) Resetting Chrome settings by going to chrome://settings/resetProfileSettings (as suggested by Neil)

2) Accessing the notebook via http instead of https (remove the "s" in http) - I was able to access my notebook this way via Safari, but not Chrome as Chrome defaults to https

Comments

0

Starting an instance of Anaconda navigator helped in my case

Comments

0

Accessing the notebook via http instead of https (remove the "s" in http) - I was able to access my notebook this way via Safari, but not Chrome as Chrome defaults to https

helped to resolve this

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.