{"record":{"id":"df496456f8addbdb","repo":"pentaho/pentaho-kettle","slug":"yamlinput-log-nofiles","errorCode":null,"errorMessage":"YamlInput.Log.NoFiles","messagePattern":"YamlInput\\.Log\\.NoFiles","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/yaml-input/impl/src/main/java/org/pentaho/di/trans/steps/yamlinput/YamlInput.java","lineNumber":217,"sourceCode":"    } catch ( Exception e ) {\n      logError( BaseMessages.getString( PKG, \"YamlInput.Log.UnableToOpenFile\", \"\" + data.filenr, data.file\n        .toString(), e.toString() ) );\n      stopAll();\n      setErrors( 1 );\n      logError( Const.getStackTracker( e ) );\n      return false;\n    }\n    return true;\n  }\n\n  public boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException {\n    if ( first && !meta.isInFields() ) {\n      first = false;\n\n      data.files = meta.getFiles( getTransMeta().getBowl(), this );\n\n      if ( !meta.isdoNotFailIfNoFile() && data.files.nrOfFiles() == 0 ) {\n        throw new KettleException( BaseMessages.getString( PKG, \"YamlInput.Log.NoFiles\" ) );\n      }\n\n      handleMissingFiles();\n\n      // Create the output row meta-data\n      data.outputRowMeta = new RowMeta();\n      data.totalPreviousFields = 0;\n      data.totalOutFields = data.totalPreviousFields + data.nrInputFields;\n      meta.getFields( getTransMeta().getBowl(), data.outputRowMeta, getStepname(), null, null, this, repository,\n        metaStore );\n      data.totalOutStreamFields = data.outputRowMeta.size();\n\n    }\n    // Grab a row\n    Object[] r = getOneRow();\n\n    if ( r == null ) {\n      setOutputDone(); // signal end to receiver(s)","sourceCodeStart":199,"sourceCodeEnd":235,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/yaml-input/impl/src/main/java/org/pentaho/di/trans/steps/yamlinput/YamlInput.java#L199-L235","documentation":"In processRow, when the step reads from files (not fields), it builds the file list and throws this KettleException if zero files matched and the user has not enabled 'Do not fail if no file'. It distinguishes 'no files matched at all' from the per-file missing/access errors handled in handleMissingFiles.","triggerScenarios":"First call of processRow: !meta.isInFields(), meta.isdoNotFailIfNoFile() is false, and meta.getFiles(...).nrOfFiles() == 0 — wildcard or directory specification matched nothing.","commonSituations":"Wildcard patterns (e.g. *.yml vs *.yaml) that don't match any files, wrong directory, files not yet delivered at execution time, running on a different machine where the directory is empty.","solutions":["Fix the file/folder/wildcard specification so at least one file matches.","Check the box 'Do not fail if no file' in the step if an empty file list is a valid business case (the step will then just pass zero rows).","Use variables relative to the transformation location so paths resolve correctly on the executing host.","Test the pattern with 'Show filenames' / preview in the step dialog before running."],"exampleFix":"// before\nmeta.setDoNotFailIfNoFile(false); // pattern \"*.yml\" matched nothing -> exception\n// after: either fix the pattern to \"*.yaml\" or tolerate empty input\nmeta.setDoNotFailIfNoFile(true);","handlingStrategy":"validation","validationCode":"// check the resolved file list before running\nFileInputList files = meta.getFiles(bowl, variableSpace);\nif (files.nrOfFiles() == 0 && !meta.isdoNotFailIfNoFile()) {\n  throw new IllegalStateException(\"No files matched the configured pattern\");\n}","typeGuard":null,"tryCatchPattern":"try { trans.execute(...); } catch (KettleException e) {\n  if (e.getMessage().contains(\"NoFiles\")) { checkFilePatternsAndPaths(); }\n}","preventionTips":["Use 'Show filenames' in the step dialog to test wildcards at design time.","Set 'Do not fail if no file' when an empty directory is a legitimate case.","Guard against timing issues: ensure upstream file delivery jobs finish first."],"tags":["empty-file-list","wildcard","configuration"],"backgroundTag":"empty-result-set","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"}