{"record":{"id":"bb9d8a5722fc4346","repo":"pentaho/pentaho-kettle","slug":"gettablenames-exception-couldnotfindfield","errorCode":"GetTableNames.Exception.CouldnotFindField","errorMessage":"GetTableNames.Exception.CouldnotFindField","messagePattern":"GetTableNames\\.Exception\\.CouldnotFindField","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/gettablenames/GetTableNames.java","lineNumber":98,"sourceCode":"        data.inputRowMeta = getInputRowMeta();\n        data.outputRowMeta = data.inputRowMeta.clone();\n        // Get total previous fields\n        data.totalpreviousfields = data.inputRowMeta.size();\n\n        // Check is filename field is provided\n        if ( Utils.isEmpty( meta.getSchemaFieldName() ) ) {\n          logError( BaseMessages.getString( PKG, \"GetTableNames.Log.NoSchemaField\" ) );\n          throw new KettleException( BaseMessages.getString( PKG, \"GetTableNames.Log.NoSchemaField\" ) );\n        }\n\n        // cache the position of the field\n        if ( data.indexOfSchemaField < 0 ) {\n          data.indexOfSchemaField = data.inputRowMeta.indexOfValue( meta.getSchemaFieldName() );\n          if ( data.indexOfSchemaField < 0 ) {\n            // The field is unreachable !\n            logError( BaseMessages.getString( PKG, \"GetTableNames.Log.ErrorFindingField\" )\n              + \"[\" + meta.getSchemaFieldName() + \"]\" );\n            throw new KettleException( BaseMessages.getString(\n              PKG, \"GetTableNames.Exception.CouldnotFindField\", meta.getSchemaFieldName() ) );\n          }\n        }\n\n      } else {\n        data.outputRowMeta = new RowMeta();\n      }\n\n      meta.getFields( getTransMeta().getBowl(), data.outputRowMeta, getStepname(), null, null, this, repository,\n        metaStore );\n\n    }\n\n    if ( meta.isDynamicSchema() ) {\n      // Get value of dynamic schema ...\n      data.realSchemaName = data.inputRowMeta.getString( data.readrow, data.indexOfSchemaField );\n    }\n","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/gettablenames/GetTableNames.java#L80-L116","documentation":"processRow looks up the configured schema fieldname in the incoming row's RowMeta via indexOfValue. If the field is not present in the row stream, the step throws this KettleException indicating the configured field could not be found. Unlike error 1511, the field name IS configured — it just doesn't exist in the incoming rows.","triggerScenarios":"meta.getSchemaFieldName() is non-empty but data.inputRowMeta.indexOfValue(name) returns -1, i.e. no preceding step produces a field with exactly that name (case-sensitive match) when the Get Table Names step executes.","commonSituations":"Typo in the schema fieldname setting; upstream step renamed or removed the field; wrong hop order so the field arrives after this step; field name differs in case (Oracle upper-case vs. Kettle exact match).","solutions":["Verify the 'schema fieldname' exactly matches (including case) a field produced by the previous step.","Inspect the input rows with a 'Fields' preview or a dummy/log step to list actual incoming field names.","Insert a 'Select values' / 'Rename' step to create or rename the expected field upstream.","Reorder hops so the field-producing step executes before Get Table Names."],"exampleFix":"// before: mismatched field name\nmeta.setSchemaFieldName( \"SchemName\" ); // typo, not in row stream\n// after\nmeta.setSchemaFieldName( \"schemaName\" ); // matches field from previous step exactly","handlingStrategy":"validation","validationCode":"// before executing\nString field = meta.getSchemaFieldName();\nif ( field != null && prevRowMeta.indexOfValue( field ) < 0 ) {\n  throw new IllegalArgumentException( \"Field not in input stream: \" + field );\n}","typeGuard":null,"tryCatchPattern":"try {\n  trans.execute( null );\n} catch ( KettleException e ) {\n  if ( e.getMessage().contains( \"CouldnotFindField\" ) ) {\n    logError( \"Verify field name and upstream step order\" );\n  }\n}","preventionTips":["Preview upstream rows to confirm the exact field name/case.","Rename fields explicitly with a Select values step before Get Table Names.","Re-check step config after renaming upstream fields."],"tags":["kettle","row-metadata","field-lookup","configuration"],"backgroundTag":"record-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"}