{"record":{"id":"a8666d3004af426f","repo":"pentaho/pentaho-kettle","slug":"insertupdatemeta-exception-connectionnotdefined","errorCode":null,"errorMessage":"InsertUpdateMeta.Exception.ConnectionNotDefined","messagePattern":"InsertUpdateMeta\\.Exception\\.ConnectionNotDefined","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/insertupdate/InsertUpdateMeta.java","lineNumber":824,"sourceCode":"\n        if ( !Utils.isEmpty( realTableName ) ) {\n          // Check if this table exists...\n          if ( db.checkTableExists( realSchemaName, realTableName ) ) {\n            return db.getTableFieldsMeta( realSchemaName, realTableName );\n          } else {\n            throw new KettleException( BaseMessages.getString( PKG, \"InsertUpdateMeta.Exception.TableNotFound\" ) );\n          }\n        } else {\n          throw new KettleException( BaseMessages.getString( PKG, \"InsertUpdateMeta.Exception.TableNotSpecified\" ) );\n        }\n      } catch ( Exception e ) {\n        throw new KettleException(\n          BaseMessages.getString( PKG, \"InsertUpdateMeta.Exception.ErrorGettingFields\" ), e );\n      } finally {\n        db.close();\n      }\n    } else {\n      throw new KettleException( BaseMessages.getString( PKG, \"InsertUpdateMeta.Exception.ConnectionNotDefined\" ) );\n    }\n\n  }\n\n  /**\n   * @return the schemaName\n   */\n  public String getSchemaName() {\n    return schemaName;\n  }\n\n  @Override public String getMissingDatabaseConnectionInformationMessage() {\n    return null;\n  }\n\n  /**\n   * @param schemaName the schemaName to set\n   */","sourceCodeStart":806,"sourceCodeEnd":842,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/insertupdate/InsertUpdateMeta.java#L806-L842","documentation":"Thrown by InsertUpdateMeta.getTableFields() when the step's database connection is not defined (null), so no field lookup can be performed. Kettle requires a configured connection before it can inspect table metadata.","triggerScenarios":"getTableFields() called while getDatabaseMeta() returns null — the step has no connection assigned, typically during metadata validation or dialog field lookup on an incompletely configured step.","commonSituations":"A copied step lost its shared connection; the connection was deleted from the transformation; repository import skipped the shared connection; XML hand-editing removed the <connection> element.","solutions":["Open the Insert Update step and select (or create) a database connection.","Recreate the missing shared connection in the transformation's connection tree.","Fix the .ktr XML so the step references an existing <connection> name.","If importing from another repository, ensure shared objects/connections were imported."],"exampleFix":"// before (XML)\n<connection/>\n// after\n<connection>CUSTOMER_DB</connection>","handlingStrategy":"validation","validationCode":"// Guard before metadata operations\nif (meta.getDatabaseMeta() == null) {\n  throw new IllegalStateException(\"Insert Update step has no database connection configured\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Assign a named shared connection to every DB step.","Never delete shared connections without re-linking steps.","When exporting/importing transformations, include shared connections."],"tags":["kettle","configuration","database-connection"],"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"}