{"record":{"id":"0ce40d5be331f8ad","repo":"pentaho/pentaho-kettle","slug":"execsqlmeta-exception-unexpectederrorreadingstepinfo","errorCode":"ExecSQLMeta.Exception.UnexpectedErrorReadingStepInfo","errorMessage":"ExecSQLMeta.Exception.UnexpectedErrorReadingStepInfo","messagePattern":"ExecSQLMeta\\.Exception\\.UnexpectedErrorReadingStepInfo","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/sql/ExecSQLMeta.java","lineNumber":349,"sourceCode":"      executedEachInputRow = rep.getStepAttributeBoolean( id_step, \"execute_each_row\" );\n      singleStatement = rep.getStepAttributeBoolean( id_step, \"single_statement\" );\n      replaceVariables = rep.getStepAttributeBoolean( id_step, \"replace_variables\" );\n      quoteString = rep.getStepAttributeBoolean( id_step, \"quoteString\" );\n      sql = rep.getStepAttributeString( id_step, \"sql\" );\n      setParams = rep.getStepAttributeBoolean( id_step, \"set_params\" );\n      insertField = rep.getStepAttributeString( id_step, \"insert_field\" );\n      updateField = rep.getStepAttributeString( id_step, \"update_field\" );\n      deleteField = rep.getStepAttributeString( id_step, \"delete_field\" );\n      readField = rep.getStepAttributeString( id_step, \"read_field\" );\n\n      int nrargs = rep.countNrStepAttributes( id_step, \"arg_name\" );\n      allocate( nrargs );\n\n      for ( int i = 0; i < nrargs; i++ ) {\n        arguments[i] = rep.getStepAttributeString( id_step, i, \"arg_name\" );\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"ExecSQLMeta.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, \"sql\", sql );\n      rep.saveStepAttribute( id_transformation, id_step, \"execute_each_row\", executedEachInputRow );\n      rep.saveStepAttribute( id_transformation, id_step, \"single_statement\", singleStatement );\n      rep.saveStepAttribute( id_transformation, id_step, \"replace_variables\", replaceVariables );\n      rep.saveStepAttribute( id_transformation, id_step, \"quoteString\", quoteString );\n      rep.saveStepAttribute( id_transformation, id_step, \"set_params\", setParams );\n      rep.saveStepAttribute( id_transformation, id_step, \"insert_field\", insertField );\n      rep.saveStepAttribute( id_transformation, id_step, \"update_field\", updateField );\n      rep.saveStepAttribute( id_transformation, id_step, \"delete_field\", deleteField );\n      rep.saveStepAttribute( id_transformation, id_step, \"read_field\", readField );\n","sourceCodeStart":331,"sourceCodeEnd":367,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/sql/ExecSQLMeta.java#L331-L367","documentation":"Thrown by ExecSQLMeta.readRep when reading the step's configuration from the repository fails. It reads attributes such as sql, connection, and the arg_name entries per argument index; any repository exception is wrapped in a KettleException with this message key. The transformation cannot be loaded from the repository when this fires.","triggerScenarios":"Loading an ExecSQL step from a repository where getStepAttributeString/getStepAttributeInteger throws: repository DB unavailable, R_STEP_ATTRIBUTE rows corrupted or deleted, or count mismatch between saved nrargs and stored argument rows.","commonSituations":"Repository schema drift after PDI upgrade; DB connection dropped during load; another user deleted/modified the transformation mid-load; corrupted repository rows from a failed prior save.","solutions":["Check the wrapped cause for the repository database error","Reconnect to the repository and retry loading the transformation","Upgrade/repair the repository schema to match your PDI version","Re-save the transformation from a local .ktr backup to rewrite its repository rows"],"exampleFix":"// before\ntransMeta.loadTransMeta(rep, id_transformation, metaStore);\n// after\ntry {\n  transMeta.loadTransMeta(rep, id_transformation, metaStore);\n} catch (KettleException e) {\n  logError(\"Repository read failed: \" + e.getCause());\n  transMeta.loadXml(\"local-copy.ktr\"); // load from file instead\n}","handlingStrategy":"try-catch","validationCode":"// before load\nif (!rep.isConnected()) rep.connect();\nif (rep.getTransformationID(name, directory) == null) throw new IllegalStateException(\"Transformation missing in repository\");","typeGuard":null,"tryCatchPattern":"try { transMeta.loadTransMeta(rep, id, metaStore); } catch (KettleException e) { logError(\"Repository read failed: \" + e.getCause()); transMeta.loadXml(\"fallback.ktr\"); }","preventionTips":["Upgrade the repository schema with each PDI upgrade","Keep file-based backups of repository transformations","Avoid concurrent load/modify of the same transformation","Watch repository DB health before scheduled loads"],"tags":["repository","deserialization","kettle"],"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"}