{"record":{"id":"1c1d106980907557","repo":"pentaho/pentaho-kettle","slug":"delete-job-repository-is-read-only","errorCode":null,"errorMessage":"DELETE_JOB : repository is read-only","messagePattern":"DELETE_JOB : repository is read-only","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/repository/filerep/KettleFileRepositorySecurityProvider.java","lineNumber":75,"sourceCode":"          if ( capabilities.isReadOnly() ) {\n            throw new KettleException( operation + \" : repository is read-only\" );\n          }\n          break;\n        case EXECUTE_TRANSFORMATION:\n          break;\n        case LOCK_TRANSFORMATION:\n          break;\n\n        case READ_JOB:\n          break;\n        case MODIFY_JOB:\n          if ( capabilities.isReadOnly() ) {\n            throw new KettleException( operation + \" : repository is read-only\" );\n          }\n          break;\n        case DELETE_JOB:\n          if ( capabilities.isReadOnly() ) {\n            throw new KettleException( operation + \" : repository is read-only\" );\n          }\n          break;\n        case EXECUTE_JOB:\n          break;\n        case LOCK_JOB:\n          break;\n\n        case MODIFY_DATABASE:\n          if ( capabilities.isReadOnly() ) {\n            throw new KettleException( operation + \" : repository is read-only\" );\n          }\n          break;\n        case DELETE_DATABASE:\n          if ( capabilities.isReadOnly() ) {\n            throw new KettleException( operation + \" : repository is read-only\" );\n          }\n          break;\n        case EXPLORE_DATABASE:","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/repository/filerep/KettleFileRepositorySecurityProvider.java#L57-L93","documentation":"KettleFileRepositorySecurityProvider.validateAction throws this KettleException when a DELETE_JOB operation is attempted against a file-based repository that was opened in read-only mode. The security provider is consulted before every repository mutation, so any delete of a job is rejected up front based on repository capabilities. It is a deliberate guard, not a corruption or I/O failure.","triggerScenarios":"Calling KettleFileRepository.deleteJob / deleteRepositoryObject when the repository was connected with a KettleFileRepositoryCapabilities whose isReadOnly() is true, or via KettleFileRepositoryMeta configured read-only.","commonSituations":"Opening a repository directory on a read-only filesystem or shared/network mount, users with view-only repository connections (e.g. read-only shared folders), or code connecting with the read-only flag set accidentally.","solutions":["Reconnect to the repository with a read-write configuration (read-only=false in KettleFileRepositoryMeta / connect call).","Ensure the repository directory is on a writable filesystem and the OS user has write permissions.","Perform the delete with an admin/read-write connection in a maintenance session.","If deletion is genuinely not allowed, change the code path to not attempt DELETE_JOB and surface the capability to the user."],"exampleFix":"// before\nrepository.connect(\"user\", \"pass\"); // meta flags read-only\nrepository.deleteJob(jobId);\n// after\nrepositoryMeta.setReadOnly(false);\nrepository.connect(\"user\", \"pass\");\nrepository.deleteJob(jobId);","handlingStrategy":"try-catch","validationCode":"if (repository.getSecurityProvider() instanceof KettleFileRepositorySecurityProvider\n    && repository.getSecurityProvider().isReadOnly()) {\n  throw new IllegalStateException(\"Repository is read-only; cannot delete job\");\n}","typeGuard":"boolean canModify(org.pentaho.di.repository.Repository repo) {\n  try { return !repo.getSecurityProvider().isReadOnly(); }\n  catch (Exception e) { return false; }\n}","tryCatchPattern":"try {\n  repository.deleteJob(jobId);\n} catch (KettleException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"repository is read-only\")) {\n    // reopen repository read-write or notify user\n  } else { throw e; }\n}","preventionTips":["Check securityProvider.isReadOnly() before any repository mutation.","Ensure the repository directory is on a writable filesystem/mount.","Keep a read-write connection for maintenance tasks; use read-only connections only for browsing.","Surface read-only capability in UI before offering delete actions."],"tags":["repository","read-only","pentaho-kettle"],"backgroundTag":"permission-denied","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"}