Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jupyter Notebook timeout waiting for response in Chrome

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.

like image 579
Ian Riley Avatar asked Mar 08 '17 01:03

Ian Riley


People also ask

Does Jupyter Notebook have timeout?

If JupyterHub has not been notified of any activity after a certain period (the idle timeout), the server is considered to be inactive (idle) and will be culled (shutdown).

Why Jupyter Notebook is not opening in Chrome?

In order to open the jupyter notebook in a specific browser, you need to make that browser as your default browser. For example to open the jupyter notebook in Google Chrome: Open Chrome, go to Settings, select the Default Browser tab, and make Chrome as your default browser.

Why is my Jupyter Notebook not responding?

Jupyter doesn't load or doesn't work in the browserTry disabling any browser extensions and/or any Jupyter extensions you have installed. Some internet security software can interfere with Jupyter. If you have security software, try turning it off temporarily, and look in the settings for a more long-term solution.

How do I increase the timeout of a Jupyter Notebook cell?

If you are running a Jupyter notebook as a batch job, and it contains a long-running cell, you may encounter the following error: [NbConvertApp] ERROR | Timeout waiting for execute reply (30s). If your cell should take longer than this, you can increase the timeout with: c.ExecutePreprocessor.timeout = SECONDS in jupyter_nbconvert_config.py

Why is my Jupyter timeout not working?

This indicates that the cell caused Jupyter to timeout. You can avoid this by configuring a longer timeout. Here's how to do it in the pre-setup script of a custom environment definition:

Why is my Jupyter Notebook cell taking so long to finish?

If you’re a regular Jupyter Notebook user, you’ve likely encountered a situation in which a particular cell takes a long time to finish its execution. This occurrence is particularly common during model training in machine learning, hyperparameter optimization or even just when running lengthy computations.

What is notify in Jupyter?

Notify is a Jupyter Notebook extension that notifies the user once a long-running cell has finished executing through a browser notification. Notify is supported by Chrome and Firefox. In this article, I’ll show you how to enable notifications in Jupyter Notebook and Jupyter Lab using Notify.


2 Answers

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

like image 93
Josephine M. Ho Avatar answered Oct 02 '22 09:10

Josephine M. Ho


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.
like image 43
CyanPly Avatar answered Oct 02 '22 10:10

CyanPly