pentaho/pentaho-kettle · error · SessionRecoveryRetryException

Failed to retry repository operation after reconnect

Error message

Failed to retry repository operation after reconnect

What it means

RepositorySessionTimeoutHandler.reconnectAndRetry re-invokes the original repository method via reflection after reconnecting. If the retried invocation itself throws (InvocationTargetException), it wraps the cause in SessionRecoveryRetryException('Failed to retry repository operation after reconnect'). The reconnection succeeded but the retried operation failed again.

Solutions

  1. Inspect getCause() of the SessionRecoveryRetryException to find the real retry failure and fix that underlying problem
  2. Verify the target file/folder still exists after reconnection before retrying
  3. Retry the operation manually from the UI after confirming repository state
  4. Avoid modifying repository state between timeout and retry (idempotency)

Example fix

// before
handler.handle( proxy, method, args ); // wraps retry failures opaquely
// after
try {
  handler.handle( proxy, method, args );
} catch ( KettleException e ) {
  Throwable root = e.getCause();
  log.error( "Retry failed due to", root ); // diagnose real cause
}
Defensive patterns

Strategy: retry

Validate before calling

// before relying on retry, check state
if ( !fileObject.exists() ) { refreshOrRelocate(); }

Try / catch

try {
  handler.handle( proxy, method, args );
} catch ( SessionRecoveryRetryException e ) {
  Throwable root = e.getCause();
  log.error( "Retry after reconnect failed:", root );
  // fall back to manual re-execution by the user
}

Prevention

When it happens

Trigger: After a session timeout, the handler reconnects and retries the original method, and that retry throws any exception (e.g. file still missing, permissions changed, server error).

Common situations: File was deleted server-side during the disconnect window; retry hits a different server error; the operation is not idempotent and fails on second attempt.

Related errors


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

Appendix: source

Thrown at plugins/repositories/core/src/main/java/org/pentaho/di/ui/repo/timeout/RepositorySessionTimeoutHandler.java:148

    }
  }

  private Object reconnectAndRetry( Method method, Object[] args )
      throws SessionRecoveryRetryException {
    try {
      ConnectionManager.getInstance().reset();
    } catch ( Exception ce ) {
      // Intentionally ignore cache reset errors - they should not prevent reconnection
    }
    try {
      metaStoreInstance = wrapMetastoreWithTimeoutHandler( MetaStoreConst.getDefaultMetastore(), sessionTimeoutHandler );
    } catch ( Exception me ) {
      // Intentionally ignore metastore refresh errors - they should not prevent reconnection
    }
    try {
      return method.invoke( this.repository, args );
    } catch ( InvocationTargetException retryEx ) {
      throw new SessionRecoveryRetryException( "Failed to retry repository operation after reconnect",
          retryEx.getCause() );
    } catch ( IllegalAccessException | IllegalArgumentException retryEx ) {
      throw new SessionRecoveryRetryException( "Unable to invoke repository operation after reconnect", retryEx );
    }
  }

  static class SessionRecoveryRetryException extends KettleException {
    private static final long serialVersionUID = 1L;

    SessionRecoveryRetryException( String message, Throwable cause ) {
      super( message, cause );
    }
  }

  boolean connectedToRepository() {
    return repository.isConnected();
  }

View on GitHub (pinned to f3058517a1)