{"record":{"id":"b41935b2ea8bf9d1","repo":"pentaho/pentaho-kettle","slug":"unable-to-save-job-entry-of-type-mail-to-the-repository-for","errorCode":null,"errorMessage":"Unable to save job entry of type 'mail' to the repository for id_job=","messagePattern":"Unable to save job entry of type 'mail' to the repository for id_job=","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":551,"sourceCode":"      if ( fileType != null ) {\n        for ( int i = 0; i < fileType.length; i++ ) {\n          rep.saveJobEntryAttribute( id_job, getObjectId(), i, \"file_type\", ResultFile.getTypeCode( fileType[i] ) );\n        }\n      }\n\n      rep.saveJobEntryAttribute( id_job, getObjectId(), TAG_ZIP_FILES, zipFiles );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), TAG_ZIP_NAME, zipFilename );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), TAG_REPLY_TO_ADDRESSES, replyToAddresses );\n\n      // save the arguments...\n      if ( embeddedimages != null ) {\n        for ( int i = 0; i < embeddedimages.length; i++ ) {\n          rep.saveJobEntryAttribute( id_job, getObjectId(), i, TAG_EMBEDDED_IMAGE, embeddedimages[i] );\n          rep.saveJobEntryAttribute( id_job, getObjectId(), i, \"contentid\", contentids[i] );\n        }\n      }\n    } catch ( KettleDatabaseException dbe ) {\n      throw new KettleException(\n        \"Unable to save job entry of type 'mail' to the repository for id_job=\" + id_job, dbe );\n    }\n  }\n\n  public void setServer( String s ) {\n    server = s;\n  }\n\n  public String getServer() {\n    return server;\n  }\n\n  public void setDestination( String dest ) {\n    destination = dest;\n  }\n\n  public void setDestinationCc( String destCc ) {\n    destinationCc = destCc;","sourceCodeStart":533,"sourceCodeEnd":569,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/mail-job/impl/src/main/java/org/pentaho/di/job/entries/mail/JobEntryMail.java#L533-L569","documentation":"Outer catch-all in JobEntryMail.saveRep: persisting the 'mail' job entry (attached files, types, zip options, embedded images) to the repository failed. The message includes the job entry id; the cause is attached.","triggerScenarios":"saveRep writes attributes (including embedded image arrays) and the repository rejects the write: connection failure, read-only DB, constraint violation.","commonSituations":"Repository DB out of disk space or read-only; DB user lacking write privileges; embedded image paths/ids causing oversized or invalid attribute rows.","solutions":["Read the chained KettleDatabaseException for the root SQL error.","Ensure the repository DB is writable and the user has INSERT/UPDATE rights.","Retry the save after connectivity is restored, or save the job to a .kjb file as a workaround.","Upgrade the repository schema if it predates the current Pentaho version."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (rep == null || !rep.isConnected()) throw new KettleException(\"Repository not connected; cannot save mail job entry.\");","typeGuard":null,"tryCatchPattern":"try { saveJobEntry(); } catch (KettleException e) {\n  logError(\"Repository save failed; exporting job to file as fallback: \" + e.getMessage(), e);\n  writeJobToFile(\"/backup/job.kjb\");\n}","preventionTips":["Confirm DB write privileges and writable state before bulk repository edits.","Keep repository schema current with the PDI version.","Keep embedded image lists modest; verify referenced image paths exist before saving."],"tags":["repository","database","job-entry","persistence"],"backgroundTag":"database-write-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"}