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 broken in master #3502

Closed
ellisonbg opened this issue Jul 1, 2013 · 2 comments · Fixed by #3504
Closed

Notebook broken in master #3502

ellisonbg opened this issue Jul 1, 2013 · 2 comments · Fixed by #3504
Milestone

Comments

@ellisonbg
Copy link
Member

I am seeing the following when a notebook is opened (also see a WebSocket can't connect in the browser):

ERROR:root:Uncaught exception in /kernels/3c8b14ec-662f-4360-bc2a-4706c67f8513/shell
Traceback (most recent call last):
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/websocket.py", line 254, in wrapper
    return callback(*args, **kwargs)
  File "/Users/bgranger/Documents/Computing/IPython/code/ipython/IPython/html/base/zmqhandlers.py", line 87, in open
    self.session = Session(parent=self)
  File "/Users/bgranger/Documents/Computing/IPython/code/ipython/IPython/kernel/zmq/session.py", line 395, in __init__
    super(Session, self).__init__(**kwargs)
  File "/Users/bgranger/Documents/Computing/IPython/code/ipython/IPython/config/configurable.py", line 88, in __init__
    self.parent = parent
  File "/Users/bgranger/Documents/Computing/IPython/code/ipython/IPython/utils/traitlets.py", line 315, in __set__
    new_value = self._validate(obj, value)
  File "/Users/bgranger/Documents/Computing/IPython/code/ipython/IPython/utils/traitlets.py", line 323, in _validate
    return self.validate(obj, value)
  File "/Users/bgranger/Documents/Computing/IPython/code/ipython/IPython/utils/traitlets.py", line 809, in validate
    self.error(obj, value)
  File "/Users/bgranger/Documents/Computing/IPython/code/ipython/IPython/utils/traitlets.py", line 646, in error
    raise TraitError(e)
TraitError: The 'parent' trait of a Session instance must be a Configurable or None, but a value of class 'IPython.html.services.kernels.handlers.ShellHandler' (i.e. <IPython.html.services.kernels.handlers.ShellHandler object at 0x1088c0950>) was specified.
ERROR:root:Uncaught exception, closing connection.
Traceback (most recent call last):
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/iostream.py", line 304, in wrapper
    callback(*args)
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/httpserver.py", line 250, in _on_headers
    self.request_callback(self._request)
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/web.py", line 1362, in __call__
    handler._execute(transforms, *args, **kwargs)
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/websocket.py", line 120, in _execute
    self.ws_connection.accept_connection()
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/websocket.py", line 454, in accept_connection
    self._accept_connection()
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/websocket.py", line 496, in _accept_connection
    self._receive_frame()
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/websocket.py", line 525, in _receive_frame
    self.stream.read_bytes(2, self._on_frame_start)
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/iostream.py", line 180, in read_bytes
    self._check_closed()
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/iostream.py", line 535, in _check_closed
    raise IOError("Stream is closed")
IOError: Stream is closed
ERROR:root:Exception in callback <zmq.eventloop.stack_context._StackContextWrapper object at 0x108671890>
Traceback (most recent call last):
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/zmq/eventloop/ioloop.py", line 418, in _run_callback
    callback()
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/iostream.py", line 304, in wrapper
    callback(*args)
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/httpserver.py", line 250, in _on_headers
    self.request_callback(self._request)
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/web.py", line 1362, in __call__
    handler._execute(transforms, *args, **kwargs)
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/websocket.py", line 120, in _execute
    self.ws_connection.accept_connection()
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/websocket.py", line 454, in accept_connection
    self._accept_connection()
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/websocket.py", line 496, in _accept_connection
    self._receive_frame()
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/websocket.py", line 525, in _receive_frame
    self.stream.read_bytes(2, self._on_frame_start)
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/iostream.py", line 180, in read_bytes
    self._check_closed()
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/iostream.py", line 535, in _check_closed
    raise IOError("Stream is closed")
IOError: Stream is closed
ERROR:root:Uncaught exception in /kernels/3c8b14ec-662f-4360-bc2a-4706c67f8513/stdin
Traceback (most recent call last):
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/websocket.py", line 254, in wrapper
    return callback(*args, **kwargs)
  File "/Users/bgranger/Documents/Computing/IPython/code/ipython/IPython/html/base/zmqhandlers.py", line 87, in open
    self.session = Session(parent=self)
  File "/Users/bgranger/Documents/Computing/IPython/code/ipython/IPython/kernel/zmq/session.py", line 395, in __init__
    super(Session, self).__init__(**kwargs)
  File "/Users/bgranger/Documents/Computing/IPython/code/ipython/IPython/config/configurable.py", line 88, in __init__
    self.parent = parent
  File "/Users/bgranger/Documents/Computing/IPython/code/ipython/IPython/utils/traitlets.py", line 315, in __set__
    new_value = self._validate(obj, value)
  File "/Users/bgranger/Documents/Computing/IPython/code/ipython/IPython/utils/traitlets.py", line 323, in _validate
    return self.validate(obj, value)
  File "/Users/bgranger/Documents/Computing/IPython/code/ipython/IPython/utils/traitlets.py", line 809, in validate
    self.error(obj, value)
  File "/Users/bgranger/Documents/Computing/IPython/code/ipython/IPython/utils/traitlets.py", line 646, in error
    raise TraitError(e)
TraitError: The 'parent' trait of a Session instance must be a Configurable or None, but a value of class 'IPython.html.services.kernels.handlers.StdinHandler' (i.e. <IPython.html.services.kernels.handlers.StdinHandler object at 0x1085d7510>) was specified.
ERROR:root:Uncaught exception, closing connection.
Traceback (most recent call last):
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/iostream.py", line 304, in wrapper
    callback(*args)
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/httpserver.py", line 250, in _on_headers
    self.request_callback(self._request)
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/web.py", line 1362, in __call__
    handler._execute(transforms, *args, **kwargs)
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/websocket.py", line 120, in _execute
    self.ws_connection.accept_connection()
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/websocket.py", line 454, in accept_connection
    self._accept_connection()
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/websocket.py", line 496, in _accept_connection
    self._receive_frame()
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/websocket.py", line 525, in _receive_frame
    self.stream.read_bytes(2, self._on_frame_start)
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/iostream.py", line 180, in read_bytes
    self._check_closed()
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/iostream.py", line 535, in _check_closed
    raise IOError("Stream is closed")
IOError: Stream is closed
ERROR:root:Exception in callback <zmq.eventloop.stack_context._StackContextWrapper object at 0x108671890>
Traceback (most recent call last):
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/zmq/eventloop/ioloop.py", line 418, in _run_callback
    callback()
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/iostream.py", line 304, in wrapper
    callback(*args)
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/httpserver.py", line 250, in _on_headers
    self.request_callback(self._request)
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/web.py", line 1362, in __call__
    handler._execute(transforms, *args, **kwargs)
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/websocket.py", line 120, in _execute
    self.ws_connection.accept_connection()
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/websocket.py", line 454, in accept_connection
    self._accept_connection()
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/websocket.py", line 496, in _accept_connection
    self._receive_frame()
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/websocket.py", line 525, in _receive_frame
    self.stream.read_bytes(2, self._on_frame_start)
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/iostream.py", line 180, in read_bytes
    self._check_closed()
  File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/tornado/iostream.py", line 535, in _check_closed
    raise IOError("Stream is closed")
IOError: Stream is closed
@ellisonbg
Copy link
Member Author

The source of this problem is pretty clear. The ZMQ handler needs to create a Session object and is currently passing parent=self to the Session constructor even though self is not a Configurable. Not sure what should be passed as parent though.

minrk added a commit to minrk/ipython that referenced this issue Jul 1, 2013
handlers aren't configurable, so shouldn't be passed as parent.

closes ipython#3502
@minrk
Copy link
Member

minrk commented Jul 1, 2013

Simple enough - parent=self only applies to children of Configurables. config=self.config is appropriate when the parent link doesn't make sense. Just a result of overzealous find/replace. Fixed by #3504.

minrk added a commit that referenced this issue Jul 1, 2013
don't use parent=self in handlers

handlers aren't configurable, so shouldn't be passed as parent.

closes #3502
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
handlers aren't configurable, so shouldn't be passed as parent.

closes ipython#3502
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
don't use parent=self in handlers

handlers aren't configurable, so shouldn't be passed as parent.

closes ipython#3502
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants