pentaho/pentaho-kettle · error · JsonInputException

JsonInputException(e)

Error message

JsonInputException(e)

What it means

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.

Solutions

  1. Read logInputError's logged message to identify the wrapped cause and fix that underlying IO/runtime issue.
  2. Verify the source file/URL is fully readable and the connection is stable (retry if the source was temporarily unavailable).
  3. Check the plugin's lib folder for a conflicting/duplicate JSON parser jar and align versions.
  4. If the cause is an NPE, confirm all step fields (filename/URL, field paths) are non-null in the step configuration.

Example fix

// before
JsonInput input = new JsonInput(...); // fails mid-stream on flaky HTTP source
// after: retry wrapper around transformation execution
for (int attempt = 0; attempt < 3; attempt++) {
  try { runTransformation(); break; }
  catch (KettleException e) { if (attempt == 2) throw e; sleep(backoff); }
}
Defensive patterns

Strategy: try-catch

Validate before calling

// check readability up front
if (!Files.isReadable(Paths.get(path))) throw new IllegalStateException("Not readable: " + path);

Try / catch

try { runTransformation(); }
catch (KettleException e) {
  Throwable root = getRootCause(e);
  if (root instanceof IOException) { retryWithBackoff(); }
  else { alert(root); throw e; }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/94ea5b0f978f00f0. Report an issue: GitHub.

Appendix: source

Thrown at plugins/json/core/src/main/java/org/pentaho/di/trans/steps/jsoninput/JsonInput.java:259

    super.fillFileAdditionalFields( data, file );
    data.filename = KettleVFS.getFilename( file );
    data.filenr++;
    if ( log.isDetailed() ) {
      logDetailed( BaseMessages.getString( PKG, "JsonInput.Log.OpeningFile", file.toString() ) );
    }
    addFileToResultFilesname( file );
  }

  private void parseNextInputToRowSet( InputStream input ) throws KettleException {
    try {
      data.readerRowSet = data.reader.parse( input );
      input.close();
    } catch ( KettleException ke ) {
      logInputError( ke );
      throw new JsonInputException( ke );
    } catch ( Exception e ) {
      logInputError( e );
      throw new JsonInputException( e );
    }
  }

  private void logInputError( KettleException e ) {
    logError( e.getLocalizedMessage(), e );
    inputError( e.getLocalizedMessage() );
  }

  private void logInputError( Exception e ) {
    String errMsg = ( !meta.isInFields() || meta.getIsAFile() )
      ? BaseMessages.getString( PKG, "JsonReader.Error.ParsingFile", data.filename )
      : BaseMessages.getString( PKG, "JsonReader.Error.ParsingString", data.readrow[ data.indexSourceField ] );
    logError( errMsg, e );
    inputError( errMsg );
  }

  private void incrementErrors() {
    setErrors( getErrors() + 1 );

View on GitHub (pinned to f3058517a1)