pentaho/pentaho-kettle · error · KettleException

Connection not found: " + name

Error message

Connection not found: " + name

What it means

ConnectionDelegate.moveCopy looks up ConnectionDetails by name in the source bowl's ConnectionManager and throws KettleException('Connection not found: ' + name) when the lookup returns null. The copy/move operation cannot proceed without the source connection definition.

Solutions

  1. Confirm the connection name exists in the source bowl/project before copying (refresh the connection tree)
  2. Pass the exact registered name (case/whitespace)
  3. Recreate the missing connection, then retry the move/copy
  4. Catch KettleException and surface a friendly 'connection no longer exists' message

Example fix

// before
delegate.copyToProject( "MyConnetion" ); // typo -> not found
// after
String name = "MyConnection";
if ( spoon.getConnectionManager().getConnectionDetails( name ) != null ) {
  delegate.copyToProject( name );
}
Defensive patterns

Strategy: validation

Validate before calling

ConnectionManager cm = sourceBowl.getManager( ConnectionManager.class );
if ( cm.getConnectionDetails( name ) == null ) {
  throw new ValidationException( "Connection not present in source bowl: " + name );
}

Try / catch

try {
  delegate.copyToProject( name );
} catch ( KettleException e ) {
  if ( e.getMessage().startsWith( "Connection not found" ) ) {
    // refresh tree / recreate connection / notify user
  }
}

Prevention

When it happens

Trigger: Calling copyToGlobal/copyToProject/moveToGlobal/moveToProject with a connection name that is not registered in the source bowl's ConnectionManager (getConnectionDetails returns null).

Common situations: Connection was deleted by another user/process before the copy; name passed with different casing or whitespace; connection exists only in the target bowl, not the source; stale UI tree after a project switch.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at plugins/connections/ui/src/main/java/org/pentaho/di/vfs/connections/ui/dialog/ConnectionDelegate.java:151

    moveCopy( name, spoonSupplier.get().getGlobalManagementBowl(), spoonSupplier.get().getManagementBowl(), true );
  }

  private void moveCopy( String name, Bowl sourceBowl, Bowl targetBowl, boolean deleteSource ) {
    try {
      ConnectionDetails targetConnection = targetBowl.getManager( ConnectionManager.class ).getConnectionDetails( name );
      if ( targetConnection != null ) {
        ConnectionOverwriteDialog connectionOverwriteDialog =
          new ConnectionOverwriteDialog( spoonSupplier.get().getShell() );
        if ( !( connectionOverwriteDialog.open( name ) == SWT.YES ) ) {
          return;
        } else {
          targetBowl.getManager( ConnectionManager.class ).delete( targetConnection.getName() );
        }
      }

      ConnectionDetails details = sourceBowl.getManager( ConnectionManager.class ).getConnectionDetails( name );
      if ( details == null ) {
        throw new KettleException( "Connection not found: " + name );
      }
      targetBowl.getManager( ConnectionManager.class ).save( details );
      if ( deleteSource ) {
        sourceBowl.getManager( ConnectionManager.class ).delete( name );
      }
      spoonSupplier.get().getShell().getDisplay().asyncExec( () -> spoonSupplier.get().refreshTree(
        ConnectionFolderProvider.STRING_VFS_CONNECTIONS ) );
    } catch ( KettleException e ) {
      showError( e );
    }
  }

  private Bowl getBowl( Spoon spoon, LeveledTreeNode.LEVEL level ) {
    if ( level == LeveledTreeNode.LEVEL.PROJECT ) {
      return spoon.getManagementBowl();
    } else {
      return spoon.getGlobalManagementBowl();
    }

View on GitHub (pinned to f3058517a1)