{"record":{"id":"950f0bedc03826b8","repo":"apache/hadoop","slug":"possible-cyclic-loop-while-following-symbolic-link-950f0b","errorCode":null,"errorMessage":"Possible cyclic loop while following symbolic link {}","messagePattern":"Possible cyclic loop while following symbolic link (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystemLinkResolver.java","lineNumber":95,"sourceCode":"    // Callers validate this by passing paths through FileSystem#checkPath\n    FileSystem fs = filesys;\n    for (boolean isLink = true; isLink;) {\n      try {\n        in = doCall(p);\n        isLink = false;\n      } catch (UnresolvedLinkException e) {\n        if (!filesys.resolveSymlinks) {\n          throw new IOException(\"Path \" + path + \" contains a symlink\"\n              + \" and symlink resolution is disabled (\"\n              + CommonConfigurationKeys.FS_CLIENT_RESOLVE_REMOTE_SYMLINKS_KEY\n              + \").\", e);\n        }\n        if (!FileSystem.areSymlinksEnabled()) {\n          throw new IOException(\"Symlink resolution is disabled in\" +\n              \" this version of Hadoop.\");\n        }\n        if (count++ > FsConstants.MAX_PATH_LINKS) {\n          throw new IOException(\"Possible cyclic loop while \" +\n                                \"following symbolic link \" + path);\n        }\n        // Resolve the first unresolved path component\n        p = FSLinkResolver.qualifySymlinkTarget(fs.getUri(), p,\n            filesys.resolveLink(p));\n        fs = FileSystem.getFSofPath(p, filesys.getConf());\n        // Have to call next if it's a new FS\n        if (!fs.equals(filesys)) {\n          return next(fs, p);\n        }\n        // Else, we keep resolving with this filesystem\n      }\n    }\n    // Successful call, path was fully resolved\n    return in;\n  }\n}\n","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystemLinkResolver.java#L77-L113","documentation":"Error \"Possible cyclic loop while following symbolic link {}\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystemLinkResolver.java:95 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the cyclic symlink: find the loop with 'ls -l' or 'readlink' along the path and delete the offending link.","Restructure symlinks so chains terminate at a real file or directory."],"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-23T01:17:44.959Z"}