{"record":{"id":"18decc4b3c455516","repo":"pentaho/pentaho-kettle","slug":"monetdbbulkloadermeta-exception-connectionnotdefined","errorCode":"MonetDBBulkLoaderMeta.Exception.ConnectionNotDefined","errorMessage":"MonetDBBulkLoaderMeta.Exception.ConnectionNotDefined","messagePattern":"MonetDBBulkLoaderMeta\\.Exception\\.ConnectionNotDefined","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/monet-db-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/monetdbbulkloader/MonetDBBulkLoaderMeta.java","lineNumber":797,"sourceCode":"          // Check if this table exists...\n          if ( db.checkTableExists( schemaTable ) ) {\n            return db.getTableFields( schemaTable );\n          } else {\n            throw new KettleException( BaseMessages.getString(\n                PKG, \"MonetDBBulkLoaderMeta.Exception.TableNotFound\" ) );\n          }\n        } else {\n          throw new KettleException( BaseMessages.getString(\n              PKG, \"MonetDBBulkLoaderMeta.Exception.TableNotSpecified\" ) );\n        }\n      } catch ( Exception e ) {\n        throw new KettleException( BaseMessages.getString(\n            PKG, \"MonetDBBulkLoaderMeta.Exception.ErrorGettingFields\" ), e );\n      } finally {\n        db.close();\n      }\n    } else {\n      throw new KettleException( BaseMessages.getString(\n          PKG, \"MonetDBBulkLoaderMeta.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 the schemaName to set\n   */\n  public void setSchemaName( String schemaName ) {\n    this.schemaName = schemaName;\n  }","sourceCodeStart":779,"sourceCodeEnd":815,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/monet-db-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/monetdbbulkloader/MonetDBBulkLoaderMeta.java#L779-L815","documentation":"MonetDBBulkLoaderMeta.getRequiredFields() throws this KettleException when the step's databaseMeta reference is null, i.e. no database connection has been defined for the MonetDB Bulk Loader step. Without a DatabaseMeta the step cannot connect to MonetDB to look up the target table's field metadata, so it fails fast instead of attempting a connect with a null connection. This is thrown during metadata validation/preview flows (getFields/getRequiredFields), typically when a transformation is run or its step dialog is validated with the connection setting unset.","triggerScenarios":"Calling getRequiredFields(VariableSpace) (directly or via Spoon preview/validation) on a MonetDBBulkLoaderMeta whose databaseMeta field is null — the step was saved or constructed without selecting a database connection.","commonSituations":"Loading a transformation XML/kettle repository where the connection element is missing or failed to resolve; building the step programmatically without calling setDatabaseMeta(); a cloned/copied step metadata that lost its database reference; upgrading or migrating transformations where the connection was deleted from the repository.","solutions":["Open the MonetDB Bulk Loader step dialog and select/create a Database Connection, then re-run or re-validate the transformation.","If constructing the step in code, set the connection before use, e.g. meta.setDatabaseMeta(transMeta.findDatabase(\"MonetDB\")), and verify findDatabase returned non-null.","Check the transformation XML/repository for a missing or dangling <connection> reference and re-link it.","Add a pre-transformation check or validation that the step's connection is defined before preview/execute."],"exampleFix":"// before\nMonetDBBulkLoaderMeta meta = new MonetDBBulkLoaderMeta();\nmeta.getFields(...); // throws ConnectionNotDefined\n// after\nMonetDBBulkLoaderMeta meta = new MonetDBBulkLoaderMeta();\nDatabaseMeta dbMeta = transMeta.findDatabase(\"MonetDBLocal\");\nif (dbMeta == null) {\n  throw new KettleException(\"MonetDB connection not defined\");\n}\nmeta.setDatabaseMeta(dbMeta);\nmeta.getFields(...);","handlingStrategy":"validation","validationCode":"// Java (PDI plugin API)\nMonetDBBulkLoaderMeta meta = ...;\nif (meta.getDatabaseMeta() == null) {\n  throw new KettleException(\"MonetDB Bulk Loader: no database connection defined\");\n}\n// alternatively check via transMeta:\n// if (transMeta.findDatabase(connName) == null) { ... fail early ... }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set the Database Connection field in the step dialog before previewing or saving.","When generating transformations programmatically, assert meta.getDatabaseMeta() != null before getFields/validation.","Validate that connections referenced by transformation XML still exist in the repository/environment.","Add a step-level validation pass before executing shared/reused transformations."],"tags":["kettle","monetdb","missing-connection","step-metadata"],"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"}