{"record":{"id":"28b39a6fee40a565","repo":"pentaho/pentaho-kettle","slug":"gpbulkloadermeta-exception-tablenotfound","errorCode":null,"errorMessage":"GPBulkLoaderMeta.Exception.TableNotFound","messagePattern":"GPBulkLoaderMeta\\.Exception\\.TableNotFound","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/gp-bulk-loader/core/src/main/java/org/pentaho/di/trans/steps/gpbulkloader/GPBulkLoaderMeta.java","lineNumber":671,"sourceCode":"\n  @Override\n  public RowMetaInterface getRequiredFields( VariableSpace space ) throws KettleException {\n    String realTableName = space.environmentSubstitute( tableName );\n    String realSchemaName = space.environmentSubstitute( schemaName );\n\n    if ( databaseMeta != null ) {\n      Database db = new Database( loggingObject, databaseMeta );\n      try {\n        db.connect();\n\n        if ( !Utils.isEmpty( realTableName ) ) {\n          String schemaTable = databaseMeta.getQuotedSchemaTableCombination( realSchemaName, realTableName );\n\n          // Check if this table exists...\n          if ( db.checkTableExists( schemaTable ) ) {\n            return db.getTableFields( schemaTable );\n          } else {\n            throw new KettleException( BaseMessages.getString( PKG, \"GPBulkLoaderMeta.Exception.TableNotFound\" ) );\n          }\n        } else {\n          throw new KettleException( BaseMessages.getString( PKG, \"GPBulkLoaderMeta.Exception.TableNotSpecified\" ) );\n        }\n      } catch ( Exception e ) {\n        throw new KettleException(\n          BaseMessages.getString( PKG, \"GPBulkLoaderMeta.Exception.ErrorGettingFields\" ), e );\n      } finally {\n        db.close();\n      }\n    } else {\n      throw new KettleException( BaseMessages.getString( PKG, \"GPBulkLoaderMeta.Exception.ConnectionNotDefined\" ) );\n    }\n\n  }\n\n  /**\n   * @return the schemaName","sourceCodeStart":653,"sourceCodeEnd":689,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/gp-bulk-loader/core/src/main/java/org/pentaho/di/trans/steps/gpbulkloader/GPBulkLoaderMeta.java#L653-L689","documentation":"Thrown by GPBulkLoaderMeta.getRequiredFields when the configured target table does not exist in the database. The step checks table existence (db.checkTableExists) before fetching its field metadata to build required fields. Thrown as a KettleException with the localized TableNotFound message.","triggerScenarios":"Calling getRequiredFields with a schema/table name that resolves to a non-existent table (checkTableExists returns false).","commonSituations":"Typo in table name in the step dialog; table was dropped or renamed; wrong schema name resolved so the quoted schema-table combination points elsewhere; environmentSubstitute left an unresolved variable like ${TABLE} producing a bogus name.","solutions":["Verify the table exists in the target database: run \\dt or SELECT against information_schema.tables in the configured schema","Correct the schema/table name in the step settings (watch for unresolved ${VARIABLE}s)","Create the table before running (or use the step's SQL button to generate the CREATE TABLE)","Confirm the database connection points to the intended database/schema"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"Database db = new Database( loggingObject, databaseMeta ); db.connect();\nboolean exists = db.checkTableExists(\n  databaseMeta.getQuotedSchemaTableCombination( schema, table ) );\ndb.disconnect();\nif ( !exists ) throw new IllegalStateException( \"Table missing before run: \" + table );","typeGuard":"boolean tableReady = schemaTable != null && db.checkTableExists( schemaTable );","tryCatchPattern":"try { meta.getRequiredFields( transMeta ); } catch ( KettleException e ) { if ( e.getMessage().contains( \"TableNotFound\" ) ) { /* create table or fix name */ } }","preventionTips":["Verify schema.table names against information_schema before deploying","Run the step's SQL generation to create the table in new environments","Resolve all variables (${TABLE}) in the target environment first","Confirm the connection points to the expected database/schema"],"tags":["kettle","database","table-not-found","gp-bulk-loader"],"backgroundTag":"entity-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"}