pentaho/pentaho-kettle · error · KettleException

KettleException(e)

Error message

KettleException(e)

What it means

KettleException wrapping any Exception thrown in the JsonInputMeta file-listing logic (getFiles path) that builds the file/required arrays from resolved filenames. It means the step could not compute its input file list — typically a failure while expanding wildcards or resolving filenames via the variable space.

Solutions

  1. Check the wrapped cause in the log; usually a bad directory or filename pattern in the step's File tab.
  2. Test that the wildcard base directory exists and is readable by the Pentaho user (ls the path).
  3. Replace or define any ${VARIABLE} used in file/folder names and re-run.
  4. Simplify the wildcard (test in a shell with the same glob) to confirm which pattern fails.

Example fix

// before: File/Directory tab
${DATA_DIR}/logs/*.json   // DATA_DIR undefined
// after: define the variable, or use an absolute path
-D DATA_DIR=/opt/etd/data  or  /opt/etd/data/logs/*.json
Defensive patterns

Strategy: validation

Validate before calling

// verify the wildcard base directory resolves before running
String dir = space.environmentSubstitute("${DATA_DIR}/logs");
if (!Files.isDirectory(Paths.get(dir))) throw new IllegalStateException("Base dir missing: " + dir);

Prevention

When it happens

Trigger: During file-list computation (FileInputList creation / setFileRequired / Arrays.fill block): exception while resolving wildcard directories, expanding ${variables} in file paths, or accessing the directory to enumerate matching files.

Common situations: Wildcard pattern pointing at a nonexistent or unreadable directory; invalid glob characters; unresolved environment variables in file/folder names; VFS provider errors for remote schemes (SFTP, S3).

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


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

Appendix: source

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

            //
            if ( fileObject.exists() ) {
              // Convert to an absolute path and add it to the list.
              //
              newFilenames.add( fileObject.getName().getPath() );
            }
          }

          // Still here: set a new list of absolute filenames!
          //
          setFileName( newFilenames.toArray( new String[newFilenames.size()] ) );
          setFileMask( new String[newFilenames.size()] ); // all null since converted to absolute path.
          setFileRequired( new String[newFilenames.size()] ); // all null, turn to "Y" :
          Arrays.fill( getFileRequired(), YES );
        }
      }
      return null;
    } catch ( Exception e ) {
      throw new KettleException( e );
    }
  }

  @Override
  public String getEncoding() {
    return "UTF-8";
  }
  @Override
  public StepHelperInterface getStepHelperInterface() {
    return new JsonInputHelper();
  }

  // Needed for PDI-19138 purposes
  public static boolean getIncludeNullsProperty() {
    return "Y".equalsIgnoreCase( System.getProperty( Const.KETTLE_JSON_INPUT_INCLUDE_NULLS, "N" ) );
  }

}

View on GitHub (pinned to f3058517a1)