{"record":{"id":"23fe51fcd35f6e94","repo":"apache/hadoop","slug":"cannot-call-isfileclosed-on-a-symlink-to-a-non-dis","errorCode":null,"errorMessage":"Cannot call isFileClosed on a symlink to a non-DistributedFileSystem: {} -> {}","messagePattern":"Cannot call isFileClosed on a symlink to a non-DistributedFileSystem: (.+?) -> (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java","lineNumber":2649,"sourceCode":"   * @throws IOException If an I/O error occurred\n   */\n  @Override\n  public boolean isFileClosed(final Path src) throws IOException {\n    Path absF = fixRelativePart(src);\n    return new FileSystemLinkResolver<Boolean>() {\n      @Override\n      public Boolean doCall(final Path p) throws IOException {\n        return dfs.isFileClosed(getPathName(p));\n      }\n\n      @Override\n      public Boolean next(final FileSystem fs, final Path p)\n          throws IOException {\n        if (fs instanceof DistributedFileSystem) {\n          DistributedFileSystem myDfs = (DistributedFileSystem)fs;\n          return myDfs.isFileClosed(p);\n        } else {\n          throw new UnsupportedOperationException(\"Cannot call isFileClosed\"\n              + \" on a symlink to a non-DistributedFileSystem: \"\n              + src + \" -> \" + p);\n        }\n      }\n    }.resolve(this, absF);\n  }\n\n  /**\n   * @see #addCacheDirective(CacheDirectiveInfo, EnumSet)\n   */\n  public long addCacheDirective(CacheDirectiveInfo info) throws IOException {\n    return addCacheDirective(info, EnumSet.noneOf(CacheFlag.class));\n  }\n\n  /**\n   * Add a new CacheDirective.\n   *\n   * @param info Information about a directive to add.","sourceCodeStart":2631,"sourceCodeEnd":2667,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java#L2631-L2667","documentation":"Error \"Cannot call isFileClosed on a symlink to a non-DistributedFileSystem: {} -> {}\" thrown in apache/hadoop.","triggerScenarios":"isFileClosed is called on a path that is a symlink to a non-DistributedFileSystem, which does not expose the HDFS file-closed state.","commonSituations":"See trigger scenarios.","solutions":["Call isFileClosed on the actual HDFS path rather than through a symlink to a non-DistributedFileSystem.","Resolve the symlink target and use the target's DistributedFileSystem."],"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"}