{"record":{"id":"7bbf8df5198476fe","repo":"pentaho/pentaho-kettle","slug":"tableoutputmeta-exception-connectionundefined","errorCode":"TableOutputMeta.Exception.ConnectionUndefined","errorMessage":"TableOutputMeta.Exception.ConnectionUndefined","messagePattern":"TableOutputMeta\\.Exception\\.ConnectionUndefined","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/tableoutput/TableOutputMeta.java","lineNumber":1024,"sourceCode":"    } else {\n      return true;\n    }\n  }\n\n  @Override\n  public String getMissingDatabaseConnectionInformationMessage() {\n    // Use default connection missing message\n    return null;\n  }\n\n  public void setConnection( String connectionName ) throws KettleException {\n    // Get the databases from the Database connection list this is required by\n    // MDI injection of the connection name\n    databaseMeta = DatabaseMeta.findDatabase( getParentStepMeta().getParentTransMeta().getDatabases(), connectionName );\n    if ( databaseMeta == null ) {\n      String errMsg = BaseMessages.getString( PKG, \"TableOutputMeta.Exception.ConnectionUndefined\", getParentStepMeta().getName(), connectionName );\n      logError( errMsg );\n      throw new KettleException( errMsg );\n    }\n  }\n\n  @Override\n  public StepHelperInterface getStepHelperInterface() {\n    return new TableOutputHelper();\n  }\n\n}\n","sourceCodeStart":1006,"sourceCodeEnd":1034,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/tableoutput/TableOutputMeta.java#L1006-L1034","documentation":"Thrown when resolving the step's connection by name fails: DatabaseMeta.findDatabase over the transformation's database list returns null for the stored connectionName. The code logs an error message naming the step and the undefined connection name, then throws a KettleException. This happens during metadata injection / named-connection resolution when the referenced connection does not exist in the transformation.","triggerScenarios":"checkLookup/setDefault-style resolution path where connectionName is set (often via MDI injection of the connection name) but getParentStepMeta().getParentTransMeta().getDatabases() contains no DatabaseMeta with that name.","commonSituations":"Metadata injection passes a connection name that was never added to the transformation; connection renamed or deleted; transformation loaded without its shared connection definitions (e.g. connections defined only in a repository/environment not available); typo in the injected connection name.","solutions":["Add a database connection with the exact name referenced (case-sensitive) to the transformation before running/injecting.","Fix the injected connection name in the metadata injection mapping so it matches an existing connection.","If the connection is shared, ensure the transformation can load shared objects (repository/environment settings) or embed the connection in the .ktr.","Rename the connection reference in the step dialog to match the surviving connection definition."],"exampleFix":"// before (injected name has no matching connection)\nString connectionName = \"Prod_DB\"; // not in transMeta.getDatabases()\n// after: add connection named Prod_DB to the transformation or correct the name\nString connectionName = \"PostgresDW\"; // exists in transformation","handlingStrategy":"validation","validationCode":"// verify the named connection exists before injection/run\nif (DatabaseMeta.findDatabase(transMeta.getDatabases(), connectionName) == null) {\n  throw new IllegalArgumentException(\"Connection not defined in transformation: \" + connectionName);\n}","typeGuard":null,"tryCatchPattern":"try { meta.checkLookup(transMeta); }\ncatch (KettleException e) {\n  if (e.getMessage().contains(\"ConnectionUndefined\")) { /* fix connection name */ }\n  else throw e;\n}","preventionTips":["Match injected connection names exactly (case-sensitive) to defined connections","Add all referenced connections to the transformation, not only to a repository","Review metadata injection mappings after renaming connections"],"tags":["kettle","table-output","connection","metadata-injection"],"backgroundTag":"missing-dependency","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"}