inspect_request to IJulia kernel returns error #417

Closed
johncsnyder opened this Issue Apr 28, 2016 · 5 comments

Projects

None yet

2 participants

@johncsnyder

I send the following request to an IJulia kernel (via websockets with jupyter kernel gateway) according to the Jupyter messaging protocol:

{'buffers': {},
 'channel': 'shell',
 'content': {'code': 'rand', 'cursor_pos': 4, 'detail_level': 0},
 'header': {'msg_id': ...,
            'msg_type': 'inspect_request',
            'session': '',
            'username': '',
            'version': '5.0'},
 'metadata': {},
 'parent_header': {}}

Jupyter sends back the following message:

{'buffers': [],
 'channel': 'iopub',
 'content': {'name': 'stderr',
             'text': 'ERROR (unhandled task failure): MethodError: `error_content` has no method matching error_content(::MethodError)\nClosest candidates are:\n  error_content(::Any, !Matched::Any)\n in eventloop at /Users/jcsnyder/.julia/v0.4/IJulia/src/IJulia.jl:149\n in anonymous at task.jl:447\n'},
 'header': {'date': '2016-04-28T14:56:13.559912',
            'msg_id': ...,
            'msg_type': 'stream',
            'session': '',
            'username': '',
            'version': '5.0'},
 'metadata': {},
 'msg_id': 'c4acab85-9888-4e69-868c-88b950eaa27e',
 'msg_type': 'stream',
 'parent_header': {'msg_id': '93b9aa9e-0d40-11e6-a741-20c9d08c0ac3',
                   'msg_type': 'execute_request',
                   'session': '',
                   'username': '',
                   'version': '5.0'}}

It appears to kill the kernel. It stops responding to any requests afterwards.

  • Using latest IJulia master.
  • I get the same error with both Julia 0.4.4-pre and Julia 0.5-dev.
  • same error with either detail_level=0 or 1.
  • I tried checking out latest ZMQ (no change).

Normal execute and autocomplete requests work fine.

@stevengj
Member
stevengj commented May 2, 2016

I can reproduce; a simpler version of your test case:

using IJulia
m = IJulia.Msg(["inspect_request"], Dict(), Dict("code"=>"rand", "cursor_pos"=>4, "detail_level"=>0))
IJulia.inspect_request_0x535c5df2(0, m)

(The inspect requests aren't used much and the code has had a tendency to bitrot.)

@stevengj
Member
stevengj commented May 2, 2016

Looks like there are a couple of problems here. The immediate one is that the error_content function call in inspect_request is now wrong due to #415. Second, the docdict function seems like it is wrong for recent versions of the Julia help system.

@johncsnyder

I can confirm this commit fixes the error_content issue. However, now I receive a different error message:

{'buffers': [],
 'channel': 'shell',
 'content': {'ename': 'UndefVarError',
             'evalue': 'UndefVarError: help not defined',
             'status': 'error',
             'traceback': ['UndefVarError: help not defined',
                           '',
                           ' in docdict at /Users/jcsnyder/.julia/v0.4/IJulia/src/handlers.jl:97']},
 'header': {'date': '2016-05-03T14:37:30.182266',
            'msg_id': 'a375146a-f5db-40c3-8f1e-16e584a12a7e',
            'msg_type': 'inspect_reply',
            'session': '',
            'username': '',
            'version': '5.0'},
 'metadata': {},
 'msg_id': 'a375146a-f5db-40c3-8f1e-16e584a12a7e',
 'msg_type': 'inspect_reply',
 'parent_header': {'msg_id': 'ccfd12c2-112b-11e6-9a3b-20c9d08c0ac3',
                   'msg_type': 'inspect_request',
                   'session': '',
                   'username': '',
                   'version': '5.0'}}

I guess this is related to your second point about the docdict function being incorrect.

@stevengj
Member
stevengj commented May 3, 2016

Yes.

@stevengj stevengj closed this in 399e223 Aug 5, 2016
@stevengj
Member
stevengj commented Aug 5, 2016

Should be fixed now; sorry it took so long.

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