{"record":{"id":"9e2eac9e10a32775","repo":"pentaho/pentaho-kettle","slug":"gpbulkloadermeta-exception-unabletosavestepinfotorepository-9e2eac","errorCode":"GPBulkLoaderMeta.Exception.UnableToSaveStepInfoToRepository","errorMessage":"GPBulkLoaderMeta.Exception.UnableToSaveStepInfoToRepository","messagePattern":"GPBulkLoaderMeta\\.Exception\\.UnableToSaveStepInfoToRepository","errorType":"error_code","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/postgresql-db-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/pgbulkloader/PGBulkLoaderMeta.java","lineNumber":351,"sourceCode":"      rep.saveStepAttribute( id_transformation, id_step, \"load_action\", loadAction );\n\n      rep.saveStepAttribute( id_transformation, id_step, \"dbname_override\", dbNameOverride );\n      rep.saveStepAttribute( id_transformation, id_step, \"enclosure\", enclosure );\n      rep.saveStepAttribute( id_transformation, id_step, \"delimiter\", delimiter );\n      rep.saveStepAttribute( id_transformation, id_step, \"stop_on_error\", stopOnError );\n\n      for ( int i = 0; i < fieldTable.length; i++ ) {\n        rep.saveStepAttribute( id_transformation, id_step, i, \"stream_name\", fieldTable[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"field_name\", fieldStream[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"date_mask\", dateMask[i] );\n      }\n\n      // Also, save the step-database relationship!\n      if ( databaseMeta != null ) {\n        rep.insertStepDatabase( id_transformation, id_step, databaseMeta.getObjectId() );\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"GPBulkLoaderMeta.Exception.UnableToSaveStepInfoToRepository\" )\n        + id_step, e );\n    }\n  }\n\n  @Override\n  public void getFields( Bowl bowl, RowMetaInterface rowMeta, String origin, RowMetaInterface[] info, StepMeta nextStep,\n    VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {\n    // Default: nothing changes to rowMeta\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    CheckResult cr;\n    String error_message = \"\";\n\n    if ( databaseMeta != null ) {","sourceCodeStart":333,"sourceCodeEnd":369,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/postgresql-db-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/pgbulkloader/PGBulkLoaderMeta.java#L333-L369","documentation":"PGBulkLoaderMeta.saveRep() wraps all repository persistence of this step's metadata (field mappings, DB connection binding via rep.insertStepDatabase) in a catch-all that rethrows as KettleException with the message \"Unable to save step info to the repository\" plus id_step. It means the step's serialized configuration could not be written to the Pentaho/Kettle repository. The root cause is always in the attached cause exception (repository DB down, lock, schema mismatch, etc.).","triggerScenarios":"Calling saveRep(...) when the underlying repository insert/update fails — e.g. rep.insertStepDatabase(id_transformation, id_step, ...) or any earlier rep.saveStepAttribute call throws (repository connection lost, repository database read-only, duplicate/invalid id_step).","commonSituations":"Saving a transformation containing the PostgreSQL/GP bulk loader step while the Pentaho repository (database or file repository) is unreachable or the repository user lacks write permission; corrupted id_step after a failed transformation save; network drop between client and repository DB mid-save.","solutions":["Inspect the cause (cause=true) exception for the real repository error — usually a JDBC connection or permission failure.","Verify the repository connection (Tools > Repository > Connect) and that the repository database is up and writable.","Retry saving the transformation after reconnecting; if persistent, re-create the step or save the transformation to a new name to get a fresh id_step.","Check the repository user's write privileges on the transformation/step tables."],"exampleFix":"// before\nrep.saveStepAttribute(...) // silently throws deep inside saveRep -> wrapped\n// after: verify repository is connected before saving\nif ( !rep.isConnected() ) {\n  rep.connect(); // ensure repository session is live\n}\nrep.saveStepAttribute(...);","handlingStrategy":"try-catch","validationCode":"if ( rep == null || !rep.isConnected() ) { throw new IllegalStateException( \"Repository not connected before save\" ); }","typeGuard":null,"tryCatchPattern":"try { stepMeta.saveRep( rep, id_transformation, id_step ); } catch ( KettleException e ) { logError( \"Save failed: \" + e.getCause(), e ); /* reconnect repo / retry */ }","preventionTips":["Verify repository connectivity before batch saves.","Check repository user write permissions.","Always log e.getCause(), not just the wrapper message."],"tags":["kettle","repository","metadata-persistence","pentaho"],"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"}