{"record":{"id":"168121f4c7e64831","repo":"pentaho/pentaho-kettle","slug":"unable-to-load-step-type-mail-from-the-repository-with-id","errorCode":null,"errorMessage":"Unable to load step type 'mail' from the repository with id_step=","messagePattern":"Unable to load step type 'mail' from the repository with id_step=","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/mail/impl/src/main/java/org/pentaho/di/trans/steps/mail/MailMeta.java","lineNumber":1029,"sourceCode":"      this.usePriority = rep.getStepAttributeBoolean( id_step, TAG_USE_PRIORITY );\n      this.secureConnectionType = rep.getStepAttributeString( id_step, TAG_SECURE_CONNECTION_TYPE );\n\n      this.zipFiles = rep.getStepAttributeBoolean( id_step, TAG_ZIP_FILES );\n      this.zipFilename = rep.getStepAttributeString( id_step, TAG_ZIP_NAME );\n      this.zipLimitSize = rep.getStepAttributeString( id_step, TAG_ZIP_LIMIT_SIZE );\n\n      // How many arguments?\n      int imagesNr = rep.countNrStepAttributes( id_step, TAG_EMBEDDED_IMAGE );\n\n      allocate( imagesNr );\n\n      // Read them all...\n      for ( int a = 0; a < imagesNr; a++ ) {\n        embeddedImages[a] = rep.getStepAttributeString( id_step, a, TAG_EMBEDDED_IMAGE );\n        contentIds[a] = rep.getStepAttributeString( id_step, a, \"contentid\" );\n      }\n    } catch ( KettleDatabaseException dbe ) {\n      throw new KettleException(\n        \"Unable to load step type 'mail' from the repository with id_step=\" + id_step, dbe );\n    }\n  }\n\n  @Override\n  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {\n    try {\n      rep.saveStepAttribute( id_transformation, id_step, TAG_SERVER, this.server );\n      rep.saveStepAttribute( id_transformation, id_step, TAG_PORT, this.port );\n      rep.saveStepAttribute( id_transformation, id_step, TAG_DESTINATION, this.destination );\n      rep.saveStepAttribute( id_transformation, id_step, TAG_DESTINATION_CC, this.destinationCc );\n      rep.saveStepAttribute( id_transformation, id_step, TAG_DESTINATION_BCC, this.destinationBCc );\n      rep.saveStepAttribute( id_transformation, id_step, TAG_REPLYTO_ADDRESSES, this.replyToAddresses );\n      rep.saveStepAttribute( id_transformation, id_step, TAG_REPLYTO, this.replyAddress );\n      rep.saveStepAttribute( id_transformation, id_step, TAG_REPLYTO_NAME, this.replyName );\n\n      rep.saveStepAttribute( id_transformation, id_step, TAG_SUBJECT, this.subject );\n      rep.saveStepAttribute( id_transformation, id_step, TAG_INCLUDE_DATE, this.includeDate );","sourceCodeStart":1011,"sourceCodeEnd":1047,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/mail/impl/src/main/java/org/pentaho/di/trans/steps/mail/MailMeta.java#L1011-L1047","documentation":"MailMeta's repository-load constructor catches a KettleDatabaseException while reading mail step attributes and rethrows it as a KettleException. The step metadata could not be read from the repository database for the given id_step.","triggerScenarios":"loadRep from a repository database where the underlying KettleDatabaseException occurs: missing ktr rows, corrupted r_step_attribute records, repository connection dropped mid-read.","commonSituations":"Repository DB migrated/upgraded between Pentaho versions leaving orphaned attributes; database connection pool exhausted; transformation referenced from a different repository id space.","solutions":["Check the chained KettleDatabaseException cause for the root SQL error (connectivity, permissions, missing table).","Verify repository database connectivity and credentials, then retry loading the transformation.","If repository records are corrupted, re-save the transformation from a file copy or re-import it into the repository.","Repair orphaned r_step_attribute rows for the reported id_step if a partial delete/insert left the step inconsistent."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Before loading, verify the repository connection is healthy\nif (rep == null || !rep.isConnected()) {\n  throw new KettleException(\"Repository not connected; cannot load mail step.\");\n}","typeGuard":null,"tryCatchPattern":"try { loadTransFromRepo(id); } catch (KettleException e) {\n  logError(\"Repository load of mail step failed for id_step: \" + e.getMessage(), e);\n  // fall back to file-based copy if available\n}","preventionTips":["Keep repository schema upgraded in lockstep with the Pentaho version.","Monitor repository DB connectivity and connection-pool health.","Keep file-based exports (.ktr) as recoverable copies of repository content."],"tags":["repository","database","metadata","persistence"],"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"}