{"record":{"id":"d3447ddf9238ca0f","repo":"apache/hadoop","slug":"error-d3447d","errorCode":null,"errorMessage":"{}","messagePattern":"\\{\\}","errorType":"exception","errorClass":"PathNotFoundException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/CuratorService.java","lineNumber":491,"sourceCode":"   * @param path path of operation\n   * @return a curator stat entry\n   * @throws IOException           on a failure\n   * @throws PathNotFoundException if the path was not found\n   */\n  public Stat zkStat(String path) throws IOException {\n    checkServiceLive();\n    String fullpath = createFullPath(path);\n    Stat stat;\n    try {\n      if (LOG.isDebugEnabled()) {\n        LOG.debug(\"Stat {}\", fullpath);\n      }\n      stat = curator.checkExists().forPath(fullpath);\n    } catch (Exception e) {\n      throw operationFailure(fullpath, \"read()\", e);\n    }\n    if (stat == null) {\n      throw new PathNotFoundException(path);\n    }\n    return stat;\n  }\n\n  /**\n   * Get the ACLs of a path.\n   *\n   * @param path path of operation\n   * @return a possibly empty list of ACLs\n   * @throws IOException\n   */\n  public List<ACL> zkGetACLS(String path) throws IOException {\n    checkServiceLive();\n    String fullpath = createFullPath(path);\n    List<ACL> acls;\n    try {\n      if (LOG.isDebugEnabled()) {\n        LOG.debug(\"GetACLS {}\", fullpath);","sourceCodeStart":473,"sourceCodeEnd":509,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/CuratorService.java#L473-L509","documentation":"CuratorService.zkStat(path) runs curator.checkExists().forPath(fullpath); ZooKeeper's checkExists reports a missing node by returning a null Stat rather than raising an error, so the code converts the null into PathNotFoundException(path). fullpath is the argument after createFullPath() prepends the configured registry root, so the miss can come from a wrong root as well as a wrong path.","triggerScenarios":"zkStat/stat on a znode that was never created or was already deleted; a path whose registry-root prefix is wrong so every lookup misses; stat'ing a service record before the publisher has created it.","commonSituations":"Resolving or stat'ing a service before it publishes; after unregister; typos in registry paths; registry root not initialized (mkroot never run) so lookups target a nonexistent subtree.","solutions":["Probe first with zkPathExists(path) (or RegistryOperations.exists) and treat false as 'not published'.","Verify the exact path/root: compare against what bind()/mknode created, including the registry root prefix.","Catch PathNotFoundException and handle it as the normal 'entry absent' outcome."],"exampleFix":"// before\nStat stat = curatorService.zkStat(\"/services/api\"); // node absent -> PathNotFoundException\n\n// after\nif (!curatorService.zkPathExists(\"/services/api\")) {\n  // not published yet: create it or report absence\n}\nStat stat = curatorService.zkStat(\"/services/api\");","handlingStrategy":"validation","validationCode":"if (!curatorService.zkPathExists(path)) { // or registryOperations.exists(path)\n  // entry not published (yet): create it or report absence instead of stat'ing\n}\nStat stat = curatorService.zkStat(path);","typeGuard":null,"tryCatchPattern":"try {\n  Stat stat = curatorService.zkStat(path);\n} catch (PathNotFoundException e) {\n  // normal 'not published' outcome: skip, wait for registration, or create the node\n}","preventionTips":["Treat absent paths as expected in discovery flows; probe with exists()/zkPathExists first.","Log the exact full path (including registry root) when lookup misses to catch root-prefix mistakes.","Ensure the registry root is created (mkroot/mknode on '/') before relying on stat of deep paths."],"tags":["registry","zookeeper","path-not-found","hadoop-registry"],"backgroundTag":"path-not-found","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}