{"record":{"id":"fb9627b2c7ee7c1f","repo":"apache/hadoop","slug":"invalid-path-path","errorCode":null,"errorMessage":"Invalid path '{path}'.","messagePattern":"Invalid path '(.+?)'\\.","errorType":"exception","errorClass":"InvalidRequestException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/CacheManager.java","lineNumber":385,"sourceCode":"      throws InvalidRequestException {\n    String pool = directive.getPool();\n    if (pool == null) {\n      throw new InvalidRequestException(\"No pool specified.\");\n    }\n    if (pool.isEmpty()) {\n      throw new InvalidRequestException(\"Invalid empty pool name.\");\n    }\n    return pool;\n  }\n\n  private static String validatePath(CacheDirectiveInfo directive)\n      throws InvalidRequestException {\n    if (directive.getPath() == null) {\n      throw new InvalidRequestException(\"No path specified.\");\n    }\n    String path = directive.getPath().toUri().getPath();\n    if (!DFSUtil.isValidName(path)) {\n      throw new InvalidRequestException(\"Invalid path '\" + path + \"'.\");\n    }\n    return path;\n  }\n\n  private static short validateReplication(CacheDirectiveInfo directive,\n      short defaultValue) throws InvalidRequestException {\n    short repl = (directive.getReplication() != null)\n        ? directive.getReplication() : defaultValue;\n    if (repl <= 0) {\n      throw new InvalidRequestException(\"Invalid replication factor \" + repl\n          + \" <= 0\");\n    }\n    return repl;\n  }\n\n  /**\n   * Calculates the absolute expiry time of the directive from the\n   * {@link CacheDirectiveInfo.Expiration}. This converts a relative Expiration","sourceCodeStart":367,"sourceCodeEnd":403,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/CacheManager.java#L367-L403","documentation":"Error \"Invalid path '{path}'.\" thrown in apache/hadoop.","triggerScenarios":"addCacheDirective with a path that fails validation (not absolute or malformed).","commonSituations":"See trigger scenarios.","solutions":["Provide a valid absolute HDFS path for the cache directive."],"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"}