{"record":{"id":"c90dc0a6d568bee5","repo":"pentaho/pentaho-kettle","slug":"unable-to-save-step-type-mail-to-the-repository-for-id-step","errorCode":null,"errorMessage":"Unable to save step type 'mail' to the repository for id_step=","messagePattern":"Unable to save step type 'mail' to the repository for 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":1105,"sourceCode":"      rep.saveStepAttribute( id_transformation, id_step, TAG_USE_GRANT_TYPE, grantType );\n      rep.saveStepAttribute( id_transformation, id_step, TAG_ONLY_COMMENT, onlySendComment );\n      rep.saveStepAttribute( id_transformation, id_step, TAG_USE_HTML, useHTML );\n      rep.saveStepAttribute( id_transformation, id_step, TAG_USE_PRIORITY, usePriority );\n      rep.saveStepAttribute( id_transformation, id_step, TAG_SECURE_CONNECTION_TYPE, secureConnectionType );\n\n      rep.saveStepAttribute( id_transformation, id_step, TAG_ZIP_FILES, zipFiles );\n      rep.saveStepAttribute( id_transformation, id_step, TAG_ZIP_NAME, zipFilename );\n      rep.saveStepAttribute( id_transformation, id_step, TAG_ZIP_LIMIT_SIZE, zipLimitSize );\n\n      // save the arguments...\n      if ( embeddedImages != null ) {\n        for ( int i = 0; i < embeddedImages.length; i++ ) {\n          rep.saveStepAttribute( id_transformation, id_step, i, TAG_EMBEDDED_IMAGE, embeddedImages[i] );\n          rep.saveStepAttribute( id_transformation, id_step, i, \"contentid\", contentIds[i] );\n        }\n      }\n    } catch ( KettleDatabaseException dbe ) {\n      throw new KettleException( \"Unable to save step type 'mail' to the repository for id_step=\" + id_step, dbe );\n    }\n  }\n\n  @Override\n  public void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta,\n    RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space,\n    Repository repository, IMetaStore metaStore ) {\n    CheckResult cr;\n    if ( prev == null || prev.isEmpty() ) {\n      cr = new CheckResult( CheckResultInterface.TYPE_RESULT_WARNING, BaseMessages.getString(\n          PKG, \"MailMeta.CheckResult.NotReceivingFields\" ), stepMeta );\n    } else {\n      cr = new CheckResult( CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(\n          PKG, \"MailMeta.CheckResult.StepRecevingData\", prev.size() + \"\" ), stepMeta );\n    }\n    remarks.add( cr );\n\n    // See if we have input streams leading to this step!","sourceCodeStart":1087,"sourceCodeEnd":1123,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/mail/impl/src/main/java/org/pentaho/di/trans/steps/mail/MailMeta.java#L1087-L1123","documentation":"MailMeta.saveRep() catches KettleDatabaseException while persisting mail step attributes and rethrows as KettleException. Saving the mail step's settings to the repository failed for the given id_step.","triggerScenarios":"saveRep writes attributes and the repository database rejects an INSERT/UPDATE: connection failure, read-only DB, schema constraint violation, or transaction rollback.","commonSituations":"Repository database disk full or in read-only mode; DB user lacking INSERT privilege on r_step_attribute; repository schema out of date (missing columns after upgrade).","solutions":["Read the chained KettleDatabaseException for the root SQL error.","Verify the repository DB user has INSERT/UPDATE rights on the attribute tables and the DB is writable.","Run the repository upgrade tool if the Pentaho version changed and schema columns are missing.","Retry the save after fixing connectivity; alternatively save the transformation to a file as a workaround."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Pre-save checks\nif (rep == null || !rep.isConnected()) throw new KettleException(\"Repository not connected.\");\n// Ensure repository metadata is upgraded\nif (!rep.getRepositoryMeta().isDefault()) rep.connect(\"admin\", \"password\");","typeGuard":null,"tryCatchPattern":"try { saveToRepo(); } catch (KettleException e) {\n  logError(\"Repository save of mail step failed; export to file instead: \" + e.getMessage(), e);\n  saveToFile(\"/backup/mail-step.ktr\");\n}","preventionTips":["Ensure the repository DB user has INSERT/UPDATE privileges on attribute tables.","Run the repository upgrade after every Pentaho upgrade.","Monitor repository DB disk space; avoid read-only states."],"tags":["repository","database","metadata","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"}