{"record":{"id":"6ba4fe1d717f7f96","repo":"pentaho/pentaho-kettle","slug":"autodoc-exception-filenamefieldnotfound","errorCode":null,"errorMessage":"AutoDoc.Exception.FilenameFieldNotFound","messagePattern":"AutoDoc\\.Exception\\.FilenameFieldNotFound","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/autodoc/AutoDoc.java","lineNumber":143,"sourceCode":"      }\n\n      setOutputDone();\n      return false;\n    }\n\n    if ( first ) {\n      first = false;\n\n      data.outputRowMeta = getInputRowMeta().clone();\n      meta.getFields( getTransMeta().getBowl(), data.outputRowMeta, getStepname(), null, null, this, repository,\n        metaStore );\n\n      // Get the filename field index...\n      //\n      String filenameField = environmentSubstitute( meta.getFilenameField() );\n      data.fileNameFieldIndex = getInputRowMeta().indexOfValue( filenameField );\n      if ( data.fileNameFieldIndex < 0 ) {\n        throw new KettleException( BaseMessages.getString(\n          PKG, \"AutoDoc.Exception.FilenameFieldNotFound\", filenameField ) );\n      }\n\n      // Get the file type field index...\n      //\n      String fileTypeField = environmentSubstitute( meta.getFileTypeField() );\n      data.fileTypeFieldIndex = getInputRowMeta().indexOfValue( fileTypeField );\n      if ( data.fileTypeFieldIndex < 0 ) {\n        throw new KettleException( BaseMessages.getString(\n          PKG, \"AutoDoc.Exception.FileTypeFieldNotFound\", fileTypeField ) );\n      }\n\n      data.repository = getTrans().getRepository();\n      if ( data.repository != null ) {\n        data.tree = data.repository.loadRepositoryDirectoryTree();\n      }\n\n      // Initialize the repository information handlers (images, metadata, loading, etc)","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/autodoc/AutoDoc.java#L125-L161","documentation":"AutoDoc.processRow throws KettleException 'AutoDoc.Exception.FilenameFieldNotFound' when the row's input row metadata does not contain the configured filename field. indexOfValue returns -1 and the step aborts. It is a configuration/row-shape mismatch: the field selected in the step settings is absent from the incoming stream.","triggerScenarios":"The 'filename field' configured on the AutoDoc step does not match any field in the incoming row (renamed upstream, wrong step input, or field produced by a later step).","commonSituations":"Renaming or removing the filename field in an upstream Select values / Java Script step; connecting the wrong input hop; pass-through rows where the metadata differs from expectations.","solutions":["Open the AutoDoc step settings and reselect the correct filename field from the available fields list.","Confirm the upstream step actually outputs the filename field (check with a 'Get fields' preview).","Fix the upstream field name or add a Select values step to (re)create it.","Preview the input rows to confirm the exact field name and casing."],"exampleFix":"// before (step config referencing removed field)\nmeta.setFilenameField(\"old_filename\");\n// after\nmeta.setFilenameField(\"filename\"); // matches the field produced upstream","handlingStrategy":"validation","validationCode":"public static void requireField(RowMetaInterface rowMeta, String fieldName) {\n  try {\n    rowMeta.indexOfValue(fieldName);\n  } catch (KettleValueException e) {\n    throw new IllegalStateException(\"Field not in input stream: \" + fieldName);\n  }\n}\n// call: requireField(inputRowMeta, \"filename\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Preview rows before the AutoDoc step to confirm field names.","After renaming fields upstream, update dependent step configs.","Use 'Get fields' in the step dialog instead of typing field names manually."],"tags":["kettle","field-lookup","configuration","runtime"],"backgroundTag":"resource-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"}