{"record":{"id":"5a2379e9ac09f024","repo":"pentaho/pentaho-kettle","slug":"execsqlmeta-exception-unabletosavestepinfo","errorCode":"ExecSQLMeta.Exception.UnableToSaveStepInfo","errorMessage":"ExecSQLMeta.Exception.UnableToSaveStepInfo\" + id_step","messagePattern":"ExecSQLMeta\\.Exception\\.UnableToSaveStepInfo\" \\+ id_step","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/sql/ExecSQLMeta.java","lineNumber":377,"sourceCode":"      rep.saveStepAttribute( id_transformation, id_step, \"single_statement\", singleStatement );\n      rep.saveStepAttribute( id_transformation, id_step, \"replace_variables\", replaceVariables );\n      rep.saveStepAttribute( id_transformation, id_step, \"quoteString\", quoteString );\n      rep.saveStepAttribute( id_transformation, id_step, \"set_params\", setParams );\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      for ( int i = 0; i < arguments.length; i++ ) {\n        rep.saveStepAttribute( id_transformation, id_step, i, \"arg_name\", arguments[i] );\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"ExecSQLMeta.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( CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(\n          PKG, \"ExecSQLMeta.CheckResult.ConnectionExists\" ), stepMeta );\n      remarks.add( cr );\n\n      Database db = new Database( loggingObject, databaseMeta );\n      db.shareVariablesWith( transMeta );\n      databases = new Database[] { db }; // keep track of it for","sourceCodeStart":359,"sourceCodeEnd":395,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/sql/ExecSQLMeta.java#L359-L395","documentation":"Thrown by ExecSQLMeta.saveRep when persisting the step's attributes to the repository fails, including the per-index arg_name writes for each SQL argument. The KettleException message concatenates the message key with id_step. Saving the transformation to the repository aborts.","triggerScenarios":"Calling saveRep when repository writes fail: dropped DB connection, read-only repository account, constraint or size violations on saved attribute values, locked R_STEP_ATTRIBUTE rows from concurrent saves.","commonSituations":"Saving from Spoon with a stale repository session; repository database restarted mid-save; insufficient grants after an account migration; tablespace full on large SQL text attributes.","solutions":["Inspect the wrapped cause for the underlying repository error","Verify write permissions on the repository account","Reconnect the repository and retry the save","Check DB tablespace/disk capacity (long SQL bodies are stored as attributes)","Save a local .ktr copy to avoid losing work while repository issues persist"],"exampleFix":"// before\ntransMeta.saveRep(rep, metaStore, id_transformation); // may throw for ExecSQL step\n// after\ntry {\n  transMeta.saveRep(rep, metaStore, id_transformation);\n} catch (KettleException e) {\n  logError(\"Repository save failed: \" + e.getCause());\n  rep.disconnect(); rep.connect();\n  transMeta.saveRep(rep, metaStore, id_transformation);\n}","handlingStrategy":"try-catch","validationCode":"// before save\nif (!rep.isConnected()) rep.connect();\nif (execSqlMeta.getArguments() != null) {\n  for (String a : execSqlMeta.getArguments()) { if (a == null) throw new IllegalStateException(\"null argument name\"); }\n}","typeGuard":null,"tryCatchPattern":"try { transMeta.saveRep(rep, metaStore, idTransformation); } catch (KettleException e) { logError(\"ExecSQL save failed: \" + e.getCause()); rep.disconnect(); rep.connect(); transMeta.saveRep(rep, metaStore, idTransformation); }","preventionTips":["Maintain an active repository session during saves","Confirm write permissions for the repository user","Check DB capacity for long SQL attribute values","Keep local .ktr backups before saving"],"tags":["repository","persistence","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"}