{"record":{"id":"5bd2380db672a2dc","repo":"pentaho/pentaho-kettle","slug":"getrepositorynames-exception-notconnectedtorepository","errorCode":null,"errorMessage":"GetRepositoryNames.Exception.NotConnectedToRepository","messagePattern":"GetRepositoryNames\\.Exception\\.NotConnectedToRepository","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/get-repository-names/ui/src/main/java/org/pentaho/di/ui/trans/steps/getrepositorynames/GetRepositoryNamesDialog.java","lineNumber":622,"sourceCode":"          etd.setReadOnly();\n          etd.open();\n        }\n\n        PreviewRowsDialog prd =\n          new PreviewRowsDialog(\n            shell, transMeta, SWT.NONE, wStepname.getText(), progressDialog.getPreviewRowsMeta( wStepname\n              .getText() ), progressDialog.getPreviewRows( wStepname.getText() ), loggingText );\n        prd.open();\n      }\n    }\n  }\n\n  private void displaydirectoryList() {\n\n    try {\n\n      if ( repository == null ) {\n        throw new KettleException( BaseMessages.getString(\n          PKG, \"GetRepositoryNames.Exception.NotConnectedToRepository\" ) );\n      }\n\n      SelectDirectoryDialog sdd = new SelectDirectoryDialog( shell, SWT.NONE, repository );\n      RepositoryDirectoryInterface rd = sdd.open();\n      if ( rd != null ) {\n        wDirectory.setText( rd.getPath() );\n      }\n\n    } catch ( Exception e ) {\n      new ErrorDialog( shell, BaseMessages.getString( PKG, \"System.Dialog.Error.Title\" ), BaseMessages.getString(\n        PKG, \"GetRepositoryNames.ErrorGettingFolderds.DialogMessage\" ), e );\n    }\n  }\n}\n","sourceCodeStart":604,"sourceCodeEnd":638,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/get-repository-names/ui/src/main/java/org/pentaho/di/ui/trans/steps/getrepositorynames/GetRepositoryNamesDialog.java#L604-L638","documentation":"GetRepositoryNamesDialog.displaydirectoryList throws a KettleException with the localized message 'GetRepositoryNames.Exception.NotConnectedToRepository' when the Browse (directory list) button is clicked while no repository is connected. The SelectDirectoryDialog requires a live Repository object; null means the dialog cannot browse directories.","triggerScenarios":"Clicking the directory Browse button in the Get Repository Names step dialog when the transformation was opened from a file (e.g. a local .ktr) so the repository reference is null.","commonSituations":"User designs a transformation locally from a .ktr file and tries to browse repository directories; Spoon was started without logging into a repository; repository session expired but the dialog still holds a null/stale repository.","solutions":["Log in to a repository in Spoon (File > Open from repository or the repository login dialog) before browsing directories.","Manually type the repository directory path instead of using the Browse button.","Reconnect the repository session if it expired, then reopen the step dialog."],"exampleFix":"// before: opening the step dialog with no repository session\nTransMeta tm = new TransMeta( \"local-file.ktr\" ); // repository == null\n\n// after: connect first\nRepository rep = KettleRepositoryRegistry.connect( \"myRepo\", user, pass );\n// then open the transformation/dialog from that repository","handlingStrategy":"validation","validationCode":"if ( repository == null || !repository.isConnected() ) {\n  // prompt the user to log in to a repository before opening the dialog\n  MessageBox mb = new MessageBox( shell, SWT.ICON_WARNING );\n  mb.setMessage( \"Connect to a repository first.\" );\n  mb.open();\n  return;\n}","typeGuard":"boolean repositoryAvailable( Repository r ) {\n  return r != null && r.isConnected();\n}","tryCatchPattern":null,"preventionTips":["Log into a repository in Spoon before browsing repository directories","Type directory paths manually when working from local .ktr files","Reconnect expired repository sessions promptly"],"tags":["ui","repository","not-connected"],"backgroundTag":"authentication-required","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"}