apache/hadoop · error · IOException

realuser is too long to be serialized!

Error message

realuser is too long to be serialized!

What it means

Serialization guard in AbstractDelegationTokenIdentifier.write: the realUser Text exceeds Text.DEFAULT_MAX_LEN, so writing it with the fixed-length Writable encoding would overflow and the write is aborted before producing a corrupt identifier.

Solutions

  1. Shorten the real user name: for proxy-user tokens the realUser field exceeds the maximum serializable length. Use a shorter user name for the proxied identity.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenIdentifier.java:226 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/993470916d08c39c. Report an issue: GitHub.

Appendix: source

Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenIdentifier.java:226

    owner.write(out);
    renewer.write(out);
    realUser.write(out);
    WritableUtils.writeVLong(out, issueDate);
    WritableUtils.writeVLong(out, maxDate);
    WritableUtils.writeVInt(out, sequenceNumber);
    WritableUtils.writeVInt(out, masterKeyId);
  }
  
  @Override
  public void write(DataOutput out) throws IOException {
    if (owner.getLength() > Text.DEFAULT_MAX_LEN) {
      throw new IOException("owner is too long to be serialized!");
    }
    if (renewer.getLength() > Text.DEFAULT_MAX_LEN) {
      throw new IOException("renewer is too long to be serialized!");
    }
    if (realUser.getLength() > Text.DEFAULT_MAX_LEN) {
      throw new IOException("realuser is too long to be serialized!");
    }
    writeImpl(out);
  }
  
  @Override
  public String toString() {
    StringBuilder buffer = new StringBuilder();
    buffer
        .append(getKind())
        .append(" owner=").append(owner)
        .append(", renewer=").append(renewer)
        .append(", realUser=").append(realUser)
        .append(", issueDate=").append(issueDate)
        .append(", maxDate=").append(maxDate)
        .append(", sequenceNumber=").append(sequenceNumber)
        .append(", masterKeyId=").append(masterKeyId);
    return buffer.toString();
  }

View on GitHub (pinned to 2add963021)