{"record":{"id":"087812eb25fb5929","repo":"pentaho/pentaho-kettle","slug":"gpbulkloadermeta-exception-tablenotfound-087812","errorCode":"GPBulkLoaderMeta.Exception.TableNotFound","errorMessage":"GPBulkLoaderMeta.Exception.TableNotFound","messagePattern":"GPBulkLoaderMeta\\.Exception\\.TableNotFound","errorType":"error_code","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/postgresql-db-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/pgbulkloader/PGBulkLoaderMeta.java","lineNumber":603,"sourceCode":"  }\n\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":585,"sourceCodeEnd":621,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/postgresql-db-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/pgbulkloader/PGBulkLoaderMeta.java#L585-L621","documentation":"getRequiredFields() connects to the configured database and, if the fully-quoted schema.table exists via db.checkTableExists(schemaTable), returns its fields; otherwise it throws a KettleException with the localized message GPBulkLoaderMeta.Exception.TableNotFound. It means the target table the bulk loader should load into could not be found in the database at the time required-fields validation runs.","triggerScenarios":"Calling getRequiredFields() when realSchemaName/realTableName resolve to a table that does not exist (checkTableExists returns false): wrong schema/table name in the step dialog, wrong connection database, or the table was dropped/renamed.","commonSituations":"Typo or case-sensitivity mismatch in schema/table name (PostgreSQL lowercases unquoted identifiers); pointing at a dev vs prod database; table not yet created because 'SQL' generation output was never executed.","solutions":["Run the generated SQL (SQL button on the step) to create the target table, then retry.","Verify schema and table names in the step dialog against the database (e.g. \\dt schema.* in psql), mindful of PostgreSQL's lowercasing of unquoted names.","Confirm the step's database connection points to the environment you expect.","If using variables, check their resolved values ({Internal...}/env vars) at runtime."],"exampleFix":"// before\ntableName = \"AUDIT_LOG\"; // doesn't exist in schema public on this DB\n// after: create table first via step SQL or correct the name\ntableName = \"audit_log\"; // matches lowercased PostgreSQL identifier","handlingStrategy":"validation","validationCode":"Database db = new Database( loggingObject, databaseMeta );\ndb.connect();\nString schemaTable = databaseMeta.getQuotedSchemaTableCombination( schemaName, tableName );\nif ( !db.checkTableExists( schemaTable ) ) { throw new KettleException( \"Target table missing: \" + schemaTable ); }\ndb.disconnect();","typeGuard":null,"tryCatchPattern":"try { meta.getRequiredFields( transMeta ); } catch ( KettleException e ) { /* run generated SQL or fix table name */ }","preventionTips":["Execute the step's generated SQL before validating/running.","Use lowercase unquoted table names in PostgreSQL or quote them deliberately.","Confirm which environment the connection points to."],"tags":["kettle","postgresql","database","table-not-found","pentaho"],"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"}