pentaho/pentaho-kettle · error · KettleException

Rest.Error.FileNotFound

Rest.Error.FileNotFound

Error message

Rest.Error.FileNotFound

What it means

Wraps a java.io.FileNotFoundException thrown while loading the trust store file in the REST step's SSL configuration (setSSLConfiguration, called during setConfig). The message reads 'We can not find file [{0}]' where {0} is data.trustStoreFile. It means the configured trust store path does not point to a readable file when the step initializes its HttpClient.

Solutions

  1. Verify the trust store file exists at the exact path configured in the step (File exists? readable by the Pentaho user?) using ls or the file browser.
  2. Fix the 'Trust store file' setting or the variable it references (check environment/variable substitution resolves to an absolute path).
  3. Copy the trust store to the target machine or use an absolute path if running on a cluster/remote execution environment.
  4. If SSL is not needed, disable 'Use trust store file' in the step so the file is never loaded.

Example fix

// before (step XML field)
<trust_store_file>${TRUSTSTORE}/client.jks</trust_store_file>
// after — point to an existing, absolute path
<trust_store_file>/opt/pentaho/security/client.jks</trust_store_file>
Defensive patterns

Strategy: validation

Validate before calling

// Before running the transformation
File ts = new File(environmentSubstitute(trustStoreFile));
if (!ts.isFile() || !ts.canRead()) {
  throw new IllegalStateException("Trust store not readable: " + ts.getAbsolutePath());
}

Try / catch

try { restStepMeta.setTrustStoreFile(path); } catch (KettleException e) {
  if (e.getMessage().contains("can not find file")) { /* fix trust store path */ }
  throw e;
}

Prevention

When it happens

Trigger: The step has 'Use trust store file' enabled (meta.isTrustStoreFile() true) and data.trustStoreFile (after environment substitution) points to a non-existent or unreadable file; KeyManagerFactory/TrustManagerFactory loading via FileInputStream throws FileNotFoundException inside setSSLConfiguration.

Common situations: Typo or stale path in the TrustStoreFile step setting; using ${Internal.Environment} variables that resolve differently on the server; deploying a transformation to a node where the .jks/.p12 file was not copied; relative path resolved against an unexpected working directory.

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/d8dab00235676036. Report an issue: GitHub.

Appendix: source

Thrown at plugins/rest/core/src/main/java/org/pentaho/di/trans/steps/rest/Rest.java:371

      // SSL TRUST STORE CONFIGURATION
      setSSLConfiguration( data );
    }
  }

  protected void setSSLConfiguration( RestData data ) throws KettleException {
    try ( var trustStoreIn = getInputStream( data.trustStoreFile ) ) {
      data.sslContext = HttpClientManager.getSslContext( meta.isIgnoreSsl(),
        trustStoreIn,
        data.trustStorePassword );

    } catch ( NoSuchAlgorithmException e ) {
      throw new KettleException( BaseMessages.getString( PKG, "Rest.Error.NoSuchAlgorithm" ), e );
    } catch ( KeyStoreException e ) {
      throw new KettleException( BaseMessages.getString( PKG, "Rest.Error.KeyStoreException" ), e );
    } catch ( CertificateException e ) {
      throw new KettleException( BaseMessages.getString( PKG, "Rest.Error.CertificateException" ), e );
    } catch ( FileNotFoundException e ) {
      throw new KettleException( BaseMessages.getString( PKG, "Rest.Error.FileNotFound", data.trustStoreFile ), e );
    } catch ( IOException e ) {
      throw new KettleException( BaseMessages.getString( PKG, "Rest.Error.IOException" ), e );
    } catch ( KeyManagementException | UnrecoverableKeyException e ) {
      throw new KettleException( BaseMessages.getString( PKG, "Rest.Error.KeyManagementException" ), e );
    }
  }

  /**
   * Get an InputStream for the file with the given name.
   * If the file name is empty or null, returns null.
   *
   * @param fileName the file name to get InputStream from
   * @return InputStream for the given file, <code>null</code> if the given file name is empty or null
   * @throws KettleException if any error occurs while getting the InputStream
   */
  protected InputStream getInputStream( String fileName ) throws KettleException {
    InputStream inputStream = null;

View on GitHub (pinned to f3058517a1)