{"record":{"id":"ce8122159f4f52d4","repo":"apache/hadoop","slug":"invalid-path-name","errorCode":null,"errorMessage":"Invalid path name {}","messagePattern":"Invalid path name (.+?)","errorType":"validation","errorClass":"InvalidPathException","httpStatus":400,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/web/resources/NamenodeWebHdfsMethods.java","lineNumber":416,"sourceCode":"    if (c == null) {\n      return null;\n    }\n    final Token<? extends TokenIdentifier> t = c.getAllTokens().iterator().next();\n    Text kind = scheme.equals(\"http\")\n        ? WebHdfsConstants.WEBHDFS_TOKEN_KIND\n        : WebHdfsConstants.SWEBHDFS_TOKEN_KIND;\n    t.setKind(kind);\n    return t;\n  }\n\n  private URI redirectURI(ResponseBuilder rb, final NameNode namenode,\n      final UserGroupInformation ugi, final DelegationParam delegation,\n      final UserParam username, final DoAsParam doAsUser,\n      final String path, final HttpOpParam.Op op, final long openOffset,\n      final long blocksize, final String excludeDatanodes,\n      final Param<?, ?>... parameters) throws URISyntaxException, IOException {\n    if (!DFSUtil.isValidName(path)) {\n      throw new InvalidPathException(path);\n    }\n    final DatanodeInfo dn;\n    final NamenodeProtocols np = getRPCServer(namenode);\n    HdfsFileStatus status = null;\n    if (op == GetOpParam.Op.OPEN\n        || op == GetOpParam.Op.GETFILECHECKSUM\n        || op == PostOpParam.Op.APPEND) {\n      status = np.getFileInfo(path);\n    }\n    dn = chooseDatanode(namenode, path, op, openOffset, blocksize,\n        excludeDatanodes, remoteAddr, status);\n    if (dn == null) {\n      throw new IOException(\"Failed to find datanode, suggest to check cluster\"\n          + \" health. excludeDatanodes=\" + excludeDatanodes);\n    }\n\n    final String delegationQuery;\n    if (!UserGroupInformation.isSecurityEnabled()) {","sourceCodeStart":398,"sourceCodeEnd":434,"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#L398-L434","documentation":"Error \"Invalid path name {}\" thrown in apache/hadoop.","triggerScenarios":"Thrown when the path argument of a WebHDFS request fails PathValidation (empty, null, or containing illegal characters) before the operation is dispatched.","commonSituations":"See trigger scenarios.","solutions":["Ensure the WebHDFS path is absolute and starts with '/', e.g. /webhdfs/v1/user/data/file.","Remove illegal characters (null bytes, control characters) from the path and retry the WebHDFS call."],"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"}