Notebook Save fails in pylab mode after using display(). #2209

Closed
knorthover opened this Issue Jul 27, 2012 · 8 comments

Comments

Projects
None yet
5 participants
@knorthover

Windows 7 64-bit. IPython 64-bit. Chrome browser (current version 20.0.1132.57 m)

After generating a plot in the usual way and then using display(gcf()) to embed it inline in the notebook the Save function stops working. The small message display shows "Saving Notebook" but:

  • The "Notebook Saved" message does not appear
  • The "Last Saved" timestamp in the header is not updated
  • Nor is the file on disk.

The notebook then seems to lock into this state. It apparently works normally, accepts new cells, edit, and even generating more plots and successfully embedding them.

  1. Download creates a copy of the last successfully saved file
  2. Copy makes a copy of the last saved, not the current browser content
  3. Print View does not load
  4. Restarting the kernel makes no difference
  5. Close and Halt puts up the "Unsaved changes / Leave this page" requester.
  6. Exiting the workbook completely and then reloading it clears the problem till the next use of display().
@minrk

This comment has been minimized.

Show comment
Hide comment
@minrk

minrk Jan 19, 2013

Member

Do you see any log messages in the server's console window?

I bet there's an encoding or permissions issue happening.

Member

minrk commented Jan 19, 2013

Do you see any log messages in the server's console window?

I bet there's an encoding or permissions issue happening.

@badbitstuff

This comment has been minimized.

Show comment
Hide comment
@badbitstuff

badbitstuff Aug 13, 2013

Same problem here, with ipython 1.0. Tested on 32 bits installations on both windows vista 32bit and windows 7 64 bit. Installed manually and with easy_install -U ipython[all]. Downgraded tornado to 2.1 as well. Same notebook works perfectly on linux.

Started the nb server with
ipython notebook --pylab inline --debug --no-browser

The nb saves successfully after one plot with one line and is more likely not savable when plotting more figures/lines.

Plotting the following in two figures, will certainly make the nb unresponsive:

plot(randn(100).reshape((10,10)))

There is no log messages when trying to save, except for "polling kernel ...".
Same problem when running as administrator and/or disabling uac. Not certain how this can be an encoding problem.

Added some print statements in nbmanager.py, method save_notebook, line 156 and html/services/notebooks/handlers.py method put line 76 , none of these methods are entered when saving fails.

This seems to be the same problem as posted here:
http://mail.scipy.org/pipermail/ipython-dev/2012-August/010132.html

Update: none of the above mentioned methods are entered ...

Same problem here, with ipython 1.0. Tested on 32 bits installations on both windows vista 32bit and windows 7 64 bit. Installed manually and with easy_install -U ipython[all]. Downgraded tornado to 2.1 as well. Same notebook works perfectly on linux.

Started the nb server with
ipython notebook --pylab inline --debug --no-browser

The nb saves successfully after one plot with one line and is more likely not savable when plotting more figures/lines.

Plotting the following in two figures, will certainly make the nb unresponsive:

plot(randn(100).reshape((10,10)))

There is no log messages when trying to save, except for "polling kernel ...".
Same problem when running as administrator and/or disabling uac. Not certain how this can be an encoding problem.

Added some print statements in nbmanager.py, method save_notebook, line 156 and html/services/notebooks/handlers.py method put line 76 , none of these methods are entered when saving fails.

This seems to be the same problem as posted here:
http://mail.scipy.org/pipermail/ipython-dev/2012-August/010132.html

Update: none of the above mentioned methods are entered ...

@minrk

This comment has been minimized.

Show comment
Hide comment
@minrk

minrk Aug 13, 2013

Member

any messages in the js console?

Member

minrk commented Aug 13, 2013

any messages in the js console?

@badbitstuff

This comment has been minimized.

Show comment
Hide comment
@badbitstuff

badbitstuff Aug 14, 2013

Using chrome 28.0.1500.95 m

Nothing after initialization from the js console

Default extension for metadata editing loaded. default.js:88
Slideshow extension for metadata editing loaded. slideshow.js:56
patching CM for undefined indent main.js:27
Kernel started:  778f0420-0fc6-4a50-aef0-8151a2f3be08 kernel.js:110
Starting WebSockets: ws://127.0.0.1:8888/kernels/778f0420-0fc6-4a50-aef0-8151a2f3be08 kernel.js:143

After pressing Save and Checkpoint about 10 times, the notebook succeeded to save once. A failing save gives the following network activity:

