{"record":{"id":"edbbb0410b1aae26","repo":"pentaho/pentaho-kettle","slug":"gploadmeta-exception-unabletosavestepinfotorepository","errorCode":null,"errorMessage":"GPLoadMeta.Exception.UnableToSaveStepInfoToRepository","messagePattern":"GPLoadMeta\\.Exception\\.UnableToSaveStepInfoToRepository","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/gpload/core/src/main/java/org/pentaho/di/trans/steps/gpload/GPLoadMeta.java","lineNumber":537,"sourceCode":"\n      for ( int i = 0; i < localHosts.length; i++ ) {\n        rep.saveStepAttribute( id_transformation, id_step, i, \"local_host\", localHosts[i] );\n      }\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        rep.saveStepAttribute( id_transformation, id_step, i, \"match_column\", matchColumn[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"update_column\", updateColumn[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( PKG, \"GPLoadMeta.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, RowMetaInterface prev,\n      String[] input, String[] output, RowMetaInterface info, VariableSpace space, Repository repository,\n      IMetaStore metaStore ) {\n    CheckResult cr;\n    String error_message = \"\";\n\n    if ( databaseMeta != null ) {\n      Database db = new Database( loggingObject, databaseMeta );","sourceCodeStart":519,"sourceCodeEnd":555,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/gpload/core/src/main/java/org/pentaho/di/trans/steps/gpload/GPLoadMeta.java#L519-L555","documentation":"GPLoadMeta.saveRep() persists step settings to the repository; any exception (including insertStepDatabase for the linked database connection) is wrapped in a KettleException with this message plus id_step. The step's configuration was not saved.","triggerScenarios":"Repository writes during saveRep fail — repository connection dropped, constraint violations, missing id_step, databaseMeta.objectId null when inserting the step-database link, or read-only repository user.","commonSituations":"Network blip to the repository DB mid-save; saving a transformation whose step references a database connection that was never saved (null ObjectId); repository in read-only mode; version/lock conflicts.","solutions":["Verify repository connection and retry saving the transformation","Ensure the referenced database connection exists and is saved (it has an ObjectId) before saving the step","Check the repository user has write permissions on the transformation's folders","Inspect e.getCause() for the underlying SQL error and fix accordingly (constraints, schema)"],"exampleFix":"// before\n// databaseMeta referenced by GPload step not saved -> insertStepDatabase(null objectId)\n// after\n// Save the database connection first (DatabaseMeta dialog -> Save), then save the transformation","handlingStrategy":"try-catch","validationCode":"// before saveRep: ensure referenced DB connection is persisted\nif (databaseMeta != null && (databaseMeta.getObjectId() == null)) {\n  rep.save(databaseMeta, null, null); // persist connection first\n}","typeGuard":null,"tryCatchPattern":"try { saveTransformationToRepo(...) } catch (KettleException e) {\n  if (e.getMessage().contains(\"UnableToSaveStepInfoToRepository\")) {\n    logError(\"Save failed for step \" + id_step + \": \" + e.getCause());\n    /* retry after reconnecting the repository */\n  }\n  throw e;\n}","preventionTips":["Save referenced database connections before saving steps that use them","Use a repository account with write access; avoid read-only credentials for authoring","Handle transient DB outages with a retry on save","Check e.getCause() to distinguish SQL errors from metadata problems"],"tags":["kettle","repository","database-write","metadata"],"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"}