{"record":{"id":"aae81924fb06e42b","repo":"pentaho/pentaho-kettle","slug":"unable-to-verify-if-the-transformation-with-name-0-in","errorCode":null,"errorMessage":"Unable to verify if the transformation with name [{0}] in directory [{1}] exists","messagePattern":"Unable to verify if the transformation with name \\[(.+?)\\] in directory \\[(.+?)\\] exists","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryTransDelegate.java","lineNumber":95,"sourceCode":"\n  public RowMetaAndData getTransHop( ObjectId id_trans_hop ) throws KettleException {\n    return repository.connectionDelegate.getOneRow(\n      quoteTable( KettleDatabaseRepository.TABLE_R_TRANS_HOP ),\n      quote( KettleDatabaseRepository.FIELD_TRANS_HOP_ID_TRANS_HOP ), id_trans_hop );\n  }\n\n  public RowMetaAndData getTransDependency( ObjectId id_dependency ) throws KettleException {\n    return repository.connectionDelegate.getOneRow(\n      quoteTable( KettleDatabaseRepository.TABLE_R_DEPENDENCY ),\n      quote( KettleDatabaseRepository.FIELD_DEPENDENCY_ID_DEPENDENCY ), id_dependency );\n  }\n\n  public boolean existsTransMeta( String name, RepositoryDirectoryInterface repositoryDirectory,\n    RepositoryObjectType objectType ) throws KettleException {\n    try {\n      return ( getTransformationID( name, repositoryDirectory.getObjectId() ) != null );\n    } catch ( KettleException e ) {\n      throw new KettleException( \"Unable to verify if the transformation with name [\"\n        + name + \"] in directory [\" + repositoryDirectory + \"] exists\", e );\n    }\n  }\n\n  public synchronized ObjectId getTransformationID( String name, ObjectId id_directory ) throws KettleException {\n    return repository.connectionDelegate.getIDWithValue(\n      quoteTable( KettleDatabaseRepository.TABLE_R_TRANSFORMATION ),\n      quote( KettleDatabaseRepository.FIELD_TRANSFORMATION_ID_TRANSFORMATION ),\n      quote( KettleDatabaseRepository.FIELD_TRANSFORMATION_NAME ), name,\n      quote( KettleDatabaseRepository.FIELD_TRANSFORMATION_ID_DIRECTORY ), id_directory );\n  }\n\n  public synchronized ObjectId getTransHopID( ObjectId id_transformation, ObjectId id_step_from,\n    ObjectId id_step_to ) throws KettleException {\n    String[] lookupkey =\n      new String[] {\n        quote( KettleDatabaseRepository.FIELD_TRANS_HOP_ID_TRANSFORMATION ),\n        quote( KettleDatabaseRepository.FIELD_TRANS_HOP_ID_STEP_FROM ),","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryTransDelegate.java#L77-L113","documentation":"existsTransMeta() checks whether a transformation name already exists in a repository directory by calling getTransformationID(). If that lookup throws a KettleException (a database-level failure), it is rethrown as a KettleException with the message 'Unable to verify if the transformation with name [{0}] in directory [{1}] exists'. This is an infrastructure failure while probing for name existence, not the answer 'it doesn't exist'.","triggerScenarios":"repository.existsTransMeta(name, directory, RepositoryObjectType.TRANSFORMATION) when the underlying ID-with-value query fails — repository connection down, invalid directory ObjectId, SQL error, or lock timeout on the transformation table.","commonSituations":"Saving/importing a transformation while the repository connection has dropped; passing a directory whose ObjectId was never persisted; database permissions issues on the transformation lookup tables.","solutions":["Check e.getCause() for the actual database error and restore repository connectivity first.","Verify the RepositoryDirectory was loaded/saved from the repository (its ObjectId is non-null) before calling exists.","Retry the existence check after reconnecting; wrap in try/catch to treat 'cannot verify' separately from 'not exists'.","Check repository user privileges to read the transformation listing."],"exampleFix":"// before\nboolean exists = repository.existsTransMeta(name, dir, RepositoryObjectType.TRANSFORMATION);\n// after\nboolean exists;\ntry {\n  exists = repository.existsTransMeta(name, dir, RepositoryObjectType.TRANSFORMATION);\n} catch (KettleException e) {\n  throw new KettleException(\"Repository unreachable while checking \" + name, e);\n}","handlingStrategy":"try-catch","validationCode":"if (repositoryDirectory == null || repositoryDirectory.getObjectId() == null) {\n  throw new KettleException(\"Directory is not persisted; load it from the repository first\");\n}","typeGuard":"boolean dirValid = dir != null && dir.getObjectId() != null;","tryCatchPattern":"try {\n  exists = repository.existsTransMeta(name, dir, RepositoryObjectType.TRANSFORMATION);\n} catch (KettleException e) {\n  throw new KettleException(\"Cannot verify existence (repository issue)\", e);\n}","preventionTips":["Only pass directories obtained from loadRepositoryDirectoryTree()","Confirm repository connectivity before existence checks","Distinguish 'cannot verify' from 'does not exist' in your error handling"],"tags":["database","repository","pentaho-kettle","existence-check"],"backgroundTag":"database-query-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"}