{"record":{"id":"5fc8b100613721be","repo":"pentaho/pentaho-kettle","slug":"execsqlrowmeta-exception-unabletosavestepinfo","errorCode":null,"errorMessage":"ExecSQLRowMeta.Exception.UnableToSaveStepInfo","messagePattern":"ExecSQLRowMeta\\.Exception\\.UnableToSaveStepInfo","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/execsqlrow/ExecSQLRowMeta.java","lineNumber":349,"sourceCode":"    try {\n      rep.saveDatabaseMetaStepAttribute( id_transformation, id_step, \"id_connection\", databaseMeta );\n      rep.saveStepAttribute( id_transformation, id_step, \"commit\", commitSize );\n      rep.saveStepAttribute( id_transformation, id_step, \"sql_field\", sqlField );\n\n      rep.saveStepAttribute( id_transformation, id_step, \"insert_field\", insertField );\n      rep.saveStepAttribute( id_transformation, id_step, \"update_field\", updateField );\n      rep.saveStepAttribute( id_transformation, id_step, \"delete_field\", deleteField );\n      rep.saveStepAttribute( id_transformation, id_step, \"read_field\", readField );\n\n      // Also, save the step-database relationship!\n      if ( databaseMeta != null ) {\n        rep.insertStepDatabase( id_transformation, id_step, databaseMeta.getObjectId() );\n      }\n\n      rep.saveStepAttribute( id_transformation, id_step, \"sqlFromfile\", sqlFromfile );\n      rep.saveStepAttribute( id_transformation, id_step, \"sendOneStatement\", sendOneStatement );\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"ExecSQLRowMeta.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\n    if ( databaseMeta != null ) {\n      cr =\n        new CheckResult( CheckResult.TYPE_RESULT_OK, BaseMessages.getString(\n          PKG, \"ExecSQLRowMeta.CheckResult.ConnectionExists\" ), stepMeta );\n      remarks.add( cr );\n\n      Database db = new Database( loggingObject, databaseMeta );\n      databases = new Database[] { db }; // keep track of it for cancelling purposes...\n","sourceCodeStart":331,"sourceCodeEnd":367,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/execsqlrow/ExecSQLRowMeta.java#L331-L367","documentation":"KettleException thrown by ExecSQLRowMeta.saveRep() when saving the step's attributes to the repository fails, with id_step appended to the message. It wraps exceptions thrown by rep.saveStepAttribute() or rep.insertStepDatabase() calls.","triggerScenarios":"saveRep() fails on rep.insertStepDatabase() or any rep.saveStepAttribute(id_transformation, id_step, ...) — repository write error, invalid database meta reference, lost connection, or read-only repository.","commonSituations":"Referenced database connection not yet saved (null ObjectId); repository quota/disk full; concurrent modification conflict; insufficient repository permissions.","solutions":["Save the referenced database connection first so it has a valid ObjectId, then save the step.","Check getCause() for the JDBC-level write error (permissions, constraint, space).","Confirm repository user has write access to the target folder.","Retry after resolving lock/availability issues on the repository DB."],"exampleFix":"// before\nrep.save(stepMeta.getStepMetaInterface(), ...); // db connection not persisted\n// after\nif (databaseMeta.getObjectId() == null) {\n  rep.save(databaseMeta, null);\n}\nmeta.saveRep(rep, metaStore, transMeta.getObjectId(), stepMeta.getObjectId());","handlingStrategy":"try-catch","validationCode":"if (databaseMeta.getObjectId() == null) rep.save(databaseMeta, null); // persist connection first","typeGuard":null,"tryCatchPattern":"try { meta.saveRep(rep, metaStore, id_trans, id_step); } catch (KettleException e) { log.error(\"repository write failed: \" + e.getCause(), e); }","preventionTips":["Persist shared objects (connections) before steps","Verify write permissions and repository disk space","Retry on transient JDBC failures"],"tags":["repository","metadata-save","kettle"],"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"}