pentaho/pentaho-kettle · error · KettleTransException
Trans.Exception.MaximumDateConnectionCouldNotBeFound
Error message
Trans.Exception.MaximumDateConnectionCouldNotBeFound
What it means
If a transformation specifies a max date lookup but the max date connection (DatabaseMeta) itself cannot be found/resolved, Trans throws KettleTransException with Trans.Exception.MaximumDateConnectionCouldNotBeFound naming the connection. The transformation cannot compute its date range without this connection.
Solutions
- Re-add the missing database connection to the transformation or environment metadata
- Fix the connection name referenced by the max date setting so it resolves
- Export transformations with referenced connections included
- Verify transMeta.getMaxDateConnection() returns a valid DatabaseMeta programmatically
Example fix
// before: connection deleted from metadata
transMeta.setMaxDateComparator(null); // connection dangling
// after: ensure connection exists before executing
if (transMeta.findDatabase(maxDateConnName) == null) {
transMeta.addDatabase(new DatabaseMeta("logdb", "POSTGRESQL", "Native", "u", "p", "5432", "host", "db"));
} Defensive patterns
Strategy: validation
Validate before calling
if (transMeta.getMaxDateConnection() != null &&
transMeta.findDatabase(transMeta.getMaxDateConnection().getName()) == null) {
throw new IllegalStateException("Max date connection not found: " + transMeta.getMaxDateConnection().getName());
} Try / catch
try {
trans.execute(args);
} catch (KettleTransException e) {
if (e.getMessage().contains("MaximumDateConnectionCouldNotBeFound")) {
// re-register the missing DatabaseMeta, then retry
} else throw e;
} Prevention
- Export transformations together with their referenced connections
- Avoid deleting shared database connections still referenced by jobs/transes
- Resolve connections via names that exist in the target repository/environment
- Validate all referenced DatabaseMeta before execution
When it happens
Trigger: transMeta.getMaxDateConnection() returns a value (non-null) that is not a valid/available DatabaseMeta - e.g. the code path checks the connection object and it is not usable, so the else branch throws naming the connection.
Common situations: Transformation references a database connection that was deleted from the repository/environment; connection defined in a shared metadata source not loaded; exported transformation missing its connection definition.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- GPBulkLoaderMeta.Exception.ConnectionNotDefined
- GPBulkLoaderMeta.Exception.TableNotSpecified
- InfobrightLoaderMeta.GetSQL.NoConnectionDefined
- LucidDBStreamingLoaderMeta.Exception.ConnectionNotDefined
- No connection specified
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/8aa2f4d88aa99a32.
Report an issue: GitHub.
Appendix: source
Thrown at engine/src/main/java/org/pentaho/di/trans/Trans.java:2348
if ( log.isDetailed() ) {
log.logDetailed( BaseMessages.getString( PKG, "Trans.Log.LastDateFoundOnTheMaxdateConnection" )
+ r1 );
}
endDate.setTime( (long) ( maxvalue.getTime() + ( transMeta.getMaxDateOffset() * 1000 ) ) );
}
} else {
if ( log.isDetailed() ) {
log.logDetailed( BaseMessages.getString( PKG, "Trans.Log.NoLastDateFoundOnTheMaxdateConnection" ) );
}
}
} catch ( KettleException e ) {
throw new KettleTransException( BaseMessages.getString( PKG, "Trans.Exception.ErrorConnectingToDatabase",
"" + transMeta.getMaxDateConnection() ), e );
} finally {
maxdb.close();
}
} else {
throw new KettleTransException( BaseMessages.getString( PKG,
"Trans.Exception.MaximumDateConnectionCouldNotBeFound", "" + transMeta.getMaxDateConnection() ) );
}
}
// Determine the last date of all dependend tables...
// Get the maximum in depdate...
if ( transMeta.nrDependencies() > 0 ) {
if ( log.isDetailed() ) {
log.logDetailed( BaseMessages.getString( PKG, "Trans.Log.CheckingForMaxDependencyDate" ) );
}
//
// Maybe one of the tables where this transformation is dependent on has changed?
// If so we need to change the start-date!
//
depDate = Const.MIN_DATE;
Date maxdepdate = Const.MIN_DATE;
if ( lastr != null && lastr.length > 0 ) {
Date dep = (Date) lastr[ 1 ]; // #1: last depdateView on GitHub (pinned to f3058517a1)