{"record":{"id":"4aefe1972279b2c0","repo":"apache/hadoop","slug":"cannot-create-with-favorednodes-through-a-symlink","errorCode":null,"errorMessage":"Cannot create with favoredNodes through a symlink to a non-DistributedFileSystem: ","messagePattern":"Cannot create with favoredNodes through 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":649,"sourceCode":"    return new FileSystemLinkResolver<HdfsDataOutputStream>() {\n      @Override\n      public HdfsDataOutputStream doCall(final Path p) throws IOException {\n        final DFSOutputStream out = dfs.create(getPathName(f), permission,\n            overwrite ? EnumSet.of(CreateFlag.CREATE, CreateFlag.OVERWRITE)\n                : EnumSet.of(CreateFlag.CREATE),\n            true, replication, blockSize, progress, bufferSize, null,\n            favoredNodes);\n        return safelyCreateWrappedOutputStream(out);\n      }\n      @Override\n      public HdfsDataOutputStream next(final FileSystem fs, final Path p)\n          throws IOException {\n        if (fs instanceof DistributedFileSystem) {\n          DistributedFileSystem myDfs = (DistributedFileSystem)fs;\n          return myDfs.create(p, permission, overwrite, bufferSize, replication,\n              blockSize, progress, favoredNodes);\n        }\n        throw new UnsupportedOperationException(\"Cannot create with\" +\n            \" favoredNodes through a symlink to a non-DistributedFileSystem: \"\n            + f + \" -> \" + p);\n      }\n    }.resolve(this, absF);\n  }\n\n  @Override\n  public FSDataOutputStream create(final Path f, final FsPermission permission,\n      final EnumSet<CreateFlag> cflags, final int bufferSize,\n      final short replication, final long blockSize,\n      final Progressable progress, final ChecksumOpt checksumOpt)\n      throws IOException {\n    statistics.incrementWriteOps(1);\n    storageStatistics.incrementOpCounter(OpType.CREATE);\n    Path absF = fixRelativePart(f);\n    return new FileSystemLinkResolver<FSDataOutputStream>() {\n      @Override\n      public FSDataOutputStream doCall(final Path p) throws IOException {","sourceCodeStart":631,"sourceCodeEnd":667,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java#L631-L667","documentation":"Error \"Cannot create with favoredNodes through a symlink to a non-DistributedFileSystem: \" thrown in apache/hadoop.","triggerScenarios":"create with favoredNodes is invoked through a symlink whose target is not a DistributedFileSystem, and favored nodes are an HDFS-only feature.","commonSituations":"See trigger scenarios.","solutions":["Call create with favoredNodes on the actual HDFS path instead of through a symlink to another filesystem.","Remove favoredNodes or resolve the symlink target to a DistributedFileSystem first."],"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"}