[ 
https://issues.apache.org/jira/browse/TOREE-522?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17563981#comment-17563981
 ] 

Kevin Bates commented on TOREE-522:
-----------------------------------

After looking into this the last couple of days, I can conclude this is an 
issue with how Notebook renders errors from execution results rather than the 
Toree response.  The changes in the aforementioned PR (180) are correct.  Prior 
to those changes, errors were conveyed via the `execute_result` response - 
which does not conform to the messaging protocol that indicates (rather 
implicitly) that errors are returned via the `error` message type.  This is 
also why the "error" is displayed as "output" and includes the execution 
counter, etc.

The issue is that, in certain error scenarios, there is no `traceback` entry in 
the error response.  The Notebook UI is only looking at non-empty traceback 
entries in `error` responses.  If the execution were to produce a traceback, 
such as division by zero, then the error would be visible:

!toree-current-nb-w-traceback.png!

Jupyter Lab, on the other hand, will detect empty tracebacks and, in those 
cases, [compose the `ename` and `evalue` 
fields|https://github.com/jupyterlab/jupyterlab/blob/master/packages/rendermime/src/outputmodel.ts#L281-L282]
 of the error into a message:

!toree-current-lab.png!

I have opened a [pull request against the 6.4.x branch of 
Notebook|https://github.com/jupyter/notebook/pull/6466] to have it render 
errors similar to lab:

!toree-fix-nb.png!

As a result, this issue should be closed.

 

> Release 0.4.0 changes around handling iopub.error have broken error reporting 
> in Jupyter Notebook UI
> ----------------------------------------------------------------------------------------------------
>
>                 Key: TOREE-522
>                 URL: https://issues.apache.org/jira/browse/TOREE-522
>             Project: TOREE
>          Issue Type: Bug
>          Components: Kernel
>    Affects Versions: 0.4.0
>         Environment: Both Spark 2.4.x and 2.2.x
> The version of the notebook server is: 6.0.3
> The server is running on this version of Python:
> Python 3.7.6 (default, Jan  8 2020, 19:59:22) 
> [GCC 7.3.0]
> Current Kernel Information:
> Apache Toree
>            Reporter: Ventsislav Konakchiyski
>            Assignee: Luciano Resende
>            Priority: Critical
>         Attachments: f12-toree-channels-api.png, 
> jupyter-classic-behavior.png, jupyterlab-behavior.png, 
> notebook-no-error-0.4.0.png, notebook-versions.png, screenshot-1.png, 
> toree-current-lab.png, toree-current-nb-w-traceback.png, toree-fix-nb.png
>
>
> We have noticed that since the python package was released, all of our images 
> that were build after 0.4.0 was released were not reporting errors in the 
> notebook UI when running broken code.
>  
> What happens:
> 1. Open a Toree - Scala notebook
> 2. Type some random broken code
> 3. As far as the UI is concerned, it has ran successfully and no error was 
> reported to the user.
> See screenshot `notebook-no-error-0.4.0.png`
>  
> Inspecting the network requests, I can see that the error does come back from 
> the API, but the UI is not handling it correctly. See screenshot 
> `f12-toree-channels-api.png`
>  
> Reverting back to 0.3.0 release works fine as per `notebook-versions.png` 
> screenshot
>  
> Let me know if you need more details



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to