{"record":{"id":"a7cd42055149423b","repo":"pentaho/pentaho-kettle","slug":"trans-exception-unabletoopentransformation","errorCode":null,"errorMessage":"Trans.Exception.UnableToOpenTransformation","messagePattern":"Trans\\.Exception\\.UnableToOpenTransformation","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/Trans.java","lineNumber":778,"sourceCode":"      }\n\n      this.log = new LogChannel( LogChannel.GENERAL_SUBJECT, false, false );\n      this.log.setHooks( this );\n\n      transMeta.initializeVariablesFrom( parent );\n      initializeVariablesFrom( parent );\n      // PDI-3064 do not erase parameters from meta!\n      // instead of this - copy parameters to actual transformation\n      this.copyParametersFrom( parent );\n      this.activateParameters();\n\n      this.setDefaultLogCommitSize();\n\n      // Get a valid transactionId in case we run database transactional.\n      transactionId = calculateTransactionId();\n      threadName = transactionId; // / backward compatibility but deprecated!\n    } catch ( KettleException e ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"Trans.Exception.UnableToOpenTransformation\", name ), e );\n    }\n  }\n\n  /**\n   * Executes the transformation. This method will prepare the transformation for execution and then start all the\n   * threads associated with the transformation and its steps.\n   *\n   * @param arguments the arguments\n   * @throws KettleException if the transformation could not be prepared (initialized)\n   */\n  public void execute( String[] arguments ) throws KettleException {\n\n    // Isolated method call to avoid unnecessary unit tests issues [BACKLOG-36316 / PDI-19357]\n    setInitialLogBufferStartLine();\n    prepareExecution( arguments );\n    startThreads();\n  }\n","sourceCodeStart":760,"sourceCodeEnd":796,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/Trans.java#L760-L796","documentation":"The Trans constructor wraps KettleExceptions raised while preparing/opening the transformation and rethrows them as 'UnableToOpenTransformation' with the transformation name, preserving the cause. It indicates the transformation metadata could not be opened/initialized rather than a runtime execution failure.","triggerScenarios":"new Trans(...) construction where an inner KettleException occurs — e.g. failure loading from repository (as in error 1154), invalid file, or errors during setDefaultLogCommitSize/calculateTransactionId setup.","commonSituations":"Transformation files corrupted or created by an incompatible PDI version; repository connectivity problems; missing named resources/connections referenced by the KTR.","solutions":["Inspect the wrapped cause exception (getCause()) for the real failure","Validate the KTR opens in Spoon; re-save or upgrade it if from an older PDI version","Check repository connection settings and network availability before constructing Trans"],"exampleFix":"// before\nTrans t = new Trans(transMeta, rep, \"job.ktr\", \"/dir\", \"job\"); // throws\n// after\ntry {\n  Trans t = new Trans(transMeta, rep, \"job.ktr\", \"/dir\", \"job\");\n} catch (KettleException e) {\n  log.error(\"Open failed: \" + e.getCause(), e); // diagnose the real cause\n}","handlingStrategy":"try-catch","validationCode":"// validate the KTR opens before executing\nTransMeta meta = new TransMeta(filename);\nif (meta == null || meta.getSteps().isEmpty()) throw new IllegalStateException(\"Invalid KTR: \" + filename);","typeGuard":null,"tryCatchPattern":"try { Trans t = new Trans(...); } catch (KettleException e) { log.error(\"Open failed: \" + e.getMessage() + \", cause: \" + e.getCause(), e); }","preventionTips":["Always inspect getCause() — this exception masks the real error","Validate KTR files in Spoon after version upgrades","Check repository/file accessibility before opening"],"tags":["kettle","transformation","open-failure"],"backgroundTag":"file-read-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"}