{"record":{"id":"229be81153898a19","repo":"pentaho/pentaho-kettle","slug":"tableexistsmeta-exception-unexpectederrorreadingstepinfo","errorCode":null,"errorMessage":"TableExistsMeta.Exception.UnexpectedErrorReadingStepInfo","messagePattern":"TableExistsMeta\\.Exception\\.UnexpectedErrorReadingStepInfo","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/tableexists/TableExistsMeta.java","lineNumber":179,"sourceCode":"      tablenamefield = XMLHandler.getTagValue( stepnode, \"tablenamefield\" );\n      resultfieldname = XMLHandler.getTagValue( stepnode, \"resultfieldname\" );\n      schemaname = XMLHandler.getTagValue( stepnode, \"schemaname\" );\n\n    } catch ( Exception e ) {\n      throw new KettleXMLException(\n        BaseMessages.getString( PKG, \"TableExistsMeta.Exception.UnableToReadStepInfo\" ), e );\n    }\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      tablenamefield = rep.getStepAttributeString( id_step, \"tablenamefield\" );\n      schemaname = rep.getStepAttributeString( id_step, \"schemaname\" );\n\n      resultfieldname = rep.getStepAttributeString( id_step, \"resultfieldname\" );\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"TableExistsMeta.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, \"tablenamefield\", tablenamefield );\n      rep.saveStepAttribute( id_transformation, id_step, \"schemaname\", schemaname );\n\n      rep.saveStepAttribute( id_transformation, id_step, \"resultfieldname\", resultfieldname );\n\n      // Also, save the step-database relationship!\n      if ( databaseMeta != null ) {\n        rep.insertStepDatabase( id_transformation, id_step, databaseMeta.getObjectId() );\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"TableExistsMeta.Exception.UnableToSaveStepInfo\" )","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/tableexists/TableExistsMeta.java#L161-L197","documentation":"TableExistsMeta.readRep wraps any exception raised while loading this step's attributes from the Pentaho Repository into a KettleException. Like its TableCompare counterpart, it indicates the step's settings could not be read from the repository, with the real cause chained.","triggerScenarios":"Calling readRep when loadDatabaseMetaFromStepAttribute or any rep.getStepAttributeString for id_step throws — repository I/O error, missing step row, or connection lookup failure.","commonSituations":"Database-repository outages during transformation load; R_STEP_ATTRIBUTE rows missing for the step; database metadata referenced by id_connection deleted from R_DATABASE; version-mismatched repository schema.","solutions":["Check the chained cause for the true repository error","Verify repository connectivity and re-load the transformation","Confirm the referenced database connection still exists in the repository","Restore missing repository rows from backup or re-save the step"],"exampleFix":"// before\ntry { meta.readRep(rep, metaStore, idStep, databases); } catch (KettleException e) { e.printStackTrace(); }\n// after\ntry { meta.readRep(rep, metaStore, idStep, databases); }\ncatch (KettleException e) { logError(\"Cause: \" + e.getCause(), e); }","handlingStrategy":"try-catch","validationCode":"// ensure repository reachable and step exists before readRep\nif (!rep.isConnected()) { rep.connect(user, pass); }\nObjectId idStep = rep.getStepID(idTransformation, \"TableExists\", 0);\nif (idStep == null) { throw new IllegalStateException(\"TableExists step not found in repository\"); }","typeGuard":null,"tryCatchPattern":"try { meta.readRep(rep, metaStore, idStep, databases); }\ncatch (KettleException e) {\n  Throwable root = e; while (root.getCause() != null) root = root.getCause();\n  logError(\"Repository read failed: \" + root.getMessage(), e);\n}","preventionTips":["Keep database connections in the repository intact — do not delete ones in use","Back up repository tables before schema upgrades","Retry loads after transient repository outages"],"tags":["kettle","repository","persistence","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"}