{"record":{"id":"1160206b5bd219dc","repo":"pentaho/pentaho-kettle","slug":"singlethreaderdialog-exception","errorCode":null,"errorMessage":"SingleThreaderDialog.Exception.UnableToFindRepositoryDirectory)","messagePattern":"SingleThreaderDialog\\.Exception\\.UnableToFindRepositoryDirectory\\)","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/meta-inject/impl/src/main/java/org/pentaho/di/trans/steps/metainject/MetaInjectDialog.java","lineNumber":770,"sourceCode":"          filename = filename.replace( \".ktr\", \"\" );\n          wPath.setText( filename );\n        }\n        String transPath = transMeta.environmentSubstitute( filename );\n        String realTransname = transPath;\n        String realDirectory = \"\";\n        int index = transPath.lastIndexOf( \"/\" );\n        if ( index != -1 ) {\n          realTransname = transPath.substring( index + 1 );\n          realDirectory = transPath.substring( 0, index );\n        }\n\n        if ( Utils.isEmpty( realDirectory ) || Utils.isEmpty( realTransname ) ) {\n          throw new KettleException(\n            BaseMessages.getString( PKG, \"SingleThreaderDialog.Exception.NoValidMappingDetailsFound\" ) );\n        }\n        RepositoryDirectoryInterface repdir = repository.findDirectory( realDirectory );\n        if ( repdir == null ) {\n          throw new KettleException( BaseMessages.getString(\n            PKG, \"SingleThreaderDialog.Exception.UnableToFindRepositoryDirectory)\" ) );\n        }\n        loadRepositoryTrans( realTransname, repdir );\n        break;\n      case REPOSITORY_BY_REFERENCE:\n        if ( referenceObjectId == null ) {\n          return false;\n        }\n        injectTransMeta = repository.loadTransformation( referenceObjectId, null ); // load the last version\n        injectTransMeta.clearChanged();\n        break;\n      default:\n        break;\n    }\n    return true;\n  }\n\n  public void setActive() {","sourceCodeStart":752,"sourceCodeEnd":788,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/meta-inject/impl/src/main/java/org/pentaho/di/trans/steps/metainject/MetaInjectDialog.java#L752-L788","documentation":"Thrown by MetaInjectDialog when resolving a repository transformation by name: repository.findDirectory(realDirectory) returns null because the directory portion of the given path does not exist in the repository. Note the message key itself has a stray trailing ')' — a known cosmetic bug in the message bundle. The dialog cannot load the referenced transformation.","triggerScenarios":"In the Meta Inject dialog (repository by name mode), the transPath's directory substring (everything before the last '/') is passed to repository.findDirectory() and no matching repository directory exists — typo, deleted folder, or different repository.","commonSituations":"Path copied from another repository/environment where the folder doesn't exist; directory renamed after the dialog value was saved; wrong repository connected; case-sensitive directory mismatch.","solutions":["Verify the directory part of the path exists in the currently connected repository (Browse in the repository explorer)","Fix typos or case mismatches in the directory path in the transformation field","Connect to the correct repository that contains the transformation path","Re-select the transformation via the Browse dialog to regenerate a valid path"],"exampleFix":"// before\nString transPath = '/home/oldAdmin/jobTrans'; // dir deleted\n// after\nString transPath = '/home/admin/jobTrans'; // existing repository directory","handlingStrategy":"validation","validationCode":"// Verify the repository directory exists before resolving the transformation\nRepositoryDirectoryInterface dir = repository.findDirectory('/home/admin');\nif (dir == null) throw new IllegalStateException('Repository directory does not exist');","typeGuard":"boolean repoDirExists(Repository repo, String path) {\n  try { return repo != null && repo.findDirectory(path) != null; }\n  catch (Exception e) { return false; }\n}","tryCatchPattern":"try {\n  // load by repository path\n} catch (KettleException e) {\n  if (e.getMessage().contains('UnableToFindRepositoryDirectory')) {\n    log.error('Directory part of path missing in repository: fix path or connect to correct repo', e);\n  } else throw e;\n}","preventionTips":["Browse the repository tree to confirm directory names before typing paths","Remember repository directories are case-sensitive","Re-select the transformation after repo migrations/renames","Verify you are connected to the intended repository/environment"],"tags":["repository","directory-not-found","swing-dialog"],"backgroundTag":"directory-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"}