Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notebook failed to load error #2747

Closed
fonnesbeck opened this issue Aug 11, 2017 · 50 comments
Closed

Notebook failed to load error #2747

fonnesbeck opened this issue Aug 11, 2017 · 50 comments

Comments

@fonnesbeck
Copy link

fonnesbeck commented Aug 11, 2017

After upgrading to the notebook from master ('5.1.0.dev'), I get a popup error saying that the notebook failed to load:

the underlying notebook is also truncated at the second cell, when in fact it is quite a large notebook.

If I close the notebook, and re-open it (without restarting it), it renders fine. The only thing unusual I notice in the console is:

[I 08:37:27.331 NotebookApp] Adapting to protocol v5.1 for kernel 515185bf-a09c-44c5-80c9-53390ff1b98e
@gnestor
Copy link
Contributor

gnestor commented Aug 11, 2017

Similar: #2733

@gnestor
Copy link
Contributor

gnestor commented Aug 11, 2017

I will investigate that "adapting to protocol 5.1" message...

Was this notebook already open in your browser and you just refreshed after the upgrade? Perhaps some 5.0 JS was being loaded from cache?

What browser are you using? Would you happen to have LastPass extension installed?

@fonnesbeck
Copy link
Author

I am running on Firefox 55 on macOS. Not using LastPass, but do have 1Password.

If I use a different conda env with an older version of the notebook, the notebook runs fine.

@gnestor
Copy link
Contributor

gnestor commented Aug 11, 2017

Ok, you're seeing the Adapting to protocol v5.1 message because protocol_version != client_protocol_version, which leads me to believe that the browser is loading 5.0 JS vs. 5.1. Try clearing the cache and/or doing a hard refresh.

@fonnesbeck
Copy link
Author

fonnesbeck commented Aug 11, 2017

Just got this after clearing the browser cache:

Happens for some, not all, notebooks. Here is the same notebook under 5.0.0:

@gnestor
Copy link
Contributor

gnestor commented Aug 11, 2017

Hmmm... So when you close the notebook (I assume when you close the tab) and re-open, you don't get the error?

@fonnesbeck
Copy link
Author

Actually, it sometimes errors again, but in some cases the error goes away. Also, if I use Safari this does not seem to happen. I will try switching back to Safari as my regular browser and see if it ever comes up.

@stonebig
Copy link

stonebig commented Aug 11, 2017

I had the same error once, and only once, on 5.1.0rc1, on windows10/jupyter-5.1/chrome/very_slow_pc (zero plugins). Just restarting the kernel solved it.

