{"record":{"id":"78b56daf1e79b34b","repo":"pentaho/pentaho-kettle","slug":"unable-to-load-transformation-with-id-idtransformation","errorCode":null,"errorMessage":"Unable to load transformation with id [\" + idTransformation + \"]","messagePattern":"Unable to load transformation with id \\[\" \\+ idTransformation \\+ \"\\]","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java","lineNumber":3291,"sourceCode":"        transMeta.setRepository( this );\n        transMeta.setRepositoryDirectory( findDirectory( getParentPath( file.getPath() ) ) );\n        transMeta.setRepositoryLock( unifiedRepositoryLockService.getLock( file ) );\n        transMeta.setMetaStore( MetaStoreConst.getDefaultMetastore() ); // inject metastore\n\n        ExtensionPointHandler.callExtensionPoint( log, KettleExtensionPoint.TransSharedObjectsLoaded.id, transMeta );\n        transDelegate.dataNodeToElement(\n          pur.getDataAtVersionForRead( idTransformation.getId(), versionLabel, NodeRepositoryFileData.class ).getNode(),\n          transMeta );\n      } finally {\n        readWriteLock.readLock().unlock();\n      }\n\n      ExtensionPointHandler.callExtensionPoint( log, KettleExtensionPoint.TransformationMetaLoaded.id, transMeta );\n\n      transMeta.clearChanged();\n      return transMeta;\n    } catch ( Exception e ) {\n      throw new KettleException( \"Unable to load transformation with id [\" + idTransformation + \"]\", e );\n    }\n  }\n\n  @Override\n  public String getConnectMessage() {\n    return connectMessage;\n  }\n\n  @Override\n  public String[] getJobsUsingDatabase( ObjectId id_database ) throws KettleException {\n    List<String> result = new ArrayList<String>();\n    for ( RepositoryFile file : getReferrers( id_database, Collections.singletonList( RepositoryObjectType.JOB ) ) ) {\n      result.add( file.getPath() );\n    }\n    return result.toArray( new String[result.size()] );\n  }\n\n  @Override","sourceCodeStart":3273,"sourceCodeEnd":3309,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java#L3273-L3309","documentation":"Catch-all wrapper in PurRepository.loadTransformation(ObjectId idTransformation, String versionLabel): any non-KettleException while loading a transformation by id (file fetch at version, revision lookup, TransMeta build, TransformationMetaLoaded extension point) is re-thrown as a KettleException with the transformation id in the message.","triggerScenarios":"Calling loadTransformation(ObjectId, String versionLabel) with a deleted/invalid id, an invalid versionLabel, corrupt stored transformation XML, or a repository connectivity failure.","commonSituations":"Using a cached ObjectId after the transformation was deleted; id from a different repository; requesting a version that was purged; network failure to the BI server.","solutions":["Inspect e.getCause() to find the root failure","Verify the id exists with repository.exists(ObjectId) and fall back to path-based loading if not","Reconnect to the repository if connectivity is the issue","Confirm the versionLabel exists via getObjectRevision before loading"],"exampleFix":"// before\nTransMeta tm = repo.loadTransformation(oldId, null);\n// after\nif (repo.exists(oldId)) {\n  TransMeta tm = repo.loadTransformation(oldId, null);\n} else {\n  TransMeta tm = repo.loadTransformation(transPath, null);\n}","handlingStrategy":"try-catch","validationCode":"if (!repo.exists(idTransformation)) {\n  throw new KettleException(\"Transformation id no longer exists: \" + idTransformation);\n}","typeGuard":null,"tryCatchPattern":"try {\n  TransMeta tm = repo.loadTransformation(idTransformation, versionLabel);\n} catch (KettleException e) {\n  log.error(\"Transformation load failed for id \" + idTransformation + \", cause=\" + e.getCause(), e);\n  // fallback: path-based load\n  TransMeta tm2 = repo.loadTransformation(path, null);\n}","preventionTips":["Refresh ObjectIds from paths instead of caching them long-term","Validate versionLabel against object revisions first","Verify repository connectivity before bulk loads","Keep transformation content valid — test in Spoon"],"tags":["pentaho-kettle","repository","transformation","wrapped-exception"],"backgroundTag":"record-not-found","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"}