notebook icon indicating copy to clipboard operation
notebook copied to clipboard

Notebook gets Malformed HTTP headers from Chrome

Open iandreariley opened this issue 9 years ago • 16 comments

When I attempt to view notebook at localhost:8888 in chrome, the connection times out, and jupyter notebook generates the following message:

[I 09:08:25.604 NotebookApp] Malformed HTTP message from ::1: Malformed HTTP headers: ''

I have also received:

Malformed HTTP message from ::1: Malformed HTTP headers: '\n\x05z\xc2\xaf\xc3\xa3\xc2\xa0\xc3\x90TP\x03\xc3\x9eSe\xc2\xa3\xc2\x96\xc2\x98\xc3\xab+\xc3\x84\xc3\xbd\xc2\x8a\x19\xc2\x861\xc3\xac3G\x00\x00 \n\n'

Everything works just fine in safari.

My setup is as follows: macOS sierra 10.12.13 chrome 56.0.2924.87 (64-bit) jupyter 4.2.0 jupyter notebook 4.2.3

and I'm simply running jupyter notbook from the command line. I get the following log ouput on launch, which I assume is normal:

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

I noticed the pdf warning message, but figured it's not important to viewing a notebook in a browser.

iandreariley avatar Mar 08 '17 17:03 iandreariley

same problem on mac

laian avatar May 30 '17 14:05 laian

Even I have the same problem. I tried it on my phone and even checked it with a few friends and it works. Mac is the one making it mess up.

labeebee avatar Oct 02 '17 04:10 labeebee

Having the same issue on windows 10 with latest anaconda setup - doesn't work when accessing from Chrome with a long delay and the same malformed http message; works fine from Firefox.

PeterisP avatar Oct 03 '17 23:10 PeterisP

I think this has to do with https://: only. When I tried http://: it worked. Not sure of the reason though.

On Wed, Oct 4, 2017 at 5:12 AM, Pēteris Paikens [email protected] wrote:

Having the same issue on windows 10 with latest anaconda setup.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jupyter/notebook/issues/2265#issuecomment-334010350, or mute the thread https://github.com/notifications/unsubscribe-auth/AIddVc-5FtEPKbQ55lSnWaDYPobe362Wks5sosZRgaJpZM4MXFY2 .

labeebee avatar Oct 04 '17 14:10 labeebee

Thanks @labeebee ! I encountered the same problem on mac, and your solution worked.

Rajjae avatar Feb 08 '18 15:02 Rajjae

@Rajjae You are welcome. 👍

labeebee avatar Feb 27 '18 12:02 labeebee

Two solutions worked for me:

1) Resetting Chrome settings by going to chrome://settings/resetProfileSettings

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

josephinemho avatar Jul 18 '18 21:07 josephinemho

@labeebee Thanks a lot!!!

bbrighttaer avatar Jan 31 '19 17:01 bbrighttaer

Thanks @labeebee,worked for me on GCP instance :)

tanmayasang avatar Apr 01 '19 05:04 tanmayasang

same problem on Chrome on Mac to connect jupyter on GCP

utotch avatar Aug 08 '19 21:08 utotch

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

image

LuisAMM avatar Mar 25 '20 16:03 LuisAMM

If you tried to use http://< ip > : < port > and didn't work, try this one: Clear your browser's cache, then restart Jupiter.

Gatsby027 avatar Nov 16 '20 10:11 Gatsby027

[I 02:26:47.848 LabApp] Malformed HTTP message from 114.221.185.161: no colon in header line [I 02:26:47.987 LabApp] Malformed HTTP message from 114.221.185.161: Malformed HTTP request line Same problem on Chrome >>Windows 10 (Also tried on Incognito), works well on IE !!

MohsennnMolaei avatar Nov 27 '20 18:11 MohsennnMolaei

Find a new method. In the chrome you can try to go here chrome://net-internals/#hsts

And under the "Delete domain security policies" Input "localhost" And click delete

Then use the http instead of https. It should work!

zzzace2000 avatar Jan 13 '21 08:01 zzzace2000

Chrome, and Secure Browsers on Chrome have a setting Privacy And Security -> More -> "Automatically use HTTPS Encryption". You have to turn that off in settings.

KeithAymar avatar Feb 10 '21 14:02 KeithAymar

Two solutions worked for me:

1) Resetting Chrome settings by going to chrome://settings/resetProfileSettings

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

Five years later, you're a life saver.

TimOP555 avatar Jun 27 '23 18:06 TimOP555