{"record":{"id":"ec894d85aa0595dd","repo":"pentaho/pentaho-kettle","slug":"modify-database-repository-is-read-only","errorCode":null,"errorMessage":"MODIFY_DATABASE : repository is read-only","messagePattern":"MODIFY_DATABASE : 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":85,"sourceCode":"          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:\n          break;\n\n        case MODIFY_SLAVE_SERVER:\n        case MODIFY_CLUSTER_SCHEMA:\n        case MODIFY_PARTITION_SCHEMA:\n          if ( capabilities.isReadOnly() ) {\n            throw new KettleException( operation + \" : repository is read-only\" );\n          }\n          break;\n        case DELETE_SLAVE_SERVER:","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/repository/filerep/KettleFileRepositorySecurityProvider.java#L67-L103","documentation":"validateAction throws this when a MODIFY_DATABASE operation is requested but the file repository capabilities report read-only. All shared-object modifications (database connections) pass through this guard before touching disk. It protects the repository from unintended changes.","triggerScenarios":"Saving, updating or renaming a DatabaseMeta through KettleFileRepository.save / saveDatabaseElement while the repository is in read-only mode.","commonSituations":"Browsing a shared repository mounted read-only, connecting with read-only repository meta in Spoon, or automated scripts writing connection definitions to a locked repository.","solutions":["Reconfigure the connection as read-write (read-only=false).","Move the database connection definition to a repository instance opened with write capabilities.","Grant write permissions to the repository folder for the running user.","Export the DatabaseMeta to XML instead of persisting to the read-only repository."],"exampleFix":"// before\nrepoMeta.setReadOnly(true);\nrepo.save(databaseMeta, versionComment, null, true);\n// after\nrepoMeta.setReadOnly(false);\nrepo.save(databaseMeta, versionComment, null, true);","handlingStrategy":"try-catch","validationCode":"if (repository.getSecurityProvider().isReadOnly()) {\n  throw new IllegalStateException(\"Repository read-only; cannot modify database meta\");\n}","typeGuard":"boolean writable = repo != null && repo.getSecurityProvider() != null\n    && !repo.getSecurityProvider().isReadOnly();","tryCatchPattern":"try {\n  repo.save(databaseMeta, comment, null, true);\n} catch (KettleException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"MODIFY_DATABASE\")) {\n    // reopen read-write or export to XML fallback\n  } else { throw e; }\n}","preventionTips":["Verify isReadOnly() before saving shared objects.","Avoid mounting the repository directory read-only when writes are expected.","Use read-write credentials for pipelines that persist shared metadata.","Fall back to XML export when the repository cannot be made writable."],"tags":["repository","read-only","database-meta"],"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"}