pentaho/pentaho-kettle · error · KettleException

DELETE_DATABASE : repository is read-only

Error message

DELETE_DATABASE : repository is read-only

What it means

validateAction rejects DELETE_DATABASE when the repository is read-only. Deleting a stored database connection is a mutation, so the security provider checks capabilities.isReadOnly() and throws before any file operation.

Solutions

  1. Open the repository read-write before deleting.
  2. Fix filesystem permissions on the repository directory.
  3. Delete the connection via a different (writable) repository instance.
  4. Manually remove the element file from the repository directory if a writable mount is temporarily unavailable.

Example fix

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

Strategy: try-catch

Validate before calling

if (repo.getSecurityProvider().isReadOnly()) {
  throw new IllegalStateException("Repository read-only; cannot delete database connection");
}

Type guard

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

Try / catch

try {
  repo.deleteDatabase(dbMeta.getObjectId());
} catch (KettleException e) {
  if (e.getMessage() != null && e.getMessage().contains("repository is read-only")) {
    // request write access or delete via writable connection
  } else { throw e; }
}

Prevention

When it happens

Trigger: KettleFileRepository.deleteDatabase(...) (or deleteRepositoryObject for a database element) invoked on a read-only file repository.

Common situations: Cleaning up obsolete connections in a repository mounted read-only from a network share, or scripts using a viewer-only repository connection.

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/4d434d829268365b. Report an issue: GitHub.

Appendix: source

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

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

        case MODIFY_DATABASE:
          if ( capabilities.isReadOnly() ) {
            throw new KettleException( operation + " : repository is read-only" );
          }
          break;
        case DELETE_DATABASE:
          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" );
          }

View on GitHub (pinned to f3058517a1)