{"record":{"id":"143db08ff260c913","repo":"pentaho/pentaho-kettle","slug":"stringcutmeta-exception-unexpectederrorinreadingstepinfo","errorCode":null,"errorMessage":"StringCutMeta.Exception.UnexpectedErrorInReadingStepInfo","messagePattern":"StringCutMeta\\.Exception\\.UnexpectedErrorInReadingStepInfo","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/stringcut/StringCutMeta.java","lineNumber":206,"sourceCode":"    retval.append( \"    </fields>\" ).append( Const.CR );\n\n    return retval.toString();\n  }\n\n  public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException {\n    try {\n\n      int nrkeys = rep.countNrStepAttributes( id_step, \"in_stream_name\" );\n\n      allocate( nrkeys );\n      for ( int i = 0; i < nrkeys; i++ ) {\n        fieldInStream[i] = Const.NVL( rep.getStepAttributeString( id_step, i, \"in_stream_name\" ), \"\" );\n        fieldOutStream[i] = Const.NVL( rep.getStepAttributeString( id_step, i, \"out_stream_name\" ), \"\" );\n        cutFrom[i] = Const.NVL( rep.getStepAttributeString( id_step, i, \"cut_from\" ), \"\" );\n        cutTo[i] = Const.NVL( rep.getStepAttributeString( id_step, i, \"cut_to\" ), \"\" );\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"StringCutMeta.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\n      for ( int i = 0; i < fieldInStream.length; i++ ) {\n        rep.saveStepAttribute( id_transformation, id_step, i, \"in_stream_name\", fieldInStream[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"out_stream_name\", fieldOutStream[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"cut_from\", cutFrom[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"cut_to\", cutTo[i] );\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"StringCutMeta.Exception.UnableToSaveStepInfo\" )\n        + id_step, e );\n    }\n  }","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/stringcut/StringCutMeta.java#L188-L224","documentation":"StringCutMeta throws this KettleException in readRep() when reading the step's settings from the Pentaho repository fails unexpectedly. It wraps the underlying exception from rep.getStepAttributeString() calls. The step's configuration cannot be loaded, so transformation loading aborts.","triggerScenarios":"Calling readRep() when rep.getStepAttributeString(...) throws for attributes in_stream_name/out_stream_name/cut_from/cut_to — repository I/O error, missing step record, or corrupt attribute rows.","commonSituations":"Repository database connectivity problems; partially deleted step attributes; import/export that left inconsistent r_step_attribute rows.","solutions":["Inspect the wrapped cause exception for the repository error","Verify repository connectivity and retry loading the transformation","Check r_step_attribute rows for this id_step and repair/delete corrupt entries","Recreate the step in Spoon and re-save it to the repository"],"exampleFix":"// before\nthrow new KettleException(BaseMessages.getString(PKG, \"StringCutMeta.Exception.UnexpectedErrorInReadingStepInfo\"), e);\n// after\n// diagnose cause (e.g. repository disconnect) then:\nrepository.connect(...); // retry readRep with a healthy connection","handlingStrategy":"try-catch","validationCode":"// before readRep\nif (!repository.isConnected()) repository.connect(user, pass);\nif (idStep == null) throw new IllegalArgumentException(\"step id required\");","typeGuard":"boolean isReadable(Repository rep, ObjectId idStep) {\n  try { return idStep != null && rep.getStepAttributes(idStep) != null; }\n  catch (Exception e) { return false; }\n}","tryCatchPattern":"try {\n  meta.readRep(repository, metaStore, idStep, databases);\n} catch (KettleException e) {\n  logError(\"Repository read failed: \" + e.getCause(), e);\n  meta.setDefault();\n}","preventionTips":["Verify repository health before loading transformations","Audit r_step_attribute rows after imports/migrations","Retry with a fresh connection on transient repository errors","Re-save steps in Spoon to repair inconsistent attributes"],"tags":["repository","metadata-load","pdi","step-metadata"],"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"}