{"record":{"id":"78612fa2b622b263","repo":"pentaho/pentaho-kettle","slug":"gpbulkloadermeta-exception-connectionnotdefined-78612f","errorCode":"GPBulkLoaderMeta.Exception.ConnectionNotDefined","errorMessage":"GPBulkLoaderMeta.Exception.ConnectionNotDefined","messagePattern":"GPBulkLoaderMeta\\.Exception\\.ConnectionNotDefined","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":615,"sourceCode":"          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\n   */\n  public String getSchemaName() {\n    return schemaName;\n  }\n\n  /**\n   * @param schemaName\n   *          the schemaName to set\n   */\n  public void setSchemaName( String schemaName ) {\n    this.schemaName = schemaName;\n  }","sourceCodeStart":597,"sourceCodeEnd":633,"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#L597-L633","documentation":"getRequiredFields() first checks that a databaseMeta (the step's database connection) is present; if it is null it throws a KettleException with GPBulkLoaderMeta.Exception.ConnectionNotDefined instead of attempting any DB work. It means the bulk loader step has no database connection configured, so required-field validation cannot run.","triggerScenarios":"Calling getRequiredFields() on a PGBulkLoaderMeta where databaseMeta is null — the 'Connection' dropdown in the step dialog was never set, the named connection was deleted from the repository, or metadata injection omitted the CONNECTION attribute.","commonSituations":"Copying a step/transformation between repositories where the referenced connection does not exist; newly added step validated immediately; import of an XML transformation whose connection definition failed to import.","solutions":["Select a database connection in the step dialog's 'Connection' field.","Recreate the missing connection in the repository and re-link the step.","When using metadata injection, inject the CONNECTION attribute before validating."],"exampleFix":"// before\nmeta.setDatabaseMeta( null );\n// after\nDatabaseMeta dbMeta = transMeta.findDatabase( \"POSTGRES_STAGING\" );\nmeta.setDatabaseMeta( dbMeta );","handlingStrategy":"type-guard","validationCode":"if ( meta.getDatabaseMeta() == null ) { throw new KettleException( \"Select a database connection on the step first\" ); }","typeGuard":"boolean hasConnection( PGBulkLoaderMeta meta ) { return meta != null && meta.getDatabaseMeta() != null; }","tryCatchPattern":"try { fields = meta.getRequiredFields( transMeta ); } catch ( KettleException e ) { if ( meta.getDatabaseMeta() == null ) { /* prompt user to pick a connection */ } }","preventionTips":["Never leave the Connection dropdown unset in a saved step.","Re-link steps after importing transformations between repositories.","Inject CONNECTION in metadata-injection setups."],"tags":["kettle","missing-configuration","database-connection","pentaho"],"backgroundTag":"missing-required-config-field","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"}