apache/hadoop · error · IllegalArgumentException

bad framework group id: ${id}

Error message

bad framework group id: ${id}

What it means

CounterGroupFactory assigns each framework counter group (CPU, MEMORY, GC, SHUFFLE... plus the filesystem group) a small integer id for compact serialization. newFrameworkGroup(int) - invoked from AbstractCounters.readFields when a FRAMEWORK group is decoded - throws IllegalArgumentException via throwBadFrameGroupIdException when the id has no registered group, i.e. the ordinal is out of range of the factory's registry.

Source

Thrown at hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/counters/CounterGroupFactory.java:162

   * @return the counter factory version
   */
  public int version() {
    return VERSION;
  }

  /**
   * Check whether a group name is a name of a framework group (including
   * the filesystem group).
   *
   * @param name  to check
   * @return true for framework group names
   */
  public static synchronized boolean isFrameworkGroup(String name) {
    return s2i.get(name) != null || name.equals(FS_GROUP_NAME);
  }

  private static void throwBadFrameGroupIdException(int id) {
    throw new IllegalArgumentException("bad framework group id: "+ id);
  }

  private static void throwBadFrameworkGroupNameException(String name) {
    throw new IllegalArgumentException("bad framework group name: "+ name);
  }

  /**
   * Abstract factory method to create a generic (vs framework) counter group
   * @param name  of the group
   * @param displayName of the group
   * @param limits limits of the counters
   * @return a new generic counter group
   */
  protected abstract G newGenericGroup(String name, String displayName,
                                       Limits limits);

  /**
   * Abstract factory method to create a file system counter group

View on GitHub (pinned to 2add963021)

Solutions

  1. Run the producer and consumer on the same Hadoop build so the framework group id registry matches.
  2. Do not persist or replay Writable counters blobs across versions; read counters through versioned/stable interfaces (JHS REST, CLI).
  3. If you fork Hadoop and add framework groups, append them at the end of the registry so existing ids stay stable.
  4. Discard corrupted streams and rebuild counters from task completion events instead.
Defensive patterns

Strategy: try-catch

Try / catch

catch (IllegalArgumentException e) around counters deserialization: check for "bad framework group id", treat the stream as unreadable, replace with fresh Counters, and record which producer wrote it for version investigation.

Prevention

When it happens

Trigger: Deserializing counters where the framework-group id VInt does not map to any known group: version skew where writer and reader have different framework group registries, a stream written by a fork that added framework groups, or byte-level corruption/misalignment that decodes to a bogus id.

Common situations: Counters exchanged over RPC between mixed-version Hadoop nodes during a rolling upgrade; replaying serialized counters captured on a different build; reading counters streams that were truncated or offset.

Related errors


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