{"record":{"id":"dd2ea15a251d3053","repo":"pentaho/pentaho-kettle","slug":"salesforceinsertmeta-exception-errorsavingtorepository","errorCode":null,"errorMessage":"SalesforceInsertMeta.Exception.ErrorSavingToRepository","messagePattern":"SalesforceInsertMeta\\.Exception\\.ErrorSavingToRepository","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/salesforce/core/src/main/java/org/pentaho/di/trans/steps/salesforceinsert/SalesforceInsertMeta.java","lineNumber":309,"sourceCode":"    }\n  }\n\n  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {\n    super.saveRep( rep, metaStore, id_transformation, id_step );\n    try {\n      rep.saveStepAttribute( id_transformation, id_step, \"batchSize\", getBatchSize() );\n      rep.saveStepAttribute( id_transformation, id_step, \"salesforceIDFieldName\", getSalesforceIDFieldName() );\n\n      for ( int i = 0; i < updateLookup.length; i++ ) {\n        rep.saveStepAttribute( id_transformation, id_step, i, \"field_name\", getUpdateLookup()[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"field_attribut\", getUpdateStream()[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"field_useExternalId\", getUseExternalId()[i]\n          .booleanValue() );\n\n      }\n      rep.saveStepAttribute( id_transformation, id_step, \"rollbackAllChangesOnError\", isRollbackAllChangesOnError() );\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"SalesforceInsertMeta.Exception.ErrorSavingToRepository\", \"\" + id_step ), e );\n    }\n  }\n\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    super.check( remarks, transMeta, stepMeta, prev, input, output, info, space, repository, metaStore );\n    CheckResult cr;\n\n    // See if we get input...\n    if ( input != null && input.length > 0 ) {\n      cr =\n        new CheckResult( CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(\n          PKG, \"SalesforceInsertMeta.CheckResult.NoInputExpected\" ), stepMeta );\n    } else {\n      cr =\n        new CheckResult( CheckResult.TYPE_RESULT_OK, BaseMessages.getString(","sourceCodeStart":291,"sourceCodeEnd":327,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/salesforce/core/src/main/java/org/pentaho/di/trans/steps/salesforceinsert/SalesforceInsertMeta.java#L291-L327","documentation":"SalesforceInsertMeta.saveRep() persists the step's attributes to the Kettle repository. On any failure writing those attributes it throws a KettleException keyed 'SalesforceInsertMeta.Exception.ErrorSavingToRepository' including the id_step. The original exception (SQL error, constraint violation, connection loss) is chained as the cause.","triggerScenarios":"Calling saveRep (i.e., saving a transformation containing a Salesforce Insert step to a repository) when rep.saveStepAttribute throws: repository DB read-only, connection dropped mid-save, unique-key conflict on r_step_attribute, or value exceeding column size.","commonSituations":"Repository DB out of disk space or locked by another process; concurrent saves of the same transformation; repository schema not upgraded after a PDI upgrade; database user lacking INSERT/UPDATE privileges.","solutions":["Check the chained cause for the underlying SQL/database error code and message.","Verify the repository DB user has write privileges and the schema is current for your PDI version.","Retry the save after confirming no concurrent modification of the same transformation.","As a workaround, export the transformation to a .ktr file and store it in version control instead of the repository."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Check write access before saving\ntry (Connection c = repoDataSource.getConnection()) {\n  DatabaseMetaData md = c.getMetaData();\n  if (!md.updatesAreDetected(ResultSet.TYPE_FORWARD_ONLY)) { /* warn */ }\n}","typeGuard":null,"tryCatchPattern":"try {\n  transMeta.saveMetaStoreProperties(repository, metaStore);\n} catch (KettleException e) {\n  if (e.getCause() instanceof SQLException) {\n    log.error(\"Repository write failed: {}\", e.getCause().getMessage());\n  }\n  throw e;\n}","preventionTips":["Ensure the repository DB user has INSERT/UPDATE privileges on r_step_attribute.","Verify disk space and DB health before large saves.","Upgrade the repository schema after PDI upgrades.","Keep a .ktr file export as a fallback persistence path."],"tags":["kettle","repository","persistence","salesforce"],"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"}