I would (blindly, as I'm not expert at all) bet on a slowness, or some remains of a previous widgets/whatever versions that are cleared with the relaunch.

In the past, there were some bigger cash-clearance issues when we were upgrading, so it could be the same thing ?

@fonnesbeck
Copy link
Author

I've now seen the issue pop up in Safari:

Closing the notebook tab and reopening it loaded the notebook properly.

@takluyver
Copy link
Member

When you hit the error, is there any more detail in the browser's JS console?

@fonnesbeck
Copy link
Author

It just occurred again in Safari, and the JS console reads as follows:

@gnestor
Copy link
Contributor

gnestor commented Aug 15, 2017

Those are just source maps so they shouldn't be causing any problems (although we should figure out how to avoid this error message)...

@takluyver
Copy link
Member

I believe that the "Can't make callback..." error is coming from Mathjax, but I don't understand how - I don't think we have changed anything significant in our use of Mathjax, and I've never run into this error myself.

You mentioned that it affects some notebooks but not others. Are there any of those notebooks which you could share?

@fonnesbeck
Copy link
Author

It seems to happen somewhat randomly. I can almost never reproduce it with a particular notebook, but it does keep occurring from time to time. And again, closing and reopening the tab makes the problem temporarily go away. Next time it happens I can post the notebook though.

@fonnesbeck
Copy link
Author

OK, just occurred with this notebook.

@takluyver
Copy link
Member

I couldn't reproduce it in a clean conda env with notebook 5.1rc1 installed. 😕

If it's related to Mathjax, and it only affects some notebooks, I would have expected it to affect notebooks with maths expressions in to be rendered. As far as I can see, that notebook doesn't, which is puzzling. Is it possible that it only affects notebooks with no maths expressions for Mathjax to act on?

@takluyver
Copy link
Member

Looking at the code, I also don't follow how it can give that error dialog without also logging to the console Notebook failed to load from JSON.

The only thing I can think of that might fit the symptoms is a JS caching issue. We've run before into caching issues which seem resilient to hard-refreshes and manually clearing the cache. I thought we had worked around the worst of them, but perhaps they're biting us again. The things we usually try in this case include:

  • A different browser: you've already tried this, and it did seem to help, which supports my theory.
  • A private browsing session: this can bypass the cache
  • Running the notebook server on a different port than usual - I think browsers cache per-port.

@willingc also had the same symptoms which seemed to be related to a browser extension (Lastpass). You're not using the same browser or the same extension, but it could be that a different extension is having a similar effect.

@fonnesbeck
Copy link
Author

OK, thanks, Actually, I'm getting just as many occurrences in Safari as I did with Firefox now. I did try clearing the cache on FF, but that didnt help.

I can try disabling 1Password and see if that fixes things.

@jasongrout
Copy link
Member

Can whoever is seeing this try using a private browsing mode/incognito mode, to make sure that there are no problems with extensions, cached data, cookies, etc?

@willingc
Copy link
Member

@jasongrout When I saw this in an earlier issue, the same behavior was seen in Safari's private mode too. Disabling LastPass worked for me on the notebooks that had the issue. Was the extension the root cause? I don't know.

@gnestor gnestor mentioned this issue Aug 17, 2017
11 tasks
@takluyver
Copy link
Member

Grant just released a second release candidate. We don't think we've made any change that should fix it, but can anyone experiencing this upgrade and let us know whether it still occurs?

@willingc
Copy link
Member

willingc commented Aug 18, 2017

Same issue on second release candidate. I've been trying to troubleshoot. This very old IPython/mathjax issue ipython/ipython#2349 seems closely related (same message being displayed "Type markdown..." and error message box). cc @gnestor @takluyver

ipython/ipython#2349 (comment)
and David Ketcheson's message a few below that.

@takluyver
Copy link
Member

Good find! It sounds like then it was due to caching issues and an outdated version of Mathjax. That was before we bundled Mathjax with the notebook.

The "Type markdown and Latex" message is what an empty, rendered Markdown cell shows. It looks like it's adding that cell, but the error is stopping it before it sets its content.

@asears
Copy link

asears commented Aug 19, 2017

It does seem like a caching or browser issue. I experienced similar issue. Kernel message keeps flickering, "Adapting to protocol v5.1 for kernel eb3544e4..." message keeps showing.

Switching from Chrome to IE solved it.

Anaconda jupyter-notebook --version
5.0.0

@willingc
Copy link
Member

I agree with @fonnesbeck. I'm not convinced the browser change is a long term fix.

@gnestor
Copy link
Contributor

gnestor commented Aug 20, 2017

@asears Are you running notebook 5.0.0 or 5.1.0rc*?

If this is affecting 5.0.0 too, then we shouldn't hold off on releasing 5.1.0 on account of this issue (not to say that we shouldn't get to the bottom of this and resolve it).

@takluyver
Copy link
Member

Sounds like a race condition, where what's in the browser's cache affects the order things happen. 😞

Agreed that if this is happening on 5.0 we should go ahead with the release, but for both @willingc and @fonnesbeck seemed to start seeing it on upgrade. It might be that changes in the upgrade make something which was previously rare more common.

@willingc
Copy link
Member

@takluyver I didn't see this behavior until the rc releases.

@takluyver
Copy link
Member

I think I might have tracked this down - see #2792 .

@fonnesbeck
Copy link
Author

Nice work! I will test the PR to see if it does the trick.

@fonnesbeck
Copy link
Author

