You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Hans Deragon (Jira)" <ji...@apache.org> on 2020/11/06 18:38:00 UTC

[jira] [Comment Edited] (NIFI-4344) Improve bulletin messaging with exception details

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

Hans Deragon edited comment on NIFI-4344 at 11/6/20, 6:37 PM:
--------------------------------------------------------------

Why not show all the exception messages one after the other (not the full stacktrace, but only what is returned by e.getMessage())? I believe that it would be short enough to not require any UI artefact to hide them.

Bellow is an example. Notice that I would show the ultimate cause at the top (since that is was is most interesting and gives the most information):

java.lang.NumberFormatException: For input string: "SomeField"
 ┗━▶ Causes org.apache.nifi.serialization.MalformedRecordException: Error while getting next record. Root cause: java.lang.NumberFormatException: For input string: "SomeField"
 ┗━▶ Causes org.apache.nifi.processor.exception.ProcessException: Could not parse incoming data

BTW, this text should also show up on the top right corner of a processor when the error occurs.

Bellow, the full stacktrace as found in one of Nifi's log file:

2020-10-23 13:12:05,937 ERROR [Timer-Driven Process Thread-99] o.a.n.processors.standard.ConvertRecord ConvertRecord[id=62133e96-869c-1fe8-8544-23da01ef508e] Failed to process StandardFlowFileRecord[uuid=77efbd38-8f4e-4f56-9a04-0e43e38b3d36,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1603473042750-53511752, container=default, section=584], offset=411236, length=898749],offset=0,name=CDFRAF1CANVT21226_20200716115825.info,size=898749]; will route to failure: org.apache.nifi.processor.exception.ProcessException: Could not parse incoming data
org.apache.nifi.processor.exception.ProcessException: Could not parse incoming data
 at org.apache.nifi.processors.standard.AbstractRecordProcessor$1.process(AbstractRecordProcessor.java:171)
 at org.apache.nifi.controller.repository.StandardProcessSession.write(StandardProcessSession.java:3006)
 at org.apache.nifi.processors.standard.AbstractRecordProcessor.onTrigger(AbstractRecordProcessor.java:122)
 at org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)
 at org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1176)
 at org.apache.nifi.controller.tasks.ConnectableTask.invoke(ConnectableTask.java:213)
 at org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:117)
 at org.apache.nifi.engine.FlowEngine$2.run(FlowEngine.java:110)
 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
 at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
 at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
 at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
 at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.nifi.serialization.MalformedRecordException: Error while getting next record. Root cause: java.lang.NumberFormatException: For input string: "SomeField"
 at org.apache.nifi.csv.CSVRecordReader.nextRecord(CSVRecordReader.java:119)
 at org.apache.nifi.serialization.RecordReader.nextRecord(RecordReader.java:50)
 at org.apache.nifi.processors.standard.AbstractRecordProcessor$1.process(AbstractRecordProcessor.java:131)
 ... 14 common frames omitted
Caused by: java.lang.NumberFormatException: For input string: "SomeField"
 at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
 at java.lang.Integer.parseInt(Integer.java:580)
 at java.lang.Integer.parseInt(Integer.java:615)
 at org.apache.nifi.serialization.record.util.DataTypeUtils.toInteger(DataTypeUtils.java:1429)
 at org.apache.nifi.serialization.record.util.DataTypeUtils.convertType(DataTypeUtils.java:153)
 at org.apache.nifi.serialization.record.util.DataTypeUtils.convertType(DataTypeUtils.java:127)
 at org.apache.nifi.csv.AbstractCSVRecordReader.convert(AbstractCSVRecordReader.java:86)
 at org.apache.nifi.csv.CSVRecordReader.nextRecord(CSVRecordReader.java:105)
 ... 16 common frames omitted



was (Author: deragon):
Why not show all the exception messages one after the other (not the full stacktrace, but only what is returned by e.getMessage())? I believe that it would be short enough to not require any UI artefact to hide them.

Bellow is an example. Notice that I would show the ultimate cause at the top (since that is was is most interesting and gives the most information):

{{java.lang.NumberFormatException: For input string: "SomeField"}}
{{ ┗━▶ Causes org.apache.nifi.serialization.MalformedRecordException: Error while getting next record. Root cause: java.lang.NumberFormatException: For input string: "SomeField"}}
{{ ┗━▶ Causes org.apache.nifi.processor.exception.ProcessException: Could not parse incoming data}}

BTW, this text should also show up on the top right corner of a processor when the error occurs.

Bellow, the full stacktrace as found in one of Nifi's log file:

