{"record":{"id":"94ea5b0f978f00f0","repo":"pentaho/pentaho-kettle","slug":"jsoninputexception-e","errorCode":null,"errorMessage":"JsonInputException(e)","messagePattern":"JsonInputException\\(e\\)","errorType":"exception","errorClass":"JsonInputException","httpStatus":null,"severity":"error","filePath":"plugins/json/core/src/main/java/org/pentaho/di/trans/steps/jsoninput/JsonInput.java","lineNumber":259,"sourceCode":"    super.fillFileAdditionalFields( data, file );\n    data.filename = KettleVFS.getFilename( file );\n    data.filenr++;\n    if ( log.isDetailed() ) {\n      logDetailed( BaseMessages.getString( PKG, \"JsonInput.Log.OpeningFile\", file.toString() ) );\n    }\n    addFileToResultFilesname( file );\n  }\n\n  private void parseNextInputToRowSet( InputStream input ) throws KettleException {\n    try {\n      data.readerRowSet = data.reader.parse( input );\n      input.close();\n    } catch ( KettleException ke ) {\n      logInputError( ke );\n      throw new JsonInputException( ke );\n    } catch ( Exception e ) {\n      logInputError( e );\n      throw new JsonInputException( e );\n    }\n  }\n\n  private void logInputError( KettleException e ) {\n    logError( e.getLocalizedMessage(), e );\n    inputError( e.getLocalizedMessage() );\n  }\n\n  private void logInputError( Exception e ) {\n    String errMsg = ( !meta.isInFields() || meta.getIsAFile() )\n      ? BaseMessages.getString( PKG, \"JsonReader.Error.ParsingFile\", data.filename )\n      : BaseMessages.getString( PKG, \"JsonReader.Error.ParsingString\", data.readrow[ data.indexSourceField ] );\n    logError( errMsg, e );\n    inputError( errMsg );\n  }\n\n  private void incrementErrors() {\n    setErrors( getErrors() + 1 );","sourceCodeStart":241,"sourceCodeEnd":277,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/json/core/src/main/java/org/pentaho/di/trans/steps/jsoninput/JsonInput.java#L241-L277","documentation":"JsonInputException wrapping any non-Kettle Exception thrown by data.reader.parse(input) in parseNextInputToRowSet(). It is the generic catch-all next to the KettleException branch; it means an unexpected runtime/IO exception (not a normal Kettle failure) occurred while parsing the JSON input stream.","triggerScenarios":"getOneOutputRow -> parseNextInputToRowSet: data.reader.parse(input) throws IOException/RuntimeException etc. Concretely: stream IO failure mid-read, NPE inside the JSON reader, or classpath/library errors in the underlying parser.","commonSituations":"Network share or HTTP connection dropped mid-download; disk read error; incompatible JSON parser library version on the plugin classpath; null stream from an unreadable source.","solutions":["Read logInputError's logged message to identify the wrapped cause and fix that underlying IO/runtime issue.","Verify the source file/URL is fully readable and the connection is stable (retry if the source was temporarily unavailable).","Check the plugin's lib folder for a conflicting/duplicate JSON parser jar and align versions.","If the cause is an NPE, confirm all step fields (filename/URL, field paths) are non-null in the step configuration."],"exampleFix":"// before\nJsonInput input = new JsonInput(...); // fails mid-stream on flaky HTTP source\n// after: retry wrapper around transformation execution\nfor (int attempt = 0; attempt < 3; attempt++) {\n  try { runTransformation(); break; }\n  catch (KettleException e) { if (attempt == 2) throw e; sleep(backoff); }\n}","handlingStrategy":"try-catch","validationCode":"// check readability up front\nif (!Files.isReadable(Paths.get(path))) throw new IllegalStateException(\"Not readable: \" + path);","typeGuard":null,"tryCatchPattern":"try { runTransformation(); }\ncatch (KettleException e) {\n  Throwable root = getRootCause(e);\n  if (root instanceof IOException) { retryWithBackoff(); }\n  else { alert(root); throw e; }\n}","preventionTips":["Keep only one version of the JSON parser jar on the plugin classpath.","For HTTP sources, add retry/timeout handling upstream of the step.","Monitor source availability (file share/endpoint) before scheduled runs.","Always inspect the wrapped cause via e.getCause() before deciding on recovery."],"tags":["json","io","runtime-exception","kettle"],"backgroundTag":"file-read-failed","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}