{"record":{"id":"1e437b2b57b6e68c","repo":"pentaho/pentaho-kettle","slug":"trans-exception-connectioncouldnotbefound","errorCode":null,"errorMessage":"Trans.Exception.ConnectionCouldNotBeFound","messagePattern":"Trans\\.Exception\\.ConnectionCouldNotBeFound","errorType":"exception","errorClass":"KettleTransException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/Trans.java","lineNumber":2412,"sourceCode":"                    }\n                  } else {\n                    throw new KettleTransException( BaseMessages.getString( PKG,\n                      \"Trans.Exception.UnableToGetDependencyInfoFromDB\", td.getDatabase().getName() + \".\", td\n                        .getTablename() + \".\", td.getFieldname() ) );\n                  }\n                } else {\n                  throw new KettleTransException( BaseMessages.getString( PKG,\n                    \"Trans.Exception.UnableToGetDependencyInfoFromDB\", td.getDatabase().getName() + \".\", td\n                      .getTablename() + \".\", td.getFieldname() ) );\n                }\n              } catch ( KettleException e ) {\n                throw new KettleTransException( BaseMessages.getString( PKG, \"Trans.Exception.ErrorInDatabase\", \"\" + td\n                  .getDatabase() ), e );\n              } finally {\n                depdb.close();\n              }\n            } else {\n              throw new KettleTransException( BaseMessages.getString( PKG, \"Trans.Exception.ConnectionCouldNotBeFound\",\n                \"\" + td.getDatabase() ) );\n            }\n            if ( log.isDetailed() ) {\n              log.logDetailed( BaseMessages.getString( PKG, \"Trans.Log.Maxdepdate\" ) + ( XMLHandler.date2string(\n                maxdepdate ) ) );\n            }\n          }\n\n          // OK, so we now have the maximum depdate;\n          // If it is larger, it means we have to read everything back in again.\n          // Maybe something has changed that we need!\n          //\n          if ( maxdepdate.getTime() > depDate.getTime() ) {\n            depDate = maxdepdate;\n            startDate = Const.MIN_DATE;\n          }\n        } else {\n          depDate = currentDate;","sourceCodeStart":2394,"sourceCodeEnd":2430,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/Trans.java#L2394-L2430","documentation":"Thrown by Trans.beginProcessing() when a dependent (previous-execution) log table database connection is configured but cannot be found among the transformation's available database connections. Kettle needs that connection to compute the max dependency date used to limit which log records are kept. Without it, the dependency-date calculation cannot proceed, so the transformation aborts startup.","triggerScenarios":"beginProcessing() iterates the transLogTable's dependent log tables; if td.getDatabase() does not resolve to a defined DatabaseMeta (the else-branch where the connection lookup returns null), KettleTransException(ConnectionCouldNotBeFound, dbName) is thrown.","commonSituations":"Transformation log table configured with a 'dependent' log table referencing a database connection that was renamed or deleted in the kettle environment; importing a transformation XML/kjb that references a connection missing from the target repository; copying metadata between environments where shared connections are not exported.","solutions":["Open the transformation's Logging settings, locate the log table with dependent entries, and recreate/fix the referenced database connection so its name matches an existing connection.","Remove the dependent log table entry if the dependency-date pruning feature is not needed.","Re-export or re-import the job/transformation with shared connections included so the connection metadata travels with it.","Verify the connection name spelling/case in the transformation XML against the repository's connection list."],"exampleFix":"// before (transformation XML references a connection that no longer exists)\n<dependent><connection>OLD_ETL_DB</connection>...</dependent>\n// after: fix the connection name in Log settings to an existing one\n<dependent><connection>ETL_DB</connection>...</dependent>","handlingStrategy":"validation","validationCode":"// Before running, verify every connection referenced by the transformation exists\nfor (String connName : transMeta.getUsedDatabaseConnectionsNames()) {\n  if (transMeta.findDatabase(connName) == null)\n    throw new IllegalStateException(\"Missing database connection: \" + connName);\n}","typeGuard":null,"tryCatchPattern":"try {\n  trans.execute(null);\n} catch (KettleTransException e) {\n  log.error(\"Log connection missing: \" + e.getMessage(), e);\n  // fix metadata then retry\n}","preventionTips":["Keep shared database connections in a central repository or metastore exported with every ktr/kjb.","Run a metadata consistency check after every environment migration.","Avoid renaming connections in one environment without updating dependent transformations."],"tags":["database","transformation","logging","configuration"],"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"}