{"record":{"id":"d8dab00235676036","repo":"pentaho/pentaho-kettle","slug":"rest-error-filenotfound","errorCode":"Rest.Error.FileNotFound","errorMessage":"Rest.Error.FileNotFound","messagePattern":"Rest\\.Error\\.FileNotFound","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/rest/core/src/main/java/org/pentaho/di/trans/steps/rest/Rest.java","lineNumber":371,"sourceCode":"      // SSL TRUST STORE CONFIGURATION\n      setSSLConfiguration( data );\n    }\n  }\n\n  protected void setSSLConfiguration( RestData data ) throws KettleException {\n    try ( var trustStoreIn = getInputStream( data.trustStoreFile ) ) {\n      data.sslContext = HttpClientManager.getSslContext( meta.isIgnoreSsl(),\n        trustStoreIn,\n        data.trustStorePassword );\n\n    } catch ( NoSuchAlgorithmException e ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"Rest.Error.NoSuchAlgorithm\" ), e );\n    } catch ( KeyStoreException e ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"Rest.Error.KeyStoreException\" ), e );\n    } catch ( CertificateException e ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"Rest.Error.CertificateException\" ), e );\n    } catch ( FileNotFoundException e ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"Rest.Error.FileNotFound\", data.trustStoreFile ), e );\n    } catch ( IOException e ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"Rest.Error.IOException\" ), e );\n    } catch ( KeyManagementException | UnrecoverableKeyException e ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"Rest.Error.KeyManagementException\" ), e );\n    }\n  }\n\n  /**\n   * Get an InputStream for the file with the given name.\n   * If the file name is empty or null, returns null.\n   *\n   * @param fileName the file name to get InputStream from\n   * @return InputStream for the given file, <code>null</code> if the given file name is empty or null\n   * @throws KettleException if any error occurs while getting the InputStream\n   */\n  protected InputStream getInputStream( String fileName ) throws KettleException {\n    InputStream inputStream = null;\n","sourceCodeStart":353,"sourceCodeEnd":389,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/rest/core/src/main/java/org/pentaho/di/trans/steps/rest/Rest.java#L353-L389","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["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.","Fix the 'Trust store file' setting or the variable it references (check environment/variable substitution resolves to an absolute path).","Copy the trust store to the target machine or use an absolute path if running on a cluster/remote execution environment.","If SSL is not needed, disable 'Use trust store file' in the step so the file is never loaded."],"exampleFix":"// before (step XML field)\n<trust_store_file>${TRUSTSTORE}/client.jks</trust_store_file>\n// after — point to an existing, absolute path\n<trust_store_file>/opt/pentaho/security/client.jks</trust_store_file>","handlingStrategy":"validation","validationCode":"// Before running the transformation\nFile ts = new File(environmentSubstitute(trustStoreFile));\nif (!ts.isFile() || !ts.canRead()) {\n  throw new IllegalStateException(\"Trust store not readable: \" + ts.getAbsolutePath());\n}","typeGuard":null,"tryCatchPattern":"try { restStepMeta.setTrustStoreFile(path); } catch (KettleException e) {\n  if (e.getMessage().contains(\"can not find file\")) { /* fix trust store path */ }\n  throw e;\n}","preventionTips":["Always use absolute paths for trust store files in step metadata.","Verify variables (e.g. ${TRUSTSTORE}) are defined in every execution environment.","Add the trust store to deployment packaging so it exists on all nodes.","Test the path with keytool -list before wiring it into the step."],"tags":["ssl","truststore","file-not-found","configuration"],"backgroundTag":"file-not-found","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"}