pentaho/pentaho-kettle · error · KettleException

: repository is read-only

Error message

{operation} : repository is read-only

What it means

This throw covers the DELETE_SLAVE_SERVER, DELETE_CLUSTER_SCHEMA and DELETE_PARTITION_SCHEMA operations in validateAction: deleting these shared cluster objects is refused when the file repository is read-only. The operation name is interpolated into the message.

Solutions

  1. Open the repository in read-write mode before deleting these objects.
  2. Repair filesystem/mount permissions on the repository directory.
  3. Perform cleanup during a maintenance window using a writable connection.
  4. Remove the definition files directly on the repository host if API deletion is not possible.

Example fix

// before
readOnlyRepo.deleteSlaveServer(slave.getObjectId());
// after
repoMeta.setReadOnly(false);
repo.connect();
repo.deleteSlaveServer(slave.getObjectId());
Defensive patterns

Strategy: try-catch

Validate before calling

if (repo.getSecurityProvider().isReadOnly()) {
  throw new IllegalStateException("Repository read-only; cannot delete slave/cluster/partition");
}

Type guard

boolean deletable = repo != null && !repo.getSecurityProvider().isReadOnly();

Try / catch

try {
  repo.deleteClusterSchema(id);
} catch (KettleException e) {
  if (e.getMessage() != null && e.getMessage().contains("repository is read-only")) {
    // reopen read-write or log and skip deletion
  } else { throw e; }
}

Prevention

When it happens

Trigger: KettleFileRepository.deleteSlaveServer / deleteClusterSchema / deletePartitionSchema (or the matching RepositorySecurityProvider DELETE_* operation) on a repository whose capabilities say read-only.

Common situations: Pruning unused cluster/slave definitions from a repository on a read-only network share; automated cleanup scripts against a locked-down repository.

Understand the failure class

Background: Permission denied / not authorized / 403 Forbidden: access-control rejections when the caller lacks the required role, grant, or ownership — this error's family across 18 libraries.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/repository/filerep/KettleFileRepositorySecurityProvider.java:107

          if ( capabilities.isReadOnly() ) {
            throw new KettleException( operation + " : repository is read-only" );
          }
          break;
        case EXPLORE_DATABASE:
          break;

        case MODIFY_SLAVE_SERVER:
        case MODIFY_CLUSTER_SCHEMA:
        case MODIFY_PARTITION_SCHEMA:
          if ( capabilities.isReadOnly() ) {
            throw new KettleException( operation + " : repository is read-only" );
          }
          break;
        case DELETE_SLAVE_SERVER:
        case DELETE_CLUSTER_SCHEMA:
        case DELETE_PARTITION_SCHEMA:
          if ( capabilities.isReadOnly() ) {
            throw new KettleException( operation + " : repository is read-only" );
          }
          break;

        default:
          throw new KettleException( "Operation [" + operation + "] is unknown to the security handler." );

      }
    }
  }

  public boolean isReadOnly() {
    return capabilities.isReadOnly();
  }

  public boolean isLockingPossible() {
    return capabilities.supportsLocking();
  }

View on GitHub (pinned to f3058517a1)