{"record":{"id":"95bf669b68a41f47","repo":"pentaho/pentaho-kettle","slug":"stringoperationsmeta-exception","errorCode":null,"errorMessage":"StringOperationsMeta.Exception.UnexpectedErrorInReadingStepInfo","messagePattern":"StringOperationsMeta\\.Exception\\.UnexpectedErrorInReadingStepInfo","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/stringoperations/StringOperationsMeta.java","lineNumber":492,"sourceCode":"\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\n        trimType[i] = Const.NVL( rep.getStepAttributeString( id_step, i, \"trim_type\" ), \"\" );\n        lowerUpper[i] = Const.NVL( rep.getStepAttributeString( id_step, i, \"lower_upper\" ), \"\" );\n        padding_type[i] = Const.NVL( rep.getStepAttributeString( id_step, i, \"padding_type\" ), \"\" );\n        padChar[i] = Const.NVL( rep.getStepAttributeString( id_step, i, \"pad_char\" ), \"\" );\n        padLen[i] = Const.NVL( rep.getStepAttributeString( id_step, i, \"pad_len\" ), \"\" );\n        initCap[i] = Const.NVL( rep.getStepAttributeString( id_step, i, \"init_cap\" ), \"\" );\n        maskXML[i] = Const.NVL( rep.getStepAttributeString( id_step, i, \"mask_xml\" ), \"\" );\n        digits[i] = Const.NVL( rep.getStepAttributeString( id_step, i, \"digits\" ), \"\" );\n        remove_special_characters[i] = Const.NVL( rep.getStepAttributeString( id_step, i, \"remove_special_characters\" ), \"\" );\n\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"StringOperationsMeta.Exception.UnexpectedErrorInReadingStepInfo\" ), e );\n    }\n  }\n\n  @Override\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, \"trim_type\", trimType[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"lower_upper\", lowerUpper[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"padding_type\", padding_type[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"pad_char\", padChar[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"pad_len\", padLen[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"init_cap\", initCap[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"mask_xml\", maskXML[i] );","sourceCodeStart":474,"sourceCodeEnd":510,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/stringoperations/StringOperationsMeta.java#L474-L510","documentation":"KettleException thrown by StringOperationsMeta.readRep when an unexpected exception occurs while reading the String Operations step's configuration from a Pentaho repository. readRep loads per-field settings (trim, mask, digits, remove_special_characters, etc.) via rep.getStepAttributeString; any repository/IO failure inside the try block is wrapped with this localized message and rethrown. It is a generic wrapper, so the root cause is always the chained exception.","triggerScenarios":"Calling readRep (e.g., during transformation load from a repository) when the repository connection drops, the step attributes are corrupt/missing, or the repository API throws on getStepAttributeString for attributes like mask_xml, digits, or remove_special_characters.","commonSituations":"Network interruption or stale session while loading a transformation from an enterprise repository; a transformation saved by a different Kettle version with incompatible attribute layout; corrupt r_step_attribute rows in the repository database.","solutions":["Inspect the chained cause exception (getCause()) for the actual repository error and fix that first.","Verify repository connectivity: re-login, test the repository connection, and retry loading the transformation.","Re-save the transformation from Spoon so the step attributes are rewritten, or delete and re-add the String Operations step.","Check Kettle version compatibility between the client and the repository metadata (upgrade/migrate if versions differ)."],"exampleFix":"// before: generic wrapper hides root cause\ncatch ( Exception e ) {\n  throw new KettleException( BaseMessages.getString( PKG, \"StringOperationsMeta.Exception.UnexpectedErrorInReadingStepInfo\" ), e );\n}\n// after (caller side): log the real cause\ncatch ( KettleException e ) {\n  logError( \"Failed loading StringOperations step: \" + e.getCause(), e );\n  throw e;\n}","handlingStrategy":"try-catch","validationCode":"// before load: verify repository is reachable\nif ( repository == null || !repository.isConnected() ) throw new IllegalStateException( \"Repository not connected\" );","typeGuard":null,"tryCatchPattern":"try { stepMeta.readRep( rep, metaStore, idStep, databases ); } catch ( KettleException e ) { log.error( \"readRep failed: \" + e.getCause(), e ); throw e; }","preventionTips":["Keep repository sessions alive; reconnect before long metadata operations.","Avoid hand-editing repository attribute tables.","Pin matching PDI client/server versions.","Test repository connectivity in CI before loading transformations."],"tags":["kettle","repository","metadata-load","pdi"],"backgroundTag":"file-read-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"}