{"record":{"id":"ac6edd60001b864f","repo":"apache/hadoop","slug":"is-not-supported","errorCode":null,"errorMessage":"{}  is not supported","messagePattern":"(.+?)  is not supported","errorType":"http","errorClass":"UnsupportedOperationException","httpStatus":400,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/web/resources/NamenodeWebHdfsMethods.java","lineNumber":973,"sourceCode":"      cp.disableErasureCodingPolicy(ecpolicy.getValue());\n      return Response.ok().type(MediaType.APPLICATION_OCTET_STREAM).build();\n    case SETECPOLICY:\n      validateOpParams(op, ecpolicy);\n      cp.setErasureCodingPolicy(fullpath, ecpolicy.getValue());\n      return Response.ok().type(MediaType.APPLICATION_OCTET_STREAM).build();\n    case SETQUOTA:\n      validateOpParams(op, namespaceQuota, storagespaceQuota);\n      cp.setQuota(fullpath, namespaceQuota.getValue(),\n          storagespaceQuota.getValue(), null);\n      return Response.ok().type(MediaType.APPLICATION_OCTET_STREAM).build();\n    case SETQUOTABYSTORAGETYPE:\n      validateOpParams(op, storagespaceQuota, storageType);\n      cp.setQuota(fullpath, HdfsConstants.QUOTA_DONT_SET,\n          storagespaceQuota.getValue(),\n          StorageType.parseStorageType(storageType.getValue()));\n      return Response.ok().type(MediaType.APPLICATION_OCTET_STREAM).build();\n    default:\n      throw new UnsupportedOperationException(op + \"  is not supported\");\n    }\n  }\n\n  /**\n   * Handle HTTP POST request for the root.\n   *\n   * @param ugi User and group information for Hadoop.\n   * @param delegation Represents delegation token used for authentication.\n   * @param username User parameter.\n   * @param doAsUser DoAs parameter for proxy user.\n   * @param op Http POST operation parameter.\n   * @param concatSrcs The concat source paths parameter.\n   * @param bufferSize Buffer size parameter.\n   * @param excludeDatanodes Exclude datanodes param.\n   * @param newLength NewLength parameter.\n   * @param noredirect Overwrite parameter.\n   * @return Represents an HTTP response.\n   * @throws IOException any IOE raised, or translated exception.","sourceCodeStart":955,"sourceCodeEnd":991,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/web/resources/NamenodeWebHdfsMethods.java#L955-L991","documentation":"Default branch of the PUT-typed WebHDFS switch on the NameNode (put(), which serves CREATE, MKDIRS, RENAME, SETOWNER, SETSTORAGEPOLICY, SETQUOTA, ALLOWSNAPSHOT, etc.). The op query parameter parsed to a valid Op constant, but that operation is served by another HTTP verb (GET, POST, or DELETE), so the switch falls through to UnsupportedOperationException('<OP>  is not supported') — note the doubled space comes from the string concatenation in the source. The client sees an HTTP 400 RemoteException.","triggerScenarios":"Issuing a WebHDFS operation with the wrong verb: curl -X PUT '...?op=GETFILESTATUS' (GET-only), curl -X PUT '...?op=DELETE' (DELETE-only), or curl -X PUT '...?op=CONCAT' (POST-only). Also clients that hardcode one verb for all operations and HTTP gateways that rewrite methods.","commonSituations":"REST clients generated from a template that fixes the verb; scripts written against older WebHDFS docs where an op moved between methods; curl muscle-memory using -X PUT for every state change; proxies converting verbs (POST-to-PUT rewrites).","solutions":["Check the op in the WebHDFS REST API documentation table and use the HTTP method it lists (GETFILESTATUS->GET, DELETE->DELETE, SETSTORAGEPOLICY->PUT)","Fix the client to select the verb from an op-to-method map instead of hardcoding it","Reproduce with curl using the documented verb to confirm the cluster is fine","If a gateway sits in the path, verify it forwards the original method unchanged"],"exampleFix":"# before: GET-only op sent as PUT\ncurl -X PUT \"http://nn:9870/webhdfs/v1/data/f?op=GETFILESTATUS\"\n# 400 ... UnsupportedOperationException: GETFILESTATUS  is not supported\n\n# after\ncurl \"http://nn:9870/webhdfs/v1/data/f?op=GETFILESTATUS\"","handlingStrategy":"validation","validationCode":"private static final Map<String, String> OP_TO_VERB = Map.of(\n    \"GETFILESTATUS\", \"GET\", \"LISTSTATUS\", \"GET\", \"OPEN\", \"GET\",\n    \"MKDIRS\", \"PUT\", \"SETSTORAGEPOLICY\", \"PUT\", \"RENAME\", \"PUT\",\n    \"CONCAT\", \"POST\", \"UNSETSTORAGEPOLICY\", \"POST\",\n    \"DELETE\", \"DELETE\", \"DELETESNAPSHOT\", \"DELETE\");\n\nstatic String verbFor(String op) {\n  String verb = OP_TO_VERB.get(op.toUpperCase(Locale.ROOT));\n  if (verb == null) throw new IllegalArgumentException(\"unknown WebHDFS op: \" + op);\n  return verb;\n}","typeGuard":"static final Set<String> PUT_OPS = Set.of(\"CREATE\", \"MKDIRS\", \"RENAME\", \"SETREPLICATION\",\n    \"SETOWNER\", \"SETPERMISSION\", \"SETTIMES\", \"SETSTORAGEPOLICY\", \"SETQUOTA\", \"SETQUOTABYSTORAGETYPE\");\nstatic boolean isPutOp(String op) {\n  return PUT_OPS.contains(op.toUpperCase(Locale.ROOT));\n}","tryCatchPattern":"catch (IOException e) { // RemoteException: java.lang.UnsupportedOperationException\n  if (e.getMessage() != null && e.getMessage().endsWith(\"is not supported\")) {\n    // op/verb mismatch: re-dispatch with the verb from the op-to-method table\n  } else throw e;\n}","preventionTips":["Drive HTTP verb selection from a per-op table, never hardcode one verb","Keep the table beside a contract test that exercises one op per verb against a mini-cluster","Confirm gateways in the path forward methods unchanged"],"tags":["webhdfs","hdfs","rest-api","http-method","unsupported-operation","put"],"backgroundTag":"http-method-mismatch","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}