{"record":{"id":"11f3076cd00048e4","repo":"pentaho/pentaho-kettle","slug":"unable-to-save-repository-element-element","errorCode":null,"errorMessage":"Unable to save repository element [\" + element + \"]","messagePattern":"Unable to save repository element \\[\" \\+ element \\+ \"\\]","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java","lineNumber":2203,"sourceCode":"          break;\n        case DATABASE:\n          saveDatabaseMeta( element, versionComment, versionDate );\n          break;\n        case SLAVE_SERVER:\n          saveSlaveServer( element, versionComment, versionDate );\n          break;\n        case CLUSTER_SCHEMA:\n          saveClusterSchema( element, versionComment, versionDate );\n          break;\n        case PARTITION_SCHEMA:\n          savePartitionSchema( element, versionComment, versionDate );\n          break;\n        default:\n          throw new KettleException(\n            \"It's not possible to save Class [\" + element.getClass().getName() + \"] to the repository\" );\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( \"Unable to save repository element [\" + element + \"]\", e );\n    }\n  }\n\n  private boolean isRenamed( final RepositoryElementInterface element, final RepositoryFile file )\n    throws KettleException {\n    if ( element.getObjectId() == null ) {\n      return false; // never been saved\n    }\n    String filename = element.getName();\n    switch ( element.getRepositoryElementType() ) {\n      case TRANSFORMATION:\n        filename += RepositoryObjectType.TRANSFORMATION.getExtension();\n        break;\n      case JOB:\n        filename += RepositoryObjectType.JOB.getExtension();\n        break;\n      case DATABASE:\n        filename += RepositoryObjectType.DATABASE.getExtension();","sourceCodeStart":2185,"sourceCodeEnd":2221,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java#L2185-L2221","documentation":"Generic wrapper thrown by PurRepository.saveRepositoryElement: any Exception raised while saving an element (including the unsupported-class error above or failures inside the individual save methods) is rethrown as a KettleException with the original as cause.","triggerScenarios":"Any failure inside saveRepositoryElement's try block — e.g. saveDatabaseMeta, saveClusterSchema, savePartitionSchema throwing due to repository connectivity, permission issues, or unsupported element type.","commonSituations":"Repository connectivity drops mid-save; insufficient permissions in the Pentaho repository; saving an element whose dependent objects are missing; server-side validation failures.","solutions":["Inspect the cause chain (getCause()) for the real underlying error","Verify repository connectivity and permissions before saving","Fix the root cause indicated by the wrapped exception"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  repository.save(element, comment, calendar, monitor);\n} catch (KettleException e) {\n  Throwable root = e;\n  while (root.getCause() != null) root = root.getCause();\n  log.error(\"Save of \" + element + \" failed: \" + root.getMessage(), e);\n}","preventionTips":["Always inspect getCause() chain for the real error","Verify repository connectivity before bulk saves","Check permissions on target folder before saving"],"tags":["pentaho","kettle","repository","save-failed"],"backgroundTag":"database-write-failed","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"}