pentaho/pentaho-kettle · error · KettleException

Unable to verify if the repository element [

Error message

Unable to verify if the repository element [

What it means

The repository-exists check (verify element by name/type under a directory) failed: any exception computing the result is wrapped as 'Unable to verify if the repository element [name] exists'. The read lock is held while resolving the path; the wrap loses the original cause unless inspected.

Solutions

  1. Inspect e.getCause() to see whether the path lookup or the service call failed.
  2. Validate the object name (no path separators, non-empty) before the exists check.
  3. Ensure the target repository directory reference is valid and current.
  4. Reconnect to the repository if the session has expired.

Example fix

// before
boolean ok = repo.exists(name, dir, type);
// after
String safe = name.replaceAll("[/\\\\]", "_");
boolean ok = repo.exists(safe, dir, type);
Defensive patterns

Strategy: validation

Validate before calling

if (name == null || name.isEmpty() || name.contains("/")) {
  throw new IllegalArgumentException("Invalid repository object name: " + name);
}

Type guard

null

Try / catch

try {
  exists = repo.exists(name, dir, type);
} catch (KettleException e) {
  log.error("Exists check failed for {}: {}", name, e.getCause());
  exists = false;
}

Prevention

When it happens

Trigger: Calling the exists/verify method with a name and RepositoryObjectType whose path resolution or child lookup throws — invalid directory reference, PUR service error, or malformed name for getPath.

Common situations: Names with special characters ('/', spaces) that break path construction; checking existence in a directory that was deleted; session expired against the BA server.

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


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

Appendix: source

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

    rootRef.clearRef();
  }

  @Override
  public boolean exists( final String name, final RepositoryDirectoryInterface repositoryDirectory,
                         final RepositoryObjectType objectType ) throws KettleException {
    try {
      String absPath = getPath( name, repositoryDirectory, objectType );
      readWriteLock.readLock().lock();
      boolean result;
      try {
        result = pur.getFile( absPath ) != null;
      } finally {
        readWriteLock.readLock().unlock();
      }

      return result;
    } catch ( Exception e ) {
      throw new KettleException( "Unable to verify if the repository element [" + name + "] exists in ", e );
    }
  }

  protected String getPath( final String name, final RepositoryDirectoryInterface repositoryDirectory,
                          final RepositoryObjectType objectType ) {

    String path = null;

    // need to check for null id since shared objects return a non-null repoDir (see
    // partSchema.getRepositoryDirectory())
    if ( repositoryDirectory != null && repositoryDirectory.getObjectId() != null ) {
      path = repositoryDirectory.getPath();
    }

    // return the directory path
    if ( objectType == null ) {
      return path;
    }

View on GitHub (pinned to f3058517a1)