{"record":{"id":"95f7f8d4116bb1e9","repo":"apache/hadoop","slug":"invalid-operation-op","errorCode":null,"errorMessage":"Invalid operation {op}","messagePattern":"Invalid operation (.+?)","errorType":"http","errorClass":"IllegalArgumentException","httpStatus":400,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/web/webhdfs/WebHdfsHandler.java","lineNumber":180,"sourceCode":"    String op = params.op();\n    HttpMethod method = req.method();\n    if (PutOpParam.Op.CREATE.name().equalsIgnoreCase(op)\n      && method == PUT) {\n      onCreate(ctx);\n    } else if (PostOpParam.Op.APPEND.name().equalsIgnoreCase(op)\n      && method == POST) {\n      onAppend(ctx);\n    } else if (GetOpParam.Op.OPEN.name().equalsIgnoreCase(op)\n      && method == GET) {\n      onOpen(ctx);\n    } else if(GetOpParam.Op.GETFILECHECKSUM.name().equalsIgnoreCase(op)\n      && method == GET) {\n      onGetFileChecksum(ctx);\n    } else if(PutOpParam.Op.CREATE.name().equalsIgnoreCase(op)\n        && method == OPTIONS) {\n      allowCORSOnCreate(ctx);\n    } else {\n      throw new IllegalArgumentException(\"Invalid operation \" + op);\n    }\n  }\n\n  @Override\n  public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {\n    LOG.debug(\"Error \", cause);\n    resp = ExceptionHandler.exceptionCaught(cause);\n    resp.headers().set(CONNECTION, CLOSE);\n    ctx.writeAndFlush(resp).addListener(ChannelFutureListener.CLOSE);\n  }\n\n  private void onCreate(ChannelHandlerContext ctx)\n    throws IOException, URISyntaxException {\n    writeContinueHeader(ctx);\n\n    final String nnId = params.namenodeId();\n    final int bufferSize = params.bufferSize();\n    final short replication = params.replication();","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/web/webhdfs/WebHdfsHandler.java#L162-L198","documentation":"Error \"Invalid operation {op}\" thrown in apache/hadoop.","triggerScenarios":"WebHDFS request on the DataNode with an HTTP/operation parameter that does not map to a supported WebHDFS op.","commonSituations":"See trigger scenarios.","solutions":["Use a valid WebHDFS operation name (e.g. OPEN, CREATE, MKDIRS, LISTSTATUS) in the request URL.","Check the client code or curl command for a misspelled or unsupported op parameter."],"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"}