PUT http://127.0.0.1:8888/notebooks/1bdbe196-041b-453e-900d-fce5cc947c27 HTTP/1.1
Accept: */*
Referer: http://127.0.0.1:8888/1bdbe196-041b-453e-900d-fce5cc947c27
Origin: http://127.0.0.1:8888
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36
Content-Type: application/json

With the following response header:

HTTP/1.1 0 

The successful request:

PUT /notebooks/1bdbe196-041b-453e-900d-fce5cc947c27 HTTP/1.1
Host: 127.0.0.1:8888
Connection: keep-alive
Content-Length: 57225
Accept: */*
Origin: http://127.0.0.1:8888
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36
Content-Type: application/json
Referer: http://127.0.0.1:8888/1bdbe196-041b-453e-900d-fce5cc947c27
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8

With the following response header:

HTTP/1.1 204 No Content
Date: Wed, 14 Aug 2013 06:46:50 GMT
Content-Length: 0
Content-Type: text/html; charset=UTF-8
Server: TornadoServer/3.1
Set-Cookie: username-127.0.0.1-8888=; expires=Tue, 14 Aug 2012 06:46:50 GMT; Path=/

Using chrome 28.0.1500.95 m

Nothing after initialization from the js console

Default extension for metadata editing loaded. default.js:88
Slideshow extension for metadata editing loaded. slideshow.js:56
patching CM for undefined indent main.js:27
Kernel started:  778f0420-0fc6-4a50-aef0-8151a2f3be08 kernel.js:110
Starting WebSockets: ws://127.0.0.1:8888/kernels/778f0420-0fc6-4a50-aef0-8151a2f3be08 kernel.js:143

After pressing Save and Checkpoint about 10 times, the notebook succeeded to save once. A failing save gives the following network activity:

PUT http://127.0.0.1:8888/notebooks/1bdbe196-041b-453e-900d-fce5cc947c27 HTTP/1.1
Accept: */*
Referer: http://127.0.0.1:8888/1bdbe196-041b-453e-900d-fce5cc947c27
Origin: http://127.0.0.1:8888
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36
Content-Type: application/json

With the following response header:

HTTP/1.1 0 

The successful request:

PUT /notebooks/1bdbe196-041b-453e-900d-fce5cc947c27 HTTP/1.1
Host: 127.0.0.1:8888
Connection: keep-alive
Content-Length: 57225
Accept: */*
Origin: http://127.0.0.1:8888
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36
Content-Type: application/json
Referer: http://127.0.0.1:8888/1bdbe196-041b-453e-900d-fce5cc947c27
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8

With the following response header:

HTTP/1.1 204 No Content
Date: Wed, 14 Aug 2013 06:46:50 GMT
Content-Length: 0
Content-Type: text/html; charset=UTF-8
Server: TornadoServer/3.1
Set-Cookie: username-127.0.0.1-8888=; expires=Tue, 14 Aug 2012 06:46:50 GMT; Path=/
@ivanov

This comment has been minimized.

Show comment
Hide comment
@ivanov

ivanov Jun 17, 2014

Member

@knorthover @badbitstuff are either of you still seeing this behavior on the latest version of IPython? if not, I'll go ahead and close this

Member

ivanov commented Jun 17, 2014

@knorthover @badbitstuff are either of you still seeing this behavior on the latest version of IPython? if not, I'll go ahead and close this

@ivanov

This comment has been minimized.

Show comment
Hide comment
@ivanov

ivanov Jun 17, 2014

Member

Marking as needs-info so on a future pass (in a month?) we can close this if there's no activity

Member

ivanov commented Jun 17, 2014

Marking as needs-info so on a future pass (in a month?) we can close this if there's no activity

@badbitstuff

This comment has been minimized.

Show comment
Hide comment
@badbitstuff

badbitstuff Jun 17, 2014

@ivanov, installed anaconda after a while, no problems since. Either anaconda fixed the prerequisites or a newer version did the trick.

@ivanov, installed anaconda after a while, no problems since. Either anaconda fixed the prerequisites or a newer version did the trick.

@takluyver

This comment has been minimized.

Show comment
Hide comment
@takluyver

takluyver Jun 17, 2014

Member

OK, let's close this, then. We can always reopen it if someone else can replicate the symptoms.

Member

takluyver commented Jun 17, 2014

OK, let's close this, then. We can always reopen it if someone else can replicate the symptoms.

@takluyver takluyver closed this Jun 17, 2014

@takluyver takluyver added this to the no action milestone Jun 17, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment