{"record":{"id":"3330441263fb859b","repo":"pentaho/pentaho-kettle","slug":"sasinputmeta-exception","errorCode":"SASInputMeta.Exception.UnexpectedErrorReadingMetaDataFromRepository","errorMessage":"SASInputMeta.Exception.UnexpectedErrorReadingMetaDataFromRepository","messagePattern":"SASInputMeta\\.Exception\\.UnexpectedErrorReadingMetaDataFromRepository","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/sasinput/SasInputMeta.java","lineNumber":137,"sourceCode":"    for ( SasInputField field : outputFields ) {\n      retval.append( XMLHandler.openTag( XML_TAG_FIELD ) );\n      retval.append( field.getXML() );\n      retval.append( XMLHandler.closeTag( XML_TAG_FIELD ) );\n    }\n\n    return retval.toString();\n  }\n\n  public void readRep( Repository rep, IMetaStore metaStore, ObjectId stepId, List<DatabaseMeta> databases ) throws KettleException {\n    try {\n      acceptingField = rep.getStepAttributeString( stepId, \"accept_field\" );\n      outputFields = new ArrayList<SasInputField>();\n      int nrFields = rep.countNrStepAttributes( stepId, \"field_name\" );\n      for ( int i = 0; i < nrFields; i++ ) {\n        outputFields.add( new SasInputField( rep, stepId, i ) );\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"SASInputMeta.Exception.UnexpectedErrorReadingMetaDataFromRepository\" ), e );\n    }\n  }\n\n  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {\n    try {\n      rep.saveStepAttribute( id_transformation, id_step, \"accept_field\", acceptingField );\n      for ( int i = 0; i < outputFields.size(); i++ ) {\n        outputFields.get( i ).saveRep( rep, metaStore, id_transformation, id_step, i );\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"SASInputMeta.Exception.UnableToSaveMetaDataToRepository\" )\n        + id_step, e );\n    }\n  }\n\n  public void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta,","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/sasinput/SasInputMeta.java#L119-L155","documentation":"readRep loads SasInputMeta from a repository (instead of XML); if reading step attributes or constructing SasInputField entries fails, it wraps the exception in a KettleException with the localized message 'SASInputMeta.Exception.UnexpectedErrorReadingMetaDataFromRepository'.","triggerScenarios":"Exception thrown in readRep while querying repository step attributes (rep.countNrStepAttributes, attribute lookups) or building SasInputField(rep, stepId, i) — e.g. repository connection issues or missing attribute rows.","commonSituations":"Repository database unavailable or schema out of sync with the Pentaho version; step metadata partially deleted from the repository; plugin version mismatch where saved attribute keys changed; permission problems on repository tables.","solutions":["Check the chained cause for the repository failure (connection, SQL, missing rows).","Verify repository connectivity and that R_* tables exist and are up to date for the Pentaho version.","Reopen and re-save the step's metadata to repopulate attributes.","Recreate the step in the transformation if repository attributes are corrupt or missing."],"exampleFix":"// before: repository missing 'field_name' attribute rows for the step\n// after: open the step in Spoon, reselect fields, and save back to the repository","handlingStrategy":"try-catch","validationCode":"// Verify repository health before loading metadata\nif (!rep.isConnected()) throw new IllegalStateException(\"Repository not connected\");\nif (!rep.getSecurityProvider() != null && !stepExists(rep, stepId)) throw new IllegalStateException(\"Step attributes missing in repository\");","typeGuard":null,"tryCatchPattern":"try {\n  stepMeta.readRep(rep, metaStore, stepId, databases);\n} catch (KettleException e) {\n  if (e.getMessage().contains(\"UnexpectedErrorReadingMetaDataFromRepository\")) {\n    // check repository connectivity/schema, then recreate or re-save the step metadata\n  }\n  throw e;\n}","preventionTips":["Keep the repository schema migrated to the PDI version in use.","Test repository connectivity before running metadata-driven jobs.","Re-save steps after PDI upgrades so attribute rows match the current plugin's expectations."],"tags":["repository","metadata","kettle","database"],"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"}