{"record":{"id":"c60489ba86db7d81","repo":"pentaho/pentaho-kettle","slug":"folder-arglist-0-can-not-be-found","errorCode":null,"errorMessage":"folder [ + ArgList[0] + ] can not be found!","messagePattern":"folder \\[ \\+ ArgList\\[0\\] \\+ \\] can not be found!","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/script/ScriptAddedFunctions.java","lineNumber":2188,"sourceCode":"    try {\n      if ( ArgList.length == 1 && !isNull( ArgList[0] ) && !isUndefined( ArgList[0] ) ) {\n        if ( ArgList[0].equals( null ) ) {\n          return false;\n        }\n        FileObject file = null;\n\n        try {\n          // Source file\n          file = KettleVFS.getInstance( bowl ).getFileObject( (String) ArgList[0] );\n          boolean isafolder = false;\n          if ( file.exists() ) {\n            if ( file.getType().equals( FileType.FOLDER ) ) {\n              isafolder = true;\n            } else {\n              throw new RuntimeException( \"[\" + ArgList[0] + \"] is not a folder!\" );\n            }\n          } else {\n            throw new RuntimeException( \"folder [\" + ArgList[0] + \"] can not be found!\" );\n          }\n          return isafolder;\n        } catch ( IOException e ) {\n          throw new RuntimeException( \"The function call isFolder throw an error : \" + e.toString() );\n        } finally {\n          if ( file != null ) {\n            try {\n              file.close();\n            } catch ( Exception e ) {\n              // Ignore errors\n            }\n          }\n        }\n\n      } else {\n        throw new RuntimeException( \"The function call isFolder is not valid.\" );\n      }\n    } catch ( Exception e ) {","sourceCodeStart":2170,"sourceCodeEnd":2206,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/script/ScriptAddedFunctions.java#L2170-L2206","documentation":"Thrown by ScriptAddedFunctions.isFolder() when the VFS file object at ArgList[0] does not exist (file.exists() returns false). The function requires the target to be an existing folder, so a missing or mis-typed directory path produces this RuntimeException instead of returning false.","triggerScenarios":"Calling isFolder(path) with a path that does not exist on the resolved VFS filesystem: wrong directory name, not-yet-created folder, wrong mount/scheme prefix, or case-mismatched path on a case-sensitive filesystem.","commonSituations":"Environment differences (folder exists on the dev machine but not the server); relative paths resolving against an unexpected base directory; typo'd or renamed directories; network VFS shares not mounted at job runtime.","solutions":["Verify the exact path exists (ls the parent directory) and fix typos or casing.","Create the directory before the call if it is expected to be produced by an earlier step (e.g. mkdir step or file.exists()/createFolder).","Use an absolute path or fix the working directory/base path so the relative path resolves correctly.","Confirm the VFS scheme/host prefix is correct and the share is mounted/connected at runtime.","If a missing folder should be an acceptable outcome, guard with a file-exists check in the script instead of relying on isFolder."],"exampleFix":"// before\nvar ok = isFolder( \"/data/repots\" ); // folder can not be found!\n// after\nvar ok = fileExists( \"/data/reports\" ) && isFolder( \"/data/reports\" );","handlingStrategy":"validation","validationCode":"// pre-check existence in the script\nvar ok = fileExists(p) ? isFolder(p) : false;","typeGuard":"function folderPathProvided(p) { return typeof p === \"string\" && p.trim().length > 0; }","tryCatchPattern":"try { ok = isFolder(p); } catch (e) { if (String(e.message).indexOf(\"can not be found\") >= 0) { ok = false; } else { throw e; } }","preventionTips":["Use absolute paths to avoid base-directory surprises.","Ensure directories are created before steps that inspect them (Wait-for-file / mkdir steps).","Check path casing against the target OS (Linux is case-sensitive).","Verify network mounts/VFS shares are available before the transformation runs.","Log the resolved path at runtime to catch env differences early."],"tags":["java","vfs","filesystem","missing-directory","path"],"backgroundTag":"directory-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"}