{"record":{"id":"69e7404d9f85ccab","repo":"pentaho/pentaho-kettle","slug":"unable-to-parse-attribute-from-attribute-row-attributerow","errorCode":null,"errorMessage":"Unable to parse attribute from attribute row: attributeRow","messagePattern":"Unable to parse attribute from attribute row: attributeRow","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryMetaStoreDelegate.java","lineNumber":346,"sourceCode":"      // See if this attribute has children...\n      addAttributes( attribute, elementId, attribute.getObjectId() );\n    }\n  }\n\n  private KDBRMetaStoreAttribute parseAttribute( ObjectId elementId, RowMetaAndData attributeRow ) throws KettleException {\n    try {\n      Long attributeId =\n        attributeRow.getInteger( KettleDatabaseRepository.FIELD_ELEMENT_ATTRIBUTE_ID_ELEMENT_ATTRIBUTE );\n      String key = attributeRow.getString( KettleDatabaseRepository.FIELD_ELEMENT_ATTRIBUTE_KEY, null );\n      String value = attributeRow.getString( KettleDatabaseRepository.FIELD_ELEMENT_ATTRIBUTE_VALUE, null );\n\n      Object object = parseAttributeValue( value );\n\n      KDBRMetaStoreAttribute attribute = new KDBRMetaStoreAttribute( this, key, object );\n      attribute.setObjectId( new LongObjectId( attributeId ) );\n      return attribute;\n    } catch ( Exception e ) {\n      throw new KettleException( \"Unable to parse attribute from attribute row: \" + attributeRow.toString(), e );\n    }\n\n  }\n\n  /**\n   * supported types:\n   * <p/>\n   * <pre>\n   * S : String (java.lang.String)\n   * D : Date (java.util.Date)\n   * N : Number (Double)\n   * I : Integer (Long)\n   * B : Boolean (Boolean)\n   *\n   * Examples\n   * S:Pentaho Data Integration\n   * D:2013/08/23 17:25:00\n   * N:1039348.9347","sourceCodeStart":328,"sourceCodeEnd":364,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryMetaStoreDelegate.java#L328-L364","documentation":"parseAttribute could not convert a raw R_ELEMENT_ATTRIBUTE row into a KDBRMetaStoreAttribute (e.g. unreadable id, missing key, or parseAttributeValue failure); any Exception is wrapped in a KettleException naming the offending row.","triggerScenarios":"Calling attribute(namespaceId, elementId, attributeRow) with a row whose ID_ELEMENT_ATTRIBUTE/id/key/value columns are null or whose value fails parseAttributeValue.","commonSituations":"Metastore rows corrupted by manual edits or failed writes; schema changed between PDI versions so expected columns differ; value encoded by a newer type letter than this reader supports.","solutions":["Inspect the row (from the wrapped cause) and fix or delete the corrupt R_ELEMENT_ATTRIBUTE row","Re-save the metastore element to rewrite its attributes cleanly","Check schema compatibility between the repository version that wrote the row and the one reading it","Wrap metastore reads to log the failing attribute id and skip/repair it"],"exampleFix":"// before: blind parse\nKDBRMetaStoreAttribute a = delegate.attribute(nsId, elId, row);\n// after: validate row first\nif (row == null || row.getString(\"ID_ELEMENT_ATTRIBUTE\", null) == null) {\n  throw new IllegalStateException(\"Skipping corrupt attribute row for element \" + elId);\n}\nKDBRMetaStoreAttribute a = delegate.attribute(nsId, elId, row);","handlingStrategy":"validation","validationCode":"if (attributeRow == null || attributeRow.getInteger(\"ID_ELEMENT_ATTRIBUTE\", -1) < 0 || attributeRow.getString(\"ID_ELEMENT_ATTRIBUTE_KEY\", null) == null) {\n  throw new IllegalArgumentException(\"Malformed R_ELEMENT_ATTRIBUTE row\");\n}","typeGuard":"boolean isValidAttributeRow(RowMetaAndData row) { return row != null && row.getInteger(\"ID_ELEMENT_ATTRIBUTE\", -1L) >= 0; }","tryCatchPattern":"try { KDBRMetaStoreAttribute a = delegate.attribute(nsId, elId, row); } catch (KettleException e) { logWarn(\"Skipping corrupt attribute row\", e); }","preventionTips":["Never hand-edit metastore tables","Re-save elements through the metastore API after version upgrades","Log and quarantine rows that fail to parse"],"tags":["metastore","parse","attribute","corruption"],"backgroundTag":"unexpected-response-shape","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"}