{"record":{"id":"2aea0dab8bb6e551","repo":"pentaho/pentaho-kettle","slug":"gploadmeta-exception-connectionnotdefined","errorCode":"GPLoadMeta.Exception.ConnectionNotDefined","errorMessage":"GPLoadMeta.Exception.ConnectionNotDefined","messagePattern":"GPLoadMeta\\.Exception\\.ConnectionNotDefined","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/gpload/core/src/main/java/org/pentaho/di/trans/steps/gpload/GPLoadMeta.java","lineNumber":794,"sourceCode":"        if ( !Utils.isEmpty( realTableName ) ) {\n          String schemaTable = databaseMeta.getQuotedSchemaTableCombination( realSchemaName, realTableName );\n\n          // Check if this table exists...\n          if ( db.checkTableExists( schemaTable ) ) {\n            return db.getTableFields( schemaTable );\n          } else {\n            throw new KettleException( BaseMessages.getString( PKG, \"GPLoadMeta.Exception.TableNotFound\" ) );\n          }\n        } else {\n          throw new KettleException( BaseMessages.getString( PKG, \"GPLoadMeta.Exception.TableNotSpecified\" ) );\n        }\n      } catch ( Exception e ) {\n        throw new KettleException( BaseMessages.getString( PKG, \"GPLoadMeta.Exception.ErrorGettingFields\" ), e );\n      } finally {\n        db.close();\n      }\n    } else {\n      throw new KettleException( BaseMessages.getString( PKG, \"GPLoadMeta.Exception.ConnectionNotDefined\" ) );\n    }\n  }\n\n  /**\n   * @return the schemaName\n   */\n  public String getSchemaName() {\n    return schemaName;\n  }\n\n  /**\n   * @param schemaName\n   *          the schemaName to set\n   */\n  public void setSchemaName( String schemaName ) {\n    this.schemaName = schemaName;\n  }\n","sourceCodeStart":776,"sourceCodeEnd":812,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/gpload/core/src/main/java/org/pentaho/di/trans/steps/gpload/GPLoadMeta.java#L776-L812","documentation":"GPLoadMeta's table-fields lookup begins by checking that databaseMeta is configured; if the step has no database connection defined, it immediately throws a KettleException with the ConnectionNotDefined message key. No database work is attempted without a connection object.","triggerScenarios":"Calling getTableFields() (or SQL generation that depends on it) when the GPLoad step's connection field is empty — e.g. connection was deleted from the transformation's shared connections or never selected.","commonSituations":"Deleting a shared DB connection other steps still reference; importing metadata without the connection definition; connection name stored as a variable that is not set; legacy ktr files missing the <connection> element.","solutions":["Select or create a database connection in the GPLoad step's General tab","Restore the missing shared connection definition in the transformation metadata","If the connection name is a variable, ensure it resolves in the executing environment"],"exampleFix":"// before (ktr)\n<connection/> <!-- missing -->\n// after\n<connection><name>GP_PROD</name>...</connection>","handlingStrategy":"validation","validationCode":"// Before using the step metadata\nif (meta.getDatabaseMeta() == null) {\n  throw new IllegalStateException(\"GPLoad step has no database connection defined\");\n}","typeGuard":null,"tryCatchPattern":"try { meta.getTableFields(); } catch (KettleException e) { if (e.getMessage().contains(\"ConnectionNotDefined\")) { configureConnection(); } else { throw e; } }","preventionTips":["Never delete shared connections without checking referencing steps","Export/import jobs together with their connection definitions","Use explicit named connections rather than name variables where possible"],"tags":["pdi","gpload","database","missing-config"],"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"}