{"record":{"id":"8670eee54866cb4c","repo":"pentaho/pentaho-kettle","slug":"unable-to-load-job-entry-of-type-mail-from-the-repository","errorCode":null,"errorMessage":"Unable to load job entry of type 'mail' from the repository with idJobEntry=","messagePattern":"Unable to load job entry of type 'mail' from the repository with idJobEntry=","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/mail-job/impl/src/main/java/org/pentaho/di/job/entries/mail/JobEntryMail.java","lineNumber":488,"sourceCode":"        String typeCode = rep.getJobEntryAttributeString( idJobEntry, i, \"file_type\" );\n        fileType[i] = ResultFile.getType( typeCode );\n      }\n\n      zipFiles = rep.getJobEntryAttributeBoolean( idJobEntry, TAG_ZIP_FILES );\n      zipFilename = rep.getJobEntryAttributeString( idJobEntry, TAG_ZIP_NAME );\n      replyToAddresses = rep.getJobEntryAttributeString( idJobEntry, TAG_REPLY_TO_ADDRESSES );\n\n      // How many arguments?\n      int imagesNr = rep.countNrJobEntryAttributes( idJobEntry, TAG_EMBEDDED_IMAGE );\n      allocateImages( imagesNr );\n\n      // Read them all...\n      for ( int a = 0; a < imagesNr; a++ ) {\n        embeddedimages[a] = rep.getJobEntryAttributeString( idJobEntry, a, TAG_EMBEDDED_IMAGE );\n        contentids[a] = rep.getJobEntryAttributeString( idJobEntry, a, \"contentid\" );\n      }\n    } catch ( KettleDatabaseException dbe ) {\n      throw new KettleException( \"Unable to load job entry of type 'mail' from the repository with idJobEntry=\"\n        + idJobEntry, dbe );\n    }\n  }\n\n  @Override\n  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_job ) throws KettleException {\n    try {\n      rep.saveJobEntryAttribute( id_job, getObjectId(), TAG_SERVER, server );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), TAG_PORT, port );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), TAG_DESTINATION, destination );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), TAG_DESTINATION_CC, destinationCc );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), TAG_DESTINATION_BCC, destinationBCc );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), TAG_REPLYTO, replyAddress );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), TAG_REPLYTONAME, replyName );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), TAG_SUBJECT, subject );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), TAG_INCLUDE_DATE, includeDate );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), TAG_CONTACT_PERSON, contactPerson );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), TAG_CONTACT_PHONE, contactPhone );","sourceCodeStart":470,"sourceCodeEnd":506,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/mail-job/impl/src/main/java/org/pentaho/di/job/entries/mail/JobEntryMail.java#L470-L506","documentation":"JobEntryMail's repository load catches KettleDatabaseException while reading job entry attributes and rethrows as KettleException. The mail job entry metadata could not be loaded from the repository for the given idJobEntry.","triggerScenarios":"loadRep reads embedded-image attributes from the repository and the DB read fails: connection dropped, missing r_jobentry_attribute rows, corrupted records.","commonSituations":"Repository DB connectivity issues; partially deleted job leaving orphaned/missing attributes; cross-repository id mismatch after export/import.","solutions":["Check the chained KettleDatabaseException cause for the root SQL error.","Verify repository database connectivity and retry loading the job.","Re-save/re-import the job from a .kjb file copy if repository rows are inconsistent.","Clean up orphaned r_jobentry_attribute rows for the reported idJobEntry if needed."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (rep == null || !rep.isConnected()) {\n  throw new KettleException(\"Repository not connected; cannot load mail job entry.\");\n}","typeGuard":null,"tryCatchPattern":"try { loadJobEntryFromRepo(idJobEntry); } catch (KettleException e) {\n  logError(\"Repository load of mail job entry failed: \" + e.getMessage(), e);\n}","preventionTips":["Verify repository connectivity before batch job loads.","Avoid deleting job rows directly in the DB; use Spoon to delete so attributes are cleaned too.","Re-export jobs to files periodically as recovery copies."],"tags":["repository","database","job-entry","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"}