{{2020-10-23 13:12:05,937 ERROR [Timer-Driven Process Thread-99] o.a.n.processors.standard.ConvertRecord ConvertRecord[id=62133e96-869c-1fe8-8544-23da01ef508e] Failed to process StandardFlowFileRecord[uuid=77efbd38-8f4e-4f56-9a04-0e43e38b3d36,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1603473042750-53511752, container=default, section=584], offset=411236, length=898749],offset=0,name=CDFRAF1CANVT21226_20200716115825.info,size=898749]; will route to failure: org.apache.nifi.processor.exception.ProcessException: Could not parse incoming data}}
{{org.apache.nifi.processor.exception.ProcessException: Could not parse incoming data}}
{{ at org.apache.nifi.processors.standard.AbstractRecordProcessor$1.process(AbstractRecordProcessor.java:171)}}
{{ at org.apache.nifi.controller.repository.StandardProcessSession.write(StandardProcessSession.java:3006)}}
{{ at org.apache.nifi.processors.standard.AbstractRecordProcessor.onTrigger(AbstractRecordProcessor.java:122)}}
{{ at org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)}}
{{ at org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1176)}}
{{ at org.apache.nifi.controller.tasks.ConnectableTask.invoke(ConnectableTask.java:213)}}
{{ at org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:117)}}
{{ at org.apache.nifi.engine.FlowEngine$2.run(FlowEngine.java:110)}}
{{ at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)}}
{{ at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)}}
{{ at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)}}
{{ at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)}}
{{ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)}}
{{ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)}}
{{ at java.lang.Thread.run(Thread.java:748)}}
{{Caused by: org.apache.nifi.serialization.MalformedRecordException: Error while getting next record. Root cause: java.lang.NumberFormatException: For input string: "SomeField"}}
{{ at org.apache.nifi.csv.CSVRecordReader.nextRecord(CSVRecordReader.java:119)}}
{{ at org.apache.nifi.serialization.RecordReader.nextRecord(RecordReader.java:50)}}
{{ at org.apache.nifi.processors.standard.AbstractRecordProcessor$1.process(AbstractRecordProcessor.java:131)}}
{{ ... 14 common frames omitted}}
{{Caused by: java.lang.NumberFormatException: For input string: "SomeField"}}
{{ at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)}}
{{ at java.lang.Integer.parseInt(Integer.java:580)}}
{{ at java.lang.Integer.parseInt(Integer.java:615)}}
{{ at org.apache.nifi.serialization.record.util.DataTypeUtils.toInteger(DataTypeUtils.java:1429)}}
{{ at org.apache.nifi.serialization.record.util.DataTypeUtils.convertType(DataTypeUtils.java:153)}}
{{ at org.apache.nifi.serialization.record.util.DataTypeUtils.convertType(DataTypeUtils.java:127)}}
{{ at org.apache.nifi.csv.AbstractCSVRecordReader.convert(AbstractCSVRecordReader.java:86)}}
{{ at org.apache.nifi.csv.CSVRecordReader.nextRecord(CSVRecordReader.java:105)}}
{{ ... 16 common frames omitted}}

> Improve bulletin messaging with exception details
> -------------------------------------------------
>
>                 Key: NIFI-4344
>                 URL: https://issues.apache.org/jira/browse/NIFI-4344
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Core Framework, Core UI
>            Reporter: Pierre Villard
>            Priority: Major
>
> In some environments it is not possible/allowed to access the NiFi nodes (and consequently the log files). In such a situation, when developing a workflow, the only option to understand what could be wrong with a processor is to look at the bulletins.
> However, the bulletins only contain the message of the main exception. Quite often, the very useful messages to understand what is going on are located into the wrapped exception. At the moment, the only option is to go into the log files to get the messages. Even when access to the log files is authorized this can unnecessarily slow down workflow development.
> Ideally the full exception should be stored with the bulletin. However granting access to a full stack trace can raise security concerns, and besides, the bulletin tooltips are not designed to display large amount of data.
> Additional data would be provided in the bulletins view only. Few options are available:
> - display the full stack trace in the bulletins view but only for users with restricted component authorization.
> - display an enriched message with the concatenation of the detailed messages of the stack trace in the bulletins view (with or without restriction).
> Adding an example to illustrate the problem: with ConvertRecord, in case something is wrong with the schemas for the input/output data, the error is handled with:
> {code:title=ConvertRecord.java|borderStyle=solid}
> } catch (final SchemaNotFoundException | MalformedRecordException e) {
>     throw new ProcessException("Could not parse incoming data", e);
> }
> {code}
> In this case the bulletin will contain very little information.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)