{"record":{"id":"fa0056615052b3ad","repo":"apache/hadoop","slug":"unsupported-path-please-check-mount-table","errorCode":null,"errorMessage":"Unsupported path {} please check mount table","messagePattern":"Unsupported path (.+?) please check mount table","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/resolver/PathLocation.java","lineNumber":224,"sourceCode":"  }\n\n  /**\n   * Get the order for the destinations.\n   *\n   * @return Order for the destinations.\n   */\n  public DestinationOrder getDestinationOrder() {\n    return this.destOrder;\n  }\n\n  /**\n   * Get the default or highest priority location.\n   *\n   * @return The default location.\n   */\n  public RemoteLocation getDefaultLocation() {\n    if (destinations.isEmpty() || destinations.get(0).getDest() == null) {\n      throw new UnsupportedOperationException(\n          \"Unsupported path \" + sourcePath + \" please check mount table\");\n    }\n    return destinations.get(0);\n  }\n}","sourceCodeStart":206,"sourceCodeEnd":229,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/resolver/PathLocation.java#L206-L229","documentation":"PathLocation.getDefaultLocation() returns the first remote destination of a resolved path; it throws UnsupportedOperationException when the destination list is empty or the first RemoteLocation's dest is null — i.e., the mount table record backing this path is malformed and carries no usable destination, so there is no default location to forward requests to.","triggerScenarios":"A MountTable entry with zero destinations, or whose first RemoteLocation was built with a null dest (bad record inserted directly into the state store or by a buggy admin client), gets resolved into a PathLocation and getDefaultLocation() is called during request routing.","commonSituations":"Hand-edited or corrupted ZooKeeper/DB state store records; scripts calling the admin protobuf/JSON API with missing fields; partially written mount entries after a crashed admin operation.","solutions":["Find the malformed entry: hdfs dfsrouteradmin -list and look for the mount with missing/empty destinations","Replace it: hdfs dfsrouteradmin -rm <path> followed by a clean hdfs dfsrouteradmin -add <path> -ns <ns> -dst <dst>","Refresh all routers' mount caches (hdfs dfsrouteradmin -refresh) after the fix","If records were hand-edited in the state store, restore from a known-good snapshot/backup"],"exampleFix":"# remove the malformed entry and re-add it correctly\nhdfs dfsrouteradmin -rm /badmount\nhdfs dfsrouteradmin -add /badmount -ns ns0 -dst /badmount\nhdfs dfsrouteradmin -refresh","handlingStrategy":"validation","validationCode":"// Guard before using getDefaultLocation()\nPathLocation loc = resolver.lookupLocation(path);\nif (loc == null || loc.getDestinations().isEmpty()\n    || loc.getDestinations().get(0).getDest() == null) {\n  throw new IOException(\"No usable destination for \" + path\n      + \"; fix the mount table entry\");\n}\nRemoteLocation dst = loc.getDefaultLocation();","typeGuard":null,"tryCatchPattern":"try {\n  RemoteLocation dst = loc.getDefaultLocation();\n} catch (UnsupportedOperationException e) {\n  LOG.error(\"Malformed mount for {}: no default destination\", path);\n  // alert operators and skip this location rather than NPE later\n}","preventionTips":["Never hand-edit state store mount records; use dfsrouteradmin","Validate admin payloads (non-empty nameservice and dest) before submitting updates","Periodically audit mount entries for empty destination lists"],"tags":["hadoop","rbf","mount-table","path-resolution","malformed-record"],"backgroundTag":"empty-destination-list","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}