pentaho/pentaho-kettle · critical · KettleException

Error connecting to the repository!

Error message

Error connecting to the repository!

What it means

Wrapper KettleException thrown by connect when any KettleException occurs while establishing the repository database connection, initializing variables, connecting the underlying Database, or verifying the repository version. The cause holds the real error (bad credentials, unreachable DB, wrong driver, unsupported version).

Solutions

  1. Inspect getCause() for the underlying database/driver error
  2. Test the JDBC connection parameters (host, port, database name, user, password) independently
  3. Ensure the correct JDBC driver jar is on the classpath
  4. Verify the database is reachable (ping/telnet host:port) and repository tables exist

Example fix

// before
repository.connect(user, pass); // opaque failure

// after
try {
  repository.connect(user, pass);
} catch (KettleException e) {
  log.error("Repo connect failed", e.getCause()); // real JDBC error
  throw e;
}
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-check reachability before repository.connect
try (Socket s = new Socket(dbHost, dbPort)) { /* reachable */ }

Try / catch

try { repository.connect(u, p); } catch (KettleException e) { log.error("Connect failed: ", e.getCause()); throw e; } // inspect cause for JDBC error

Prevention

When it happens

Trigger: database.connect() failing (wrong host/port/credentials), verifyVersion() throwing, or variable initialization failing during repository.connect(...).

Common situations: Database server down, wrong JDBC URL or driver not on classpath, invalid repository credentials, firewall blocking the DB port.

Understand the failure class

Background: ECONNREFUSED and "connection refused" / "could not connect to server" errors: what they mean and how to fix them — this error's family across 44 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/2d37e37b8c62191d. Report an issue: GitHub.

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryConnectionDelegate.java:159

    try {
      database.initializeVariablesFrom( null );
      database.connect();
      if ( !ignoreVersion ) {
        verifyVersion();
      }
      setAutoCommit( false );
      repository.setConnected( true );
      /*
       * Done lazily now.
       *
       * if (!no_lookup) { try { repository.connectionDelegate.setLookupStepAttribute();
       * repository.connectionDelegate.setLookupTransAttribute();
       * repository.connectionDelegate.setLookupJobEntryAttribute();
       * repository.connectionDelegate.setLookupJobAttribute(); } catch (KettleException dbe) { throw new
       * KettleException("Error setting lookup prep.statements", dbe); } }
       */
    } catch ( KettleException e ) {
      throw new KettleException( "Error connecting to the repository!", e );
    }
  }

  /**
   * Get the required repository version for this version of Kettle.
   *
   * @return the required repository version for this version of Kettle.
   */
  public static final String getRequiredVersion() {
    return REQUIRED_MAJOR_VERSION + "." + REQUIRED_MINOR_VERSION;
  }

  protected void verifyVersion() throws KettleException {
    RowMetaAndData lastUpgrade = null;
    String versionTable =
      databaseMeta.getQuotedSchemaTableCombination( null, KettleDatabaseRepository.TABLE_R_VERSION );
    try {
      lastUpgrade = callRead( () ->

View on GitHub (pinned to f3058517a1)