{"record":{"id":"917a138c3e4adb1d","repo":"apache/hadoop","slug":"cannot-add-additional-xattr-to-inode-would-exceed","errorCode":null,"errorMessage":"Cannot add additional XAttr to inode, would exceed limit of <inodeXAttrsLimit>","messagePattern":"Cannot add additional XAttr to inode, would exceed limit of <inodeXAttrsLimit>","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirXAttrOp.java","lineNumber":384,"sourceCode":"      for (XAttr existing : existingXAttrs) {\n        boolean alreadySet = false;\n        for (XAttr set : toSet) {\n          if (set.equalsIgnoreValue(existing)) {\n            alreadySet = true;\n            break;\n          }\n        }\n        if (!alreadySet) {\n          xAttrs.add(existing);\n          if (isUserVisible(existing)) {\n            userVisibleXAttrsNum++;\n          }\n        }\n      }\n    }\n\n    if (userVisibleXAttrsNum > fsd.getInodeXAttrsLimit()) {\n      throw new IOException(\"Cannot add additional XAttr to inode, \"\n          + \"would exceed limit of \" + fsd.getInodeXAttrsLimit());\n    }\n\n    return xAttrs;\n  }\n\n  static XAttr getXAttrByPrefixedName(FSDirectory fsd, INodesInPath iip,\n      String prefixedName) throws IOException {\n    fsd.readLock();\n    try {\n      return XAttrStorage.readINodeXAttrByPrefixedName(iip.getLastINode(),\n          iip.getPathSnapshotId(), prefixedName);\n    } finally {\n      fsd.readUnlock();\n    }\n  }\n\n  static XAttr unprotectedGetXAttrByPrefixedName(","sourceCodeStart":366,"sourceCodeEnd":402,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirXAttrOp.java#L366-L402","documentation":"Error \"Cannot add additional XAttr to inode, would exceed limit of <inodeXAttrsLimit>\" thrown in apache/hadoop.","triggerScenarios":"Setting XAttrs on an inode that already holds the configured maximum number of XAttrs (dfs.namenode.fs-limits.max-xattrs-per-inode).","commonSituations":"See trigger scenarios.","solutions":["Remove existing XAttrs before adding new ones.","Raise dfs.namenode.fs-limits.max-xattrs-per-inode if more attributes per inode are legitimately needed."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}