pentaho/pentaho-kettle · error · KettleException

Unable to parse attribute from attribute row: attributeRow

Error message

Unable to parse attribute from attribute row: attributeRow

What it means

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.

Solutions

  1. Inspect the row (from the wrapped cause) and fix or delete the corrupt R_ELEMENT_ATTRIBUTE row
  2. Re-save the metastore element to rewrite its attributes cleanly
  3. Check schema compatibility between the repository version that wrote the row and the one reading it
  4. Wrap metastore reads to log the failing attribute id and skip/repair it

Example fix

// before: blind parse
KDBRMetaStoreAttribute a = delegate.attribute(nsId, elId, row);
// after: validate row first
if (row == null || row.getString("ID_ELEMENT_ATTRIBUTE", null) == null) {
  throw new IllegalStateException("Skipping corrupt attribute row for element " + elId);
}
KDBRMetaStoreAttribute a = delegate.attribute(nsId, elId, row);
Defensive patterns

Strategy: validation

Validate before calling

if (attributeRow == null || attributeRow.getInteger("ID_ELEMENT_ATTRIBUTE", -1) < 0 || attributeRow.getString("ID_ELEMENT_ATTRIBUTE_KEY", null) == null) {
  throw new IllegalArgumentException("Malformed R_ELEMENT_ATTRIBUTE row");
}

Type guard

boolean isValidAttributeRow(RowMetaAndData row) { return row != null && row.getInteger("ID_ELEMENT_ATTRIBUTE", -1L) >= 0; }

Try / catch

try { KDBRMetaStoreAttribute a = delegate.attribute(nsId, elId, row); } catch (KettleException e) { logWarn("Skipping corrupt attribute row", e); }

Prevention

When it happens

Trigger: Calling attribute(namespaceId, elementId, attributeRow) with a row whose ID_ELEMENT_ATTRIBUTE/id/key/value columns are null or whose value fails parseAttributeValue.

Common situations: 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.

Understand the failure class

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/69e7404d9f85ccab. Report an issue: GitHub.

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryMetaStoreDelegate.java:346

      // See if this attribute has children...
      addAttributes( attribute, elementId, attribute.getObjectId() );
    }
  }

  private KDBRMetaStoreAttribute parseAttribute( ObjectId elementId, RowMetaAndData attributeRow ) throws KettleException {
    try {
      Long attributeId =
        attributeRow.getInteger( KettleDatabaseRepository.FIELD_ELEMENT_ATTRIBUTE_ID_ELEMENT_ATTRIBUTE );
      String key = attributeRow.getString( KettleDatabaseRepository.FIELD_ELEMENT_ATTRIBUTE_KEY, null );
      String value = attributeRow.getString( KettleDatabaseRepository.FIELD_ELEMENT_ATTRIBUTE_VALUE, null );

      Object object = parseAttributeValue( value );

      KDBRMetaStoreAttribute attribute = new KDBRMetaStoreAttribute( this, key, object );
      attribute.setObjectId( new LongObjectId( attributeId ) );
      return attribute;
    } catch ( Exception e ) {
      throw new KettleException( "Unable to parse attribute from attribute row: " + attributeRow.toString(), e );
    }

  }

  /**
   * supported types:
   * <p/>
   * <pre>
   * S : String (java.lang.String)
   * D : Date (java.util.Date)
   * N : Number (Double)
   * I : Integer (Long)
   * B : Boolean (Boolean)
   *
   * Examples
   * S:Pentaho Data Integration
   * D:2013/08/23 17:25:00
   * N:1039348.9347

View on GitHub (pinned to f3058517a1)