{"record":{"id":"ef31ae49dd22076a","repo":"pentaho/pentaho-kettle","slug":"dynamicsqlrowmeta-exception-unabletosavestepinfo","errorCode":null,"errorMessage":"DynamicSQLRowMeta.Exception.UnableToSaveStepInfo","messagePattern":"DynamicSQLRowMeta\\.Exception\\.UnableToSaveStepInfo","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/dynamicsqlrow/DynamicSQLRowMeta.java","lineNumber":309,"sourceCode":"    }\n  }\n\n  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {\n    try {\n      rep.saveDatabaseMetaStepAttribute( id_transformation, id_step, \"id_connection\", databaseMeta );\n      rep.saveStepAttribute( id_transformation, id_step, \"rowlimit\", rowLimit );\n      rep.saveStepAttribute( id_transformation, id_step, \"sql\", sql );\n      rep.saveStepAttribute( id_transformation, id_step, \"outer_join\", outerJoin );\n      rep.saveStepAttribute( id_transformation, id_step, \"replace_vars\", replacevars );\n      rep.saveStepAttribute( id_transformation, id_step, \"sql_fieldname\", sqlfieldname );\n      rep.saveStepAttribute( id_transformation, id_step, \"query_only_on_change\", queryonlyonchange );\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, \"DynamicSQLRowMeta.Exception.UnableToSaveStepInfo\" )\n        + 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    CheckResult cr;\n    String error_message = \"\";\n\n    // See if we have input streams leading to this step!\n    if ( input.length > 0 ) {\n      cr =\n        new CheckResult( CheckResult.TYPE_RESULT_OK, BaseMessages.getString(\n          PKG, \"DynamicSQLRowMeta.CheckResult.ReceivingInfo\" ), stepMeta );\n      remarks.add( cr );\n    } else {\n      cr =","sourceCodeStart":291,"sourceCodeEnd":327,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/dynamicsqlrow/DynamicSQLRowMeta.java#L291-L327","documentation":"Kettle wraps any exception thrown while persisting the Dynamic SQL Row step's settings to a repository into this KettleException, appending the step id. The failing block includes saving step attributes and insertStepDatabase for the step's database connection.","triggerScenarios":"saveRep during transformation save: rep.saveStepAttribute(...) or rep.insertStepDatabase(...) throws (repository write failure, FK violation because the database connection is not saved, or databaseMeta.getObjectId() is null).","commonSituations":"Saving a transformation whose step references a database connection that was never persisted (null ObjectId); repository read-only permissions; connection dropped between read and save; shared-object inconsistencies.","solutions":["Check the cause exception; verify the repository connection is writable and still alive.","Ensure the step's database connection is defined and saved (has a valid ObjectId) before saving the transformation.","Save the database connection metadata first, then the transformation.","Re-run the save after restoring repository connectivity; check repository disk/permission issues."],"exampleFix":"// before: saving a step with an unsaved DB connection\nstepMeta.getDatabaseMeta(); // exists only in memory, ObjectId == null\ntransMeta.saveRep(repo);\n// after: persist the connection first\nif (databaseMeta.getObjectId() == null) {\n  repo.save(databaseMeta, null, false);\n}\nrepo.save(transMeta, \"comment\", null);","handlingStrategy":"try-catch","validationCode":"// before saving\nif (databaseMeta != null && databaseMeta.getObjectId() == null) {\n  repo.save(databaseMeta, null, false);\n}","typeGuard":null,"tryCatchPattern":"try { transMeta.saveRep(repo); } catch (KettleException e) { log.error(\"Step info save failed for step \" + id_step, e.getCause()); }","preventionTips":["Persist shared database connections before the transformation","Check repository write permissions","Maintain a stable connection during save"],"tags":["kettle","repository","metadata-save","database-connection"],"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"}