apache/hadoop · error · HadoopIllegalArgumentException

The XAttr is too big. The maximum combined size of the name

Error message

The XAttr is too big. The maximum combined size of the name and value is <xattrMaxSize>, but the total size is <size>

What it means

Error "The XAttr is too big. The maximum combined size of the name and value is <xattrMaxSize>, but the total size is <size>" thrown in apache/hadoop.

Source

Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirXAttrOp.java:441

          fsd.checkOwner(pc, iip);
        }
      } else {
        fsd.checkPathAccess(pc, iip, FsAction.WRITE);
      }
    }
  }

  /**
   * Verifies that the combined size of the name and value of an xattr is within
   * the configured limit. Setting a limit of zero disables this check.
   */
  private static void checkXAttrSize(FSDirectory fsd, XAttr xAttr) {
    int size = DFSUtil.string2Bytes(xAttr.getName()).length;
    if (xAttr.getValue() != null) {
      size += xAttr.getValue().length;
    }
    if (size > fsd.getXattrMaxSize()) {
      throw new HadoopIllegalArgumentException(
          "The XAttr is too big. The maximum combined size of the"
          + " name and value is " + fsd.getXattrMaxSize()
          + ", but the total size is " + size);
    }
  }

  private static void checkXAttrsConfigFlag(FSDirectory fsd) throws
                                                             IOException {
    if (!fsd.isXattrsEnabled()) {
      throw new IOException(String.format(
          "The XAttr operation has been rejected.  "
              + "Support for XAttrs has been disabled by setting %s to false.",
          DFSConfigKeys.DFS_NAMENODE_XATTRS_ENABLED_KEY));
    }
  }

  private static List<XAttr> getXAttrs(FSDirectory fsd, INodesInPath iip)
      throws IOException {

View on GitHub (pinned to 2add963021)

Solutions

  1. Reduce the combined size of the XAttr name and value below dfs.namenode.fs-limits.max-xattr-size (default 16KB).
  2. Store large data in a file and keep only a reference in the XAttr.

When it happens

Trigger: Setting an XAttr whose combined name plus value size exceeds the configured limit (dfs.namenode.fs-limits.max-xattr-size).

Common situations: See trigger scenarios.


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