pentaho/pentaho-kettle · error · KettleException

PurRepository.invalidRepositoryDirectory

PurRepository.invalidRepositoryDirectory

Error message

PurRepository.invalidRepositoryDirectory

What it means

PurRepository.createRepositoryDirectory validates that a directory created directly under the repository root is either the special /home or /public subtree; anything else at root level is rejected with a localized KettleException keyed by PurRepository.invalidRepositoryDirectory.

Solutions

  1. Create new folders under /home/<user> or /public instead of the repository root.
  2. Change directoryPath to start with Import.HOME_DIRECTORY ("/home") or Import.PUBLIC_DIRECTORY ("/public").
  3. If a root-level folder is genuinely needed, create it via the Pentaho User Console / JCR admin tooling, not this API.

Example fix

// before
repo.createRepositoryDirectory(rootDir, new RepositoryDirectory(rootDir, "myfolder"));
// after
RepositoryDirectory pub = repo.findDirectory(Import.PUBLIC_DIRECTORY);
repo.createRepositoryDirectory(pub, new RepositoryDirectory(pub, "myfolder"));
Defensive patterns

Strategy: validation

Validate before calling

boolean ok = path.startsWith("/home/") || path.startsWith("/public/"); if (parent.isRoot() && !ok) throw new IllegalArgumentException("root-level folders must be under /home or /public: " + path);

Prevention

When it happens

Trigger: Calling repository.createRepositoryDirectory(rootDir, dir) where dir's path does not start with /home or /public and the parent is the root — e.g. creating "/myfolder" at the repository root.

Common situations: Scripts or integrations that mimic the file-repository convention and create arbitrary top-level folders; migrating directory trees that have root-level folders not valid in the PUR (enterprise) repository layout.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


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

Appendix: source

Thrown at plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java:409

  @Override public int countNrStepAttributes( ObjectId idStep, String code ) throws KettleException {
    // implemented by RepositoryProxy
    throw new UnsupportedOperationException();
  }

  @Override
  public RepositoryDirectoryInterface createRepositoryDirectory( final RepositoryDirectoryInterface parentDirectory,
                                                                 final String directoryPath ) throws KettleException {
    // allow new folders only inside Home and Public directory, else - provide UI message
    try {
      // if parentDirectory is root then we have to check if the defined directory is valid ( only Public and Home folders are allowed )
      if ( parentDirectory.isRoot()
        &&
          ( directoryPath.equals( Import.ROOT_DIRECTORY )
            ||
          ( !directoryPath.startsWith( Import.HOME_DIRECTORY ) && !directoryPath.startsWith( Import.PUBLIC_DIRECTORY ) )
          ) ) {
        throw new KettleException( BaseMessages.getString( PKG, "PurRepository.invalidRepositoryDirectory", directoryPath ) );
      }

      RepositoryDirectoryInterface refreshedParentDir = findDirectory( parentDirectory.getPath() );

      // update the passed in repository directory with the children recently loaded from the repo
      parentDirectory.setChildren( refreshedParentDir.getChildren() );
      String[] path = Const.splitPath( directoryPath, RepositoryDirectory.DIRECTORY_SEPARATOR );

      RepositoryDirectoryInterface follow = parentDirectory;

      for ( int level = 0; level < path.length; level++ ) {
        RepositoryDirectoryInterface child = follow.findChild( path[level] );
        if ( child == null ) {
          // create this one
          child = new RepositoryDirectory( follow, path[level] );
          saveRepositoryDirectory( child );
          // link this with the parent directory
          follow.addSubdirectory( child );

View on GitHub (pinned to f3058517a1)