{"record":{"id":"73f5cff5fb2db6f2","repo":"pentaho/pentaho-kettle","slug":"salesforceupsertmeta-exception-errorreadingrepository","errorCode":null,"errorMessage":"SalesforceUpsertMeta.Exception.ErrorReadingRepository","messagePattern":"SalesforceUpsertMeta\\.Exception\\.ErrorReadingRepository","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/salesforce/core/src/main/java/org/pentaho/di/trans/steps/salesforceupsert/SalesforceUpsertMeta.java","lineNumber":311,"sourceCode":"\n  public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException {\n    super.readRep( rep, metaStore, id_step, databases );\n    try {\n      setUpsertField( rep.getStepAttributeString( id_step, \"upsertfield\" ) );\n      setBatchSize( rep.getStepAttributeString( id_step, \"batchSize\" ) );\n      setSalesforceIDFieldName( rep.getStepAttributeString( id_step, \"salesforceIDFieldName\" ) );\n      int nrFields = rep.countNrStepAttributes( id_step, \"field_name\" );\n      allocate( nrFields );\n\n      for ( int i = 0; i < nrFields; i++ ) {\n        updateLookup[i] = rep.getStepAttributeString( id_step, i, \"field_name\" );\n        updateStream[i] = rep.getStepAttributeString( id_step, i, \"field_attribut\" );\n        useExternalId[i] =\n          Boolean.valueOf( rep.getStepAttributeBoolean( id_step, i, \"field_useExternalId\", false ) );\n      }\n      setRollbackAllChangesOnError( rep.getStepAttributeBoolean( id_step, \"rollbackAllChangesOnError\" ) );\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"SalesforceUpsertMeta.Exception.ErrorReadingRepository\" ), e );\n    }\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, \"upsertfield\", getUpsertField() );\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      }","sourceCodeStart":293,"sourceCodeEnd":329,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/salesforce/core/src/main/java/org/pentaho/di/trans/steps/salesforceupsert/SalesforceUpsertMeta.java#L293-L329","documentation":"This KettleException wraps any failure while reading the Salesforce Upsert step's saved settings from the Pentaho repository in readRep — the upsert counterpart of the update step's equivalent. Repository attribute reads that fail are rethrown with this localized message and the underlying cause attached; the step metadata cannot be loaded.","triggerScenarios":"Calling readRep on SalesforceUpsertMeta when rep.getStepAttributeString/getStepAttributeBoolean throw — repository connection lost, id_step missing, or repository metadata tables inaccessible.","commonSituations":"Loading an upsert step from a database repository with a stale/timed-out connection; repository schema migration gaps; orphaned step rows after repository restore.","solutions":["Check the chained cause to identify the true repository failure and fix it.","Verify the repository connection settings and connectivity before opening the transformation.","Confirm the transformation/step IDs exist in the repository tables.","Re-save the step via the PDI UI to regenerate missing repository attributes."],"exampleFix":"// before\nmeta.readRep(repository, metaStore, stepMeta.getObjectId(), null);\n// after\ntry {\n  meta.readRep(repository, metaStore, stepMeta.getObjectId(), null);\n} catch (KettleException e) {\n  logError(\"Repository read failed for Salesforce Upsert step\", e);\n  repository.connect(); // reconnect then retry the load\n  meta.readRep(repository, metaStore, stepMeta.getObjectId(), null);\n}","handlingStrategy":"try-catch","validationCode":"if (repository == null || !repository.isConnected()) throw new IllegalStateException(\"Repository not connected before readRep\");","typeGuard":null,"tryCatchPattern":"try { meta.readRep(rep, metaStore, idStep, null); } catch (KettleException e) { log.error(\"ErrorReadingRepository, cause: \" + e.getCause(), e); throw e; }","preventionTips":["Verify repository connectivity before opening transformations","Inspect getCause() for the true repository failure","Regenerate step attributes by re-saving the step after repository restores"],"tags":["pentaho","kettle","repository","salesforce","metadata"],"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"}