pentaho/pentaho-kettle · error · KettleException

ScriptValuesMetaMod.Exception.UnableToSaveStepInfo

Error message

ScriptValuesMetaMod.Exception.UnableToSaveStepInfo

What it means

Kettle wraps any exception thrown while persisting this ScriptValuesMod step's configuration to the repository (saveRep) into a KettleException with this message plus the step's ObjectId. The step's field definitions (name, type, length, precision, replace flag) could not be saved. The root cause is attached as the nested exception.

Solutions

  1. Check the nested cause for the underlying repository/SQL error
  2. Confirm the repository database is writable, reachable, and has free space
  3. Reconnect/re-login to the repository and retry the save
  4. Check DB column sizes for VALUE_STRING/VALUE_NUM in r_step_attribute vs. the data being saved
  5. Align plugin/engine versions so type ids map to valid ValueMetaFactory names

Example fix

// before: saving with a stale repository connection
repository.save(transMeta, versionComment, null, metaStore);
// after: reconnect if the session was lost, then save
if (!repository.isConnected()) { repository.connect(repoMeta.getUsername(), repoMeta.getPassword()); }
repository.save(transMeta, versionComment, null, metaStore);
Defensive patterns

Strategy: try-catch

Validate before calling

// before repository.save: check writability and connection
if (!repository.isConnected()) throw new KettleException("Repository not connected");
// optionally: SELECT 1 from r_step_attribute LIMIT 1 to validate write access

Try / catch

try {
  repository.save(transMeta, comment, null, metaStore);
} catch (KettleException e) {
  if (e.getMessage().contains("UnableToSaveStepInfo")) {
    logError("Save failed for step " + e.getCause(), e);
    // retry after reconnect
  } else throw e;
}

Prevention

When it happens

Trigger: Repository.saveStepAttribute calls fail while saving per-field attributes (field_name/field_type/field_length/field_precision/field_replace) — e.g. repository connection failure, transaction rollback, or ValueMetaFactory.getValueMetaName receiving an invalid type id.

Common situations: Repository database down, out of space, or read-only when saving a transformation; connection pool exhausted; saving with a stale/expired repository session; oversized attribute values exceeding DB column limits.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/687ce22de2b7b1c7. Report an issue: GitHub.

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/scriptvalues_mod/ScriptValuesMetaMod.java:541

      rep.saveStepAttribute( id_transformation, id_step, 0, "optimizationLevel", optimizationLevel );

      for ( int i = 0; i < jsScripts.length; i++ ) {
        rep.saveStepAttribute( id_transformation, id_step, i, JSSCRIPT_TAG_NAME, jsScripts[i].getScriptName() );
        rep.saveStepAttribute( id_transformation, id_step, i, JSSCRIPT_TAG_SCRIPT, jsScripts[i].getScript() );
        rep.saveStepAttribute( id_transformation, id_step, i, JSSCRIPT_TAG_TYPE, jsScripts[i].getScriptType() );
      }

      for ( int i = 0; i < fieldname.length; i++ ) {
        rep.saveStepAttribute( id_transformation, id_step, i, "field_name", fieldname[i] );
        rep.saveStepAttribute( id_transformation, id_step, i, "field_rename", rename[i] );
        rep.saveStepAttribute( id_transformation, id_step, i, "field_type",
          ValueMetaFactory.getValueMetaName( type[i] ) );
        rep.saveStepAttribute( id_transformation, id_step, i, "field_length", length[i] );
        rep.saveStepAttribute( id_transformation, id_step, i, "field_precision", precision[i] );
        rep.saveStepAttribute( id_transformation, id_step, i, "field_replace", replace[i] );
      }
    } catch ( Exception e ) {
      throw new KettleException( BaseMessages
        .getString( PKG, "ScriptValuesMetaMod.Exception.UnableToSaveStepInfo" )
        + id_step, e );
    }
  }

  public void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta,
    RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space,
    Repository repository, IMetaStore metaStore ) {
    boolean error_found = false;
    String error_message = "";
    CheckResult cr;

    Context jscx;
    Scriptable jsscope;
    Script jsscript;

    jscx = ContextFactory.getGlobal().enterContext();
    jsscope = jscx.initStandardObjects( null, false );

View on GitHub (pinned to f3058517a1)