apache/hadoop · error · IllegalArgumentException

Invalid/unsupported encoding option specified:

Error message

Invalid/unsupported encoding option specified: 

What it means

Error "Invalid/unsupported encoding option specified: " thrown in apache/hadoop.

Source

Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/XAttrCommands.java:78

      "Valid encodings are \"text\", \"hex\", and \"base64\". " +
      "Values encoded as text strings are enclosed in double quotes (\")," +
      " and values encoded as hexadecimal and base64 are prefixed with " +
      "0x and 0s, respectively.\n" +
      "<path>: The file or directory.\n";

    private String name = null;
    private boolean dump = false;
    private XAttrCodec encoding = XAttrCodec.TEXT;

    @Override
    protected void processOptions(LinkedList<String> args) throws IOException {
      name = StringUtils.popOptionWithArgument("-n", args);
      String en = StringUtils.popOptionWithArgument("-e", args);
      if (en != null) {
        try {
          encoding = XAttrCodec.valueOf(StringUtils.toUpperCase(en));
        } catch (IllegalArgumentException e) {
          throw new IllegalArgumentException(
              "Invalid/unsupported encoding option specified: " + en);
        }
        Preconditions.checkArgument(encoding != null,
            "Invalid/unsupported encoding option specified: " + en);
      }

      boolean r = StringUtils.popOption("-R", args);
      setRecursive(r);
      dump = StringUtils.popOption("-d", args);

      if (!dump && name == null) {
        throw new HadoopIllegalArgumentException(
            "Must specify '-n name' or '-d' option.");
      }

      if (args.isEmpty()) {
        throw new HadoopIllegalArgumentException("<path> is missing.");
      }

View on GitHub (pinned to 2add963021)

Solutions

  1. Use a supported -e encoding option: 'text', 'hex', or 'base64'.
  2. Fix the encoding option passed to setfattr/getfattr.

When it happens

Trigger: Thrown by getfattr/setfattr shell commands when the -e encoding option is not one of the supported values (text, hex, base64).

Common situations: See trigger scenarios.


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