{"record":{"id":"843a82988b19cf00","repo":"pentaho/pentaho-kettle","slug":"scriptvaluesmetamod-exception","errorCode":null,"errorMessage":"ScriptValuesMetaMod.Exception.UnexpectedErrorInReadingStepInfo","messagePattern":"ScriptValuesMetaMod\\.Exception\\.UnexpectedErrorInReadingStepInfo","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/scriptvalues_mod/ScriptValuesMetaMod.java","lineNumber":515,"sourceCode":"            (int) rep.getStepAttributeInteger( id_step, i, JSSCRIPT_TAG_TYPE ),\n            rep.getStepAttributeString( id_step, i, JSSCRIPT_TAG_NAME ),\n            rep.getStepAttributeString( id_step, i, JSSCRIPT_TAG_SCRIPT ) );\n        }\n      }\n\n      int nrfields = rep.countNrStepAttributes( id_step, \"field_name\" );\n      allocate( nrfields );\n\n      for ( int i = 0; i < nrfields; i++ ) {\n        fieldname[i] = rep.getStepAttributeString( id_step, i, \"field_name\" );\n        rename[i] = rep.getStepAttributeString( id_step, i, \"field_rename\" );\n        type[i] = ValueMetaFactory.getIdForValueMeta( rep.getStepAttributeString( id_step, i, \"field_type\" ) );\n        length[i] = (int) rep.getStepAttributeInteger( id_step, i, \"field_length\" );\n        precision[i] = (int) rep.getStepAttributeInteger( id_step, i, \"field_precision\" );\n        replace[i] = rep.getStepAttributeBoolean( id_step, i, \"field_replace\" );\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"ScriptValuesMetaMod.Exception.UnexpectedErrorInReadingStepInfo\" ), e );\n    }\n  }\n\n  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {\n    try {\n      rep.saveStepAttribute( id_transformation, id_step, 0, \"compatible\", compatible );\n      rep.saveStepAttribute( id_transformation, id_step, 0, \"optimizationLevel\", optimizationLevel );\n\n      for ( int i = 0; i < jsScripts.length; i++ ) {\n        rep.saveStepAttribute( id_transformation, id_step, i, JSSCRIPT_TAG_NAME, jsScripts[i].getScriptName() );\n        rep.saveStepAttribute( id_transformation, id_step, i, JSSCRIPT_TAG_SCRIPT, jsScripts[i].getScript() );\n        rep.saveStepAttribute( id_transformation, id_step, i, JSSCRIPT_TAG_TYPE, jsScripts[i].getScriptType() );\n      }\n\n      for ( int i = 0; i < fieldname.length; i++ ) {\n        rep.saveStepAttribute( id_transformation, id_step, i, \"field_name\", fieldname[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"field_rename\", rename[i] );","sourceCodeStart":497,"sourceCodeEnd":533,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/scriptvalues_mod/ScriptValuesMetaMod.java#L497-L533","documentation":"Kettle wraps any unexpected exception thrown while reading this ScriptValuesMod step's configuration back from the repository (readRep) into a KettleException with this message. It means the step metadata could not be loaded from the repository database, so the transformation cannot be initialized. The original cause is attached as the nested exception.","triggerScenarios":"Repository.getStepAttributeString/getStepAttributeInteger/getStepAttributeBoolean throw (repository connection lost, database error, invalid id_step/ObjectId) or ValueMetaFactory.getIdForValueMeta encounters an unknown 'field_type' string stored in the repository.","commonSituations":"Repository database briefly unavailable or connection dropped while opening a transformation; corrupted or hand-edited r_step_attribute rows (e.g. a non-numeric field_type); restoring a transformation from an export with incompatible field type names; id_step pointing at a deleted step.","solutions":["Check the nested cause (getCause()) in the log to see the real repository or parsing error","Verify the Kettle repository database is reachable and credentials/connection settings are valid","Inspect the r_step_attribute rows for this step id and fix/clean corrupted 'field_type'/'field_length'/'field_precision' values","Re-export/recreate the step metadata; reopen the transformation in Spoon to re-save it","Upgrade/align engine and repository plugin versions so stored value-type names match ValueMetaFactory"],"exampleFix":"// before: unknown stored type breaks readRep\nrep.getStepAttributeString(id_step, i, \"field_type\") -> \"StringX\"\n// after: sanitize the stored value before saving, or fix the row\nUPDATE r_step_attribute SET VALUE_STR='String' WHERE ID_STEP=? AND CODE='field_type' AND VALUE_STR='StringX';","handlingStrategy":"try-catch","validationCode":"// before loadTransformation: verify repository connectivity\nif (repository == null || !repository.isConnected()) {\n  repository.connect(repoMeta.getUsername(), repoMeta.getPassword());\n}","typeGuard":null,"tryCatchPattern":"try {\n  transMeta = new TransMeta(repository, transName, directory, metaStore);\n} catch (KettleException e) {\n  if (e.getMessage().contains(\"UnexpectedErrorInReadingStepInfo\")) {\n    logError(\"Repository read failed for step metadata: \" + e.getCause(), e);\n    // fail fast or fall back to loading from XML export\n  } else throw e;\n}","preventionTips":["Always inspect getCause() of KettleException — the real repository error is nested","Monitor repository DB connectivity and use a connection pool with keepalive","Avoid hand-editing r_step_attribute rows; change step config via Spoon/API","Keep engine and step-plugin versions aligned across environments","Export transformations to XML as a recovery fallback"],"tags":["repository","metadata-read","kettle","database"],"backgroundTag":"database-query-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"}