{"record":{"id":"9e4dc61ce6758646","repo":"pentaho/pentaho-kettle","slug":"purrepository-error-0006-unable-to-rename-trans","errorCode":"PurRepository.ERROR_0006_UNABLE_TO_RENAME_TRANS","errorMessage":"Unable to rename Transformation from \"{0}\" to \"{1}\". Transformation with name \"{1}\" already exists.","messagePattern":"Unable to rename Transformation from \"(.+?)\" to \"(.+?)\"\\. Transformation with name \"(.+?)\" already exists\\.","errorType":"error_code","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java","lineNumber":2129,"sourceCode":"      // get file from destination path, should be null for rename goal\n      fileFromDestination = pur.getFile( absPath );\n\n      if ( fileFromDestination == null ) {\n        file = builder.build();\n        NodeRepositoryFileData data;\n        data = pur.getDataAtVersionForRead( file.getId(), null, NodeRepositoryFileData.class );\n\n        if ( newTitle != null ) {\n          // update file's content only if the title should be changed\n          // as this action creates another revision\n          pur.updateFile( file, data, versionComment );\n        }\n        pur.moveFile( idObject.getId(), absPath, null );\n\n        rootRef.clearRef();\n        return idObject;\n      } else {\n        throw new KettleException( BaseMessages.getString( PKG, errorMsgKey, file.getName(), newTitle ) );\n      }\n    } finally {\n      readWriteLock.writeLock().unlock();\n    }\n  }\n\n  protected String getParentPath( final String path ) {\n    if ( path == null ) {\n      throw new IllegalArgumentException();\n    } else if ( RepositoryFile.SEPARATOR.equals( path ) ) {\n      return null;\n    }\n    int lastSlashIndex = path.lastIndexOf( RepositoryFile.SEPARATOR );\n    if ( lastSlashIndex == 0 ) {\n      return RepositoryFile.SEPARATOR;\n    } else if ( lastSlashIndex > 0 ) {\n      return path.substring( 0, lastSlashIndex );\n    } else {","sourceCodeStart":2111,"sourceCodeEnd":2147,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java#L2111-L2147","documentation":"Thrown by PurRepository.renameTransformation when the target name for a Transformation already exists in the repository. Same mechanism as the Job rename: existence check fails and ERROR_0006_UNABLE_TO_RENAME_TRANS is raised as a KettleException.","triggerScenarios":"Calling PurRepository.renameTransformation(transMeta, name, directory, comments) with a newTitle that matches an existing Transformation in the target folder.","commonSituations":"Renaming a .ktr in Spoon to a name taken by another transformation; automation scripts that regenerate names; git-like workflows where two users renamed different objects to the same name.","solutions":["Pick a unique transformation name for the target folder","Check repository.exists(nameAbstractTransformation, dir) before renaming","Catch the exception and append a suffix/version to the name automatically"],"exampleFix":"// before\nrepository.renameTransformation(transMeta, \"extract\", dir, \"rename\");\n// after\nif (repository.exists(nameAbstractTransformation, dir)) {\n  name = \"extract_\" + System.currentTimeMillis();\n}\nrepository.renameTransformation(transMeta, name, dir, \"rename\");","handlingStrategy":"validation","validationCode":"if (repository.exists(nameAbstractTransformation, targetDir)) {\n  throw new IllegalArgumentException(\"Transformation name already taken in \" + targetDir);\n}","typeGuard":null,"tryCatchPattern":"try {\n  repository.renameTransformation(transMeta, newName, dir, comments);\n} catch (KettleException e) {\n  if (String.valueOf(e.getMessage()).contains(\"already exists\")) {\n    // append suffix and retry\n  }\n}","preventionTips":["Check existence before renaming","Auto-suffix colliding names","Coordinate renames across teams to avoid conflicts"],"tags":["pentaho","kettle","repository","name-conflict"],"backgroundTag":"file-already-exists","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"}