{"record":{"id":"2dbdafae3a23cfb2","repo":"pentaho/pentaho-kettle","slug":"databasejoinmeta-exception-unexpectederrorreadingstepinfo","errorCode":null,"errorMessage":"DatabaseJoinMeta.Exception.UnexpectedErrorReadingStepInfo","messagePattern":"DatabaseJoinMeta\\.Exception\\.UnexpectedErrorReadingStepInfo","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/databasejoin/DatabaseJoinMeta.java","lineNumber":369,"sourceCode":"  public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException {\n    try {\n      databaseMeta = rep.loadDatabaseMetaFromStepAttribute( id_step, \"id_connection\", databases );\n      rowLimit = (int) rep.getStepAttributeInteger( id_step, \"rowlimit\" );\n      sql = rep.getStepAttributeString( id_step, \"sql\" );\n      outerJoin = rep.getStepAttributeBoolean( id_step, \"outer_join\" );\n      replacevars = rep.getStepAttributeBoolean( id_step, \"replace_vars\" );\n\n      int nrparam = rep.countNrStepAttributes( id_step, \"parameter_field\" );\n\n      allocate( nrparam );\n\n      for ( int i = 0; i < nrparam; i++ ) {\n        parameterField[i] = rep.getStepAttributeString( id_step, i, \"parameter_field\" );\n        String stype = rep.getStepAttributeString( id_step, i, \"parameter_type\" );\n        parameterType[i] = ValueMetaFactory.getIdForValueMeta( stype );\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"DatabaseJoinMeta.Exception.UnexpectedErrorReadingStepInfo\" ), 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      rep.saveDatabaseMetaStepAttribute( id_transformation, id_step, \"id_connection\", databaseMeta );\n      rep.saveStepAttribute( id_transformation, id_step, \"rowlimit\", rowLimit );\n      rep.saveStepAttribute( id_transformation, id_step, \"sql\", sql );\n      rep.saveStepAttribute( id_transformation, id_step, \"outer_join\", outerJoin );\n      rep.saveStepAttribute( id_transformation, id_step, \"replace_vars\", replacevars );\n\n      for ( int i = 0; i < parameterField.length; i++ ) {\n        rep.saveStepAttribute( id_transformation, id_step, i, \"parameter_field\", parameterField[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"parameter_type\", ValueMetaFactory\n            .getValueMetaName( parameterType[i] ) );\n      }","sourceCodeStart":351,"sourceCodeEnd":387,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/databasejoin/DatabaseJoinMeta.java#L351-L387","documentation":"DatabaseJoinMeta.readRep() wraps any exception thrown while reading this step's attributes (sql field, parameters, parameter fields/types, outer join flag) from a Kettle repository into a KettleException with message 'Unexpected error reading step info'. The library throws it because repository attribute access can fail in many opaque ways (repo down, missing step id, corrupt attributes) and it wants to preserve the cause chain.","triggerScenarios":"Calling readRep() (directly or via transformation deserialization from a repository) when Repository.getStepAttributeString/getStepAttributeInteger throws — e.g. id_step does not exist, the repository connection is broken, or ValueMetaFactory.getIdForValueMeta fails on an unknown stored 'parameter_type' string.","commonSituations":"Loading a transformation whose DatabaseJoin step was saved by a newer/older Kettle version with an unrecognized type name; a stale or dropped repository row; repository server temporarily unreachable.","solutions":["Check the cause (e) attached to the KettleException — it names the real repository or ValueMetaFactory failure","Verify the repository connection and that the transformation/step ObjectIds exist in the repository","Confirm the 'parameter_type' attribute values stored for the step are valid Kettle value-type names","Re-save the transformation from the designer to rewrite the step attributes"],"exampleFix":"// before\nparameterType[i] = ValueMetaFactory.getIdForValueMeta( stype );\n// after\nInteger id = ValueMetaFactory.getIdForValueMeta( stype );\nif ( id == null || id < 0 ) {\n  logError( \"Unknown parameter_type '\" + stype + \"' for parameter \" + i + \", defaulting to String\" );\n  id = ValueMetaInterface.TYPE_STRING;\n}\nparameterType[i] = id;","handlingStrategy":"try-catch","validationCode":"// before loading from repository\nif ( rep == null || id_step == null ) throw new IllegalArgumentException( \"Repository and id_step are required\" );\n// check connectivity\nrep.connect();","typeGuard":"// verify stored type name parses before readRep paths consume it\nboolean isValidType( String stype ) {\n  try { return stype != null && ValueMetaFactory.getIdForValueMeta( stype ) != null; }\n  catch ( Exception e ) { return false; }\n}","tryCatchPattern":"try {\n  transMeta = TransMetaFactory.loadFromRepository( rep, transId );\n} catch ( KettleException e ) {\n  if ( e.getMessage() != null && e.getMessage().contains( \"reading step info\" ) ) {\n    logError( \"DatabaseJoin step attributes unreadable; cause=\" + e.getCause(), e );\n  } else { throw e; }\n}","preventionTips":["Always log/inspect e.getCause() — the wrapper message hides the real error","Keep Kettle client and repository schemas on compatible versions","Validate parameter_type attribute values when hand-editing repository content","Test transformation loads against a repo snapshot before production changes"],"tags":["kettle","repository","deserialization"],"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"}