You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a malformed JSON object is sent in the body of an HTTP request, we've noticed that the kernel will return an error, then "reset" but any further requests to the TCP ports of the tornado server just don't ever respond. Browser just sits and spins, and curl just sits and waits.
When using notebook_http mode as a quickie API to some notebook data, users sending a wrongly formed JSON object is a definite possibility and it would be nice to catch that and just return an error and then free it up for another request.
Sent a curl request like: "curl -v -k -d ',{ "aaa_name":"AAAA999D", "aaa_aaa_address":"aaaa.aaaa.aaaa"}' -H "Content-Type: application/json" -X POST https://x.x.x.x:9697/stuff/morestuff/evenmorestuff/somethingsomething/aaa?flag=true"
Console:
[KernelGatewayApp] Jupyter Kernel Gateway at https://0.0.0.0:9697
ERROR:tornado.access:500 POST /stuff/morestuff/evenmorestuff/somethingsomething/aaa?flag=true (x.x.x.x) 29860.00ms
[KernelGatewayApp] KernelRestarter: restarting kernel (1/5), keep random ports
ERROR:tornado.general:Uncaught exception, closing connection.
Traceback (most recent call last):
File "c:\python27\lib\site-packages\zmq\eventloop\zmqstream.py", line 414, in _run_callback
callback(*args, **kwargs)
File "c:\python27\lib\site-packages\tornado\stack_context.py", line 277, in null_wrapper
return fn(*args, **kwargs)
File "c:\python27\lib\site-packages\kernel_gateway\services\kernels\pool.py", line 145, in <lambda>
return lambda msg_list: self._on_reply(kernel_id, session, msg_list)
File "c:\python27\lib\site-packages\kernel_gateway\services\kernels\pool.py", line 124, in _on_reply
self.on_recv_funcs[kernel_id](msg)
File "c:\python27\lib\site-packages\kernel_gateway\notebook_http\handlers.py", line 108, in on_recv
if msg['parent_header']['msg_id'] == parent_header:
KeyError: 'msg_id'
ERROR:tornado.general:Uncaught exception, closing connection.
Traceback (most recent call last):
File "c:\python27\lib\site-packages\zmq\eventloop\zmqstream.py", line 440, in _handle_events
self._handle_recv()
File "c:\python27\lib\site-packages\zmq\eventloop\zmqstream.py", line 472, in _handle_recv
self._run_callback(callback, msg)
File "c:\python27\lib\site-packages\zmq\eventloop\zmqstream.py", line 414, in _run_callback
callback(*args, **kwargs)
File "c:\python27\lib\site-packages\tornado\stack_context.py", line 277, in null_wrapper
return fn(*args, **kwargs)
File "c:\python27\lib\site-packages\kernel_gateway\services\kernels\pool.py", line 145, in <lambda>
return lambda msg_list: self._on_reply(kernel_id, session, msg_list)
File "c:\python27\lib\site-packages\kernel_gateway\services\kernels\pool.py", line 124, in _on_reply
self.on_recv_funcs[kernel_id](msg)
File "c:\python27\lib\site-packages\kernel_gateway\notebook_http\handlers.py", line 108, in on_recv
if msg['parent_header']['msg_id'] == parent_header:
KeyError: 'msg_id'
ERROR:tornado.application:Exception in callback None
Traceback (most recent call last):
File "c:\python27\lib\site-packages\tornado\ioloop.py", line 888, in start
handler_func(fd_obj, events)
File "c:\python27\lib\site-packages\tornado\stack_context.py", line 277, in null_wrapper
return fn(*args, **kwargs)
File "c:\python27\lib\site-packages\zmq\eventloop\zmqstream.py", line 440, in _handle_events
self._handle_recv()
File "c:\python27\lib\site-packages\zmq\eventloop\zmqstream.py", line 472, in _handle_recv
self._run_callback(callback, msg)
File "c:\python27\lib\site-packages\zmq\eventloop\zmqstream.py", line 414, in _run_callback
callback(*args, **kwargs)
File "c:\python27\lib\site-packages\tornado\stack_context.py", line 277, in null_wrapper
return fn(*args, **kwargs)
File "c:\python27\lib\site-packages\kernel_gateway\services\kernels\pool.py", line 145, in <lambda>
return lambda msg_list: self._on_reply(kernel_id, session, msg_list)
File "c:\python27\lib\site-packages\kernel_gateway\services\kernels\pool.py", line 124, in _on_reply
self.on_recv_funcs[kernel_id](msg)
File "c:\python27\lib\site-packages\kernel_gateway\notebook_http\handlers.py", line 108, in on_recv
if msg['parent_header']['msg_id'] == parent_header:
KeyError: 'msg_id'
The text was updated successfully, but these errors were encountered:
INFO:tornado.access:200 POST /hello/world (127.0.0.1) 23.00ms
So it seems to be fine, unless there's something more going on in the notebook. I took a look at the last 10-20 commits in the package and nothing explicitly looks like it would fix this.
@dleen - was happening on windows. Switched to Linux and the issue didn't replicate. Might have been something unique to the windows environment, or to Python on Windows.
If a malformed JSON object is sent in the body of an HTTP request, we've noticed that the kernel will return an error, then "reset" but any further requests to the TCP ports of the tornado server just don't ever respond. Browser just sits and spins, and curl just sits and waits.
When using notebook_http mode as a quickie API to some notebook data, users sending a wrongly formed JSON object is a definite possibility and it would be nice to catch that and just return an error and then free it up for another request.
Sent a curl request like:
"curl -v -k -d ',{ "aaa_name":"AAAA999D", "aaa_aaa_address":"aaaa.aaaa.aaaa"}' -H "Content-Type: application/json" -X POST https://x.x.x.x:9697/stuff/morestuff/evenmorestuff/somethingsomething/aaa?flag=true"
Console:
The text was updated successfully, but these errors were encountered: