{"record":{"id":"be4c160f4d4ea71c","repo":"pentaho/pentaho-kettle","slug":"dbprocmeta-exception-unabletosavestepinfo","errorCode":"DBProcMeta.Exception.UnableToSaveStepInfo","errorMessage":"DBProcMeta.Exception.UnableToSaveStepInfo","messagePattern":"DBProcMeta\\.Exception\\.UnableToSaveStepInfo","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/dbproc/DBProcMeta.java","lineNumber":382,"sourceCode":"\n      for ( int i = 0; i < argument.length; i++ ) {\n        rep.saveStepAttribute( id_transformation, id_step, i, \"arg_name\", argument[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"arg_direction\", argumentDirection[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"arg_type\",\n          ValueMetaFactory.getValueMetaName( argumentType[i] ) );\n      }\n\n      rep.saveStepAttribute( id_transformation, id_step, \"result_name\", resultName );\n      rep.saveStepAttribute( id_transformation, id_step, \"result_type\",\n        ValueMetaFactory.getValueMetaName( resultType ) );\n      rep.saveStepAttribute( id_transformation, id_step, \"auto_commit\", autoCommit );\n\n      // Also, save the step-database relationship!\n      if ( database != null ) {\n        rep.insertStepDatabase( id_transformation, id_step, database.getObjectId() );\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"DBProcMeta.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    if ( database != null ) {\n      Database db = new Database( transMeta, database );\n      try {\n        db.connect();\n\n        // Look up fields in the input stream <prev>\n        if ( prev != null && prev.size() > 0 ) {\n          boolean first = true;","sourceCodeStart":364,"sourceCodeEnd":400,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/dbproc/DBProcMeta.java#L364-L400","documentation":"DBProcMeta.saveRep writes the DB Procedure step configuration (procedure name, arguments, result, connection) to the repository and links the step-database relationship. Any repository write exception is wrapped in this localized KettleException with id_step appended, aborting the save.","triggerScenarios":"Saving a transformation to a repository when saveStepAttribute or insertStepDatabase fails — lost DB connection, constraint violation, read-only repository, or null/invalid database metadata causing insertStepDatabase to fail.","commonSituations":"Repository DB outage or timeout; repository user lacking write permissions; referenced connection deleted so database.getObjectId() is stale; long-edited transformation with a stale DB session.","solutions":["Read the chained cause for the underlying repository error and fix connectivity/permissions first.","Reconnect to the repository (or restart Spoon) and retry the save.","Ensure the step's database connection exists and is saved; re-create the connection if its object id is stale.","Confirm the repository schema version matches the engine and run the upgrade tool if not."],"exampleFix":"// no code change; repair workflow\n// 1. Repository -> Reconnect  2. Re-save the DB connection  3. File -> Save","handlingStrategy":"retry","validationCode":"if (!rep.isConnected()) throw new IllegalStateException(\"Repository not connected\");\nif (meta.getDatabase(meta) != null && meta.getDatabase(meta).getObjectId() == null)\n  throw new IllegalStateException(\"Step references an unsaved database connection\");","typeGuard":"boolean readyToSave(Repository rep, DatabaseMeta db){\n  return rep.isConnected() && (db == null || db.getObjectId() != null);\n}","tryCatchPattern":"try { meta.saveRep(rep, metaStore, idTransformation, idStep); }\ncatch (KettleException e) {\n  logError(\"DBProc repository save failed: \" + e.getCause(), e);\n  // reconnect and retry once\n  rep.disconnect(); rep.connect(user, pass);\n  meta.saveRep(rep, metaStore, idTransformation, idStep);\n}","preventionTips":["Save the referenced database connection before saving the step.","Reconnect the repository session if it went stale.","Ensure write permissions on repository tables.","Keep repository schema version in sync with the engine."],"tags":["kettle","repository","write-failure"],"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"}