I noticed also, under master, that notebooks will lock up during use on Safari making the browser unresponsive for several minutes. Looking at the console afterwards shows similar information:

@takluyver
Copy link
Member

Can you open a new issue for debugging that?

@fonnesbeck
Copy link
Author

Actually, it appears that your branch this too.

@fonnesbeck
Copy link
Author

I take that back. It just occurred with your PR. I will start a new issue.

@stonebig
Copy link

stonebig commented Sep 8, 2017

I notice I have the same message when I open a notebook, not even starting to execute it, wait the kernel to say "ready", then trying as first action a "File->Make a Copy" (in Notebook-5.1rc2)
notebook-5 1rc2

applying #2792 (in " Lib\site-packages\notebook\static\base\js" ?) doesn't change anything.

@takluyver
Copy link
Member

I've just released rc3, which includes a change to hopefully fix this error (I could never reproduce it, so it's hard to tell if it's fixed). Can you try upgrading and see if it works?

@willingc
Copy link
Member

@takluyver I haven't seen the error in a while since your last fix #2792. I briefly tested rc3 and it's looking fine for me. Will let you know if I see it in the future.

@gnestor
Copy link
Contributor

gnestor commented Sep 12, 2017

@fonnesbeck Can you try installing rc3 and let us know if it resolves this issue: pip install notebook --upgrade --force-reinstall --pre

@fonnesbeck
Copy link
Author

Yes, running it now. Will see what happens over the next few hours/days.

@fonnesbeck
Copy link
Author

No issues after a couple days of continuous use. Thanks!

@takluyver
Copy link
Member

Thanks Chris! I will close this issue, then. We can reopen it if someone finds they can reproduce it.

@gnestor I think this is the last issue tagged for 5.1. Is there anything else you're aware of that we should do before the release?

@gnestor
Copy link
Contributor

gnestor commented Sep 14, 2017

Nope, just #2752 and it looks like that was just merged! 👍

@shigabeev
Copy link

Well, problem still persists, is there any real fix for that problem ?
I've installed anaconda on two different computers (Win7 and RHEL) with no internet connection and Jupyter notebook just don't work.
jupyter 2
jupyter
But, sometimes it runs correctly, without any reason, it happen when I enable internet connection/run jupyter lab/wait for jupyter to load notebook longer then usual, but none of these actions fixes problem permanently so I guess it's more of a random coincidence.

By the way, I cannot repeat this problem on my own machine (OS X, pip(no anaconda), Safari & chrome)

@shigabeev
Copy link

It turns out that Jupyter have connection between kernels on different ports (not 8888), so when heavy firewall installed, it blocks such connections as suspected danger and kernels don't receive messages between each other and so Jupyter doesn't work.
Simplest solution for this is running notebook on port 8889 or any other. That explains why running jupyter lab temporary solves the problem, as it runs on 8889 when 8888 is busy.

Short answer: change port from 8888 to 8889

@takluyver
Copy link
Member

Security software has been a recurring problem, unfortunately. No idea why 8888 vs 8889 makes a difference.

@subhareng
Copy link

Hi there, i've tried most of the fixes suggested in #2708, #2752, and #2747 by updating notebook, pyzmq, using an older version of tornado, to fix this issue and I have had no luck. I even tried changing the port, but I'm still hitting this error and I can't run anything.

image

@takluyver
Copy link
Member

The "adapting to protocol..." message is not an error. What is actually going wrong?

@subhareng
Copy link

So to clarify, the main issue is that I will try running cells in my notebook like @shigabeev above and they won't actually run. The star will be present but it's not running the cell or yielding an output. I've changed the port and am still encountering the issue. The only message I get is the one I posted earlier.

@takluyver
Copy link
Member

Borrowing from the troubleshooting doc I'm adding in #3584:

Jupyter doesn't load or doesn't work in the browser

  • Try in another browser (e.g. if you normally use Firefox, try with Chrome). This helps pin down where the problem is.
  • Try 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.
  • In the address bar, try changing between localhost and 127.0.0.1. They should be the same, but in some cases it makes a difference.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants