{"record":{"id":"7ef5f1b4fcad97fe","repo":"pentaho/pentaho-kettle","slug":"dynamicsqlrowmeta-exception-unexpectederrorreadingstepinfo","errorCode":null,"errorMessage":"DynamicSQLRowMeta.Exception.UnexpectedErrorReadingStepInfo","messagePattern":"DynamicSQLRowMeta\\.Exception\\.UnexpectedErrorReadingStepInfo","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/dynamicsqlrow/DynamicSQLRowMeta.java","lineNumber":289,"sourceCode":"    retval.append( \"    \" + XMLHandler.addTagValue( \"outer_join\", outerJoin ) );\n    retval.append( \"    \" + XMLHandler.addTagValue( \"replace_vars\", replacevars ) );\n    retval.append( \"    \" + XMLHandler.addTagValue( \"sql_fieldname\", sqlfieldname ) );\n    retval.append( \"    \" + XMLHandler.addTagValue( \"query_only_on_change\", queryonlyonchange ) );\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      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      sqlfieldname = rep.getStepAttributeString( id_step, \"sql_fieldname\" );\n      queryonlyonchange = rep.getStepAttributeBoolean( id_step, \"query_only_on_change\" );\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"DynamicSQLRowMeta.Exception.UnexpectedErrorReadingStepInfo\" ), e );\n    }\n  }\n\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      rep.saveStepAttribute( id_transformation, id_step, \"sql_fieldname\", sqlfieldname );\n      rep.saveStepAttribute( id_transformation, id_step, \"query_only_on_change\", queryonlyonchange );\n\n      // Also, save the step-database relationship!\n      if ( databaseMeta != null ) {\n        rep.insertStepDatabase( id_transformation, id_step, databaseMeta.getObjectId() );\n      }","sourceCodeStart":271,"sourceCodeEnd":307,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/dynamicsqlrow/DynamicSQLRowMeta.java#L271-L307","documentation":"Kettle wraps any exception thrown while loading the Dynamic SQL Row step's settings from a repository into this KettleException. It indicates the step metadata (sql, outer_join, replace_vars, sql_fieldname, query_only_on_change attributes) could not be read from the repository database; the original cause is attached.","triggerScenarios":"Repository.readRep path: TransMeta loads a transformation containing a DynamicSQLRow step and rep.getStepAttributeString/getStepAttributeBoolean throws (repository connection failure, missing/corrupt step row, incompatible repository schema).","commonSituations":"Repository DB temporarily unreachable or dropped mid-load; transformation saved by a newer Pentaho version with attributes the current repository schema cannot serve; corrupted r_step_attribute rows; permission issues reading the repository tables.","solutions":["Check the underlying cause exception in the stack trace for the real repository error (connectivity, permissions, missing row).","Verify the repository database is reachable and the user can read step attribute tables.","Reopen/re-save the transformation; if the step XML/rows are corrupt, recreate the DynamicSQLRow step.","Align Pentaho/Kettle versions between the tool that saved the transformation and the one loading it."],"exampleFix":"// before: loading with a stale/broken repository connection\nTransMeta meta = new TransMeta(repo, \"trans.ktr\");\n// after: validate repository connectivity and handle the load error\nif (!repo.isConnected()) { repo.connect(); }\ntry {\n  TransMeta meta = new TransMeta(repo, \"trans.ktr\");\n} catch (KettleException e) {\n  logError(\"Failed to read DynamicSQLRow step info\", e);\n}","handlingStrategy":"try-catch","validationCode":"// before loading\nif (!repo.isConnected()) { repo.connect(); }\nif (repo.getObjectId(new TransMeta()) == null) { /* repository unreadable */ }","typeGuard":null,"tryCatchPattern":"try { TransMeta tm = new TransMeta(repo, path); } catch (KettleException e) { log.error(\"Step info read failed\", e.getCause()); }","preventionTips":["Verify repository connectivity before loading transformations","Keep Pentaho versions consistent across save/load environments","Back up the repository database"],"tags":["kettle","repository","metadata-load","step-configuration"],"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"}