pentaho/pentaho-kettle · error · KettleException

DeleteMeta.Exception.ConnectionUndefined

DeleteMeta.Exception.ConnectionUndefined

Error message

DeleteMeta.Exception.ConnectionUndefined

What it means

This is MDI (metadata injection) support code in DeleteMeta: given an injected connection name, it looks up the named database in the transformation's database list via DatabaseMeta.findDatabase. If no match is found, it logs and throws a KettleException naming the step and the missing connection name.

Solutions

  1. Add a database connection with the exact injected name to the transformation before running the injection mapping.
  2. Check the injected connection name for typos, case or trailing-whitespace mismatches.
  3. Import the shared connection definitions when moving transformations between environments.
  4. In your injection mapping code, verify the connection name against availableDatabaseNames before injecting.

Example fix

// before
mapper.addMapping("CONNECION_NAME"); // typo
// after
mapper.addMapping("CONNECTION_NAME"); // matches a defined DB connection in the transformation
Defensive patterns

Strategy: validation

Validate before calling

List<String> available = transMeta.getDatabaseNames();
if (!available.contains(connectionName)) {
  throw new IllegalArgumentException("Connection not defined in transformation: " + connectionName);
}

Try / catch

try { new DeleteMeta(stepMeta, injectMeta, injection); } catch (KettleException e) {
  log.error("Injected connection missing: {}", e.getMessage(), e);
}

Prevention

When it happens

Trigger: During metadata injection, the constructor resolves connectionName against getParentStepMeta().getParentTransMeta().getDatabases(); if the transformation does not define a database connection with that exact name, databaseMeta is null and the exception is thrown.

Common situations: Metadata injection mapping references a connection name that doesn't exist in the target transformation; case/whitespace mismatch in the connection name; transformation moved between environments where shared connections weren't imported.

Understand the failure class

Background: "missing required config value" errors: why libraries refuse to start when a configuration key is empty, unset, or blank — this error's family across 48 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/4333956024a88738. Report an issue: GitHub.

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/delete/DeleteMeta.java:610

   *          the schemaName to set
   */
  public void setSchemaName( String schemaName ) {
    this.schemaName = schemaName;
  }

  public boolean supportsErrorHandling() {
    return true;
  }

  public void setConnection( String connectionName ) throws KettleException {
    // Get the databases from the Database connection list this is required by
    // MDI injection of the connection name
    databaseMeta = DatabaseMeta.findDatabase( getParentStepMeta().getParentTransMeta().getDatabases(), connectionName );
    if ( databaseMeta == null ) {
      String errMsg = BaseMessages.getString( PKG, "DeleteMeta.Exception.ConnectionUndefined",
              getParentStepMeta().getName(), connectionName );
      logError( errMsg );
      throw new KettleException( errMsg );
    }
  }

  public static class KeyFields implements Cloneable {
    /** field in table */
    @Injection( name = "TABLE_NAME_FIELD", group = "FIELDS", required = true )
    private String keyLookup;

    /** Comparator: =, <>, BETWEEN, ... */
    @Injection( name = "COMPARATOR", group = "FIELDS", required = true )
    private String keyCondition;

    @Injection( name = "STREAM_FIELDNAME_1", group = "FIELDS", required = false )
    private String keyStream;

    /** Extra field for between... */
    @Injection( name = "STREAM_FIELDNAME_2", group = "FIELDS", required = false )
    private String keyStream2;

View on GitHub (pinned to f3058517a1)