{"record":{"id":"318d75056b491e8e","repo":"apache/hadoop","slug":"required-param-for-op-is-null-or-empty","errorCode":null,"errorMessage":"Required param {} for op: {} is null or empty","messagePattern":"Required param (.+?) for op: (.+?) is null or empty","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":400,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/web/resources/NamenodeWebHdfsMethods.java","lineNumber":598,"sourceCode":"      @DefaultValue(StorageTypeParam.DEFAULT)\n      final StorageTypeParam storageType\n  ) throws IOException, InterruptedException {\n    return put(ugi, uriInfo, delegation, username, doAsUser, op, destination,\n        owner, group, permission, unmaskedPermission, overwrite, bufferSize,\n        replication, blockSize, modificationTime, accessTime, renameOptions,\n        createParent, delegationTokenArgument, aclPermission, xattrName,\n        xattrValue, xattrSetFlag, snapshotName, oldSnapshotName,\n        excludeDatanodes, createFlagParam, noredirect, policyName, ecpolicy,\n        namespaceQuota, storagespaceQuota, storageType);\n  }\n\n  /** Validate all required params. */\n  @SuppressWarnings(\"rawtypes\")\n  protected void validateOpParams(HttpOpParam<?> op, Param... params) {\n    for (Param param : params) {\n      if (param.getValue() == null || param.getValueString() == null || param\n          .getValueString().isEmpty()) {\n        throw new IllegalArgumentException(\"Required param \" + param.getName()\n            + \" for op: \" + op.getValueString() + \" is null or empty\");\n      }\n    }\n  }\n\n  /**\n   * Handle HTTP PUT request.\n   *\n   * @param ugi User and group information for Hadoop.\n   * @param uriInfo An injectable interface that provides access.\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 destination Destination path parameter.\n   * @param owner Owner parameter.\n   * @param group Group parameter.\n   * @param permission Permission parameter,","sourceCodeStart":580,"sourceCodeEnd":616,"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#L580-L616","documentation":"WebHDFS parameter guard in validateOpParams: every HTTP operation declares mandatory query parameters (op, destination, owner and so on); this fires when one of them is absent or blank in the request URL, before the operation is dispatched to the namenode.","triggerScenarios":"Thrown when a mandatory WebHDFS query parameter (path, op, offset, etc.) is absent or empty in the request URI.","commonSituations":"See trigger scenarios.","solutions":["Supply the missing required parameter in the WebHDFS request URL (e.g. &owner=..., &permission=...) for the given op.","Verify the op name is correct; some parameters are only required for specific operations."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}