{"record":{"id":"b25d7ca2fb9c3cf6","repo":"pentaho/pentaho-kettle","slug":"connection-not-found-name","errorCode":null,"errorMessage":"Connection not found: \" + name","messagePattern":"Connection not found: \" \\+ name","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/connections/ui/src/main/java/org/pentaho/di/vfs/connections/ui/dialog/ConnectionDelegate.java","lineNumber":151,"sourceCode":"    moveCopy( name, spoonSupplier.get().getGlobalManagementBowl(), spoonSupplier.get().getManagementBowl(), true );\n  }\n\n  private void moveCopy( String name, Bowl sourceBowl, Bowl targetBowl, boolean deleteSource ) {\n    try {\n      ConnectionDetails targetConnection = targetBowl.getManager( ConnectionManager.class ).getConnectionDetails( name );\n      if ( targetConnection != null ) {\n        ConnectionOverwriteDialog connectionOverwriteDialog =\n          new ConnectionOverwriteDialog( spoonSupplier.get().getShell() );\n        if ( !( connectionOverwriteDialog.open( name ) == SWT.YES ) ) {\n          return;\n        } else {\n          targetBowl.getManager( ConnectionManager.class ).delete( targetConnection.getName() );\n        }\n      }\n\n      ConnectionDetails details = sourceBowl.getManager( ConnectionManager.class ).getConnectionDetails( name );\n      if ( details == null ) {\n        throw new KettleException( \"Connection not found: \" + name );\n      }\n      targetBowl.getManager( ConnectionManager.class ).save( details );\n      if ( deleteSource ) {\n        sourceBowl.getManager( ConnectionManager.class ).delete( name );\n      }\n      spoonSupplier.get().getShell().getDisplay().asyncExec( () -> spoonSupplier.get().refreshTree(\n        ConnectionFolderProvider.STRING_VFS_CONNECTIONS ) );\n    } catch ( KettleException e ) {\n      showError( e );\n    }\n  }\n\n  private Bowl getBowl( Spoon spoon, LeveledTreeNode.LEVEL level ) {\n    if ( level == LeveledTreeNode.LEVEL.PROJECT ) {\n      return spoon.getManagementBowl();\n    } else {\n      return spoon.getGlobalManagementBowl();\n    }","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/connections/ui/src/main/java/org/pentaho/di/vfs/connections/ui/dialog/ConnectionDelegate.java#L133-L169","documentation":"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.","triggerScenarios":"Calling copyToGlobal/copyToProject/moveToGlobal/moveToProject with a connection name that is not registered in the source bowl's ConnectionManager (getConnectionDetails returns null).","commonSituations":"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.","solutions":["Confirm the connection name exists in the source bowl/project before copying (refresh the connection tree)","Pass the exact registered name (case/whitespace)","Recreate the missing connection, then retry the move/copy","Catch KettleException and surface a friendly 'connection no longer exists' message"],"exampleFix":"// before\ndelegate.copyToProject( \"MyConnetion\" ); // typo -> not found\n// after\nString name = \"MyConnection\";\nif ( spoon.getConnectionManager().getConnectionDetails( name ) != null ) {\n  delegate.copyToProject( name );\n}","handlingStrategy":"validation","validationCode":"ConnectionManager cm = sourceBowl.getManager( ConnectionManager.class );\nif ( cm.getConnectionDetails( name ) == null ) {\n  throw new ValidationException( \"Connection not present in source bowl: \" + name );\n}","typeGuard":null,"tryCatchPattern":"try {\n  delegate.copyToProject( name );\n} catch ( KettleException e ) {\n  if ( e.getMessage().startsWith( \"Connection not found\" ) ) {\n    // refresh tree / recreate connection / notify user\n  }\n}","preventionTips":["Refresh the connection tree after project switches","Copy connections by exact registered name","Verify connection existence before copy/move operations","Avoid concurrent deletion of connections while moving"],"tags":["connection-manager","vfs","lookup-failed"],"backgroundTag":"resource-not-found","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"}