{"record":{"id":"f6cc10fa8ad76178","repo":"apache/hadoop","slug":"cannot-concat-with-a-symlink-src","errorCode":null,"errorMessage":"Cannot concat with a symlink src: ","messagePattern":"Cannot concat with a symlink src: ","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java","lineNumber":999,"sourceCode":"    String[] srcsStr = new String[psrcs.length];\n    try {\n      for (int i=0; i<psrcs.length; i++) {\n        srcsStr[i] = getPathName(srcs[i]);\n      }\n      dfs.concat(getPathName(absF), srcsStr);\n    } catch (UnresolvedLinkException e) {\n      // Exception could be from trg or any src.\n      // Fully resolve trg and srcs. Fail if any of them are a symlink.\n      FileStatus stat = getFileLinkStatus(absF);\n      if (stat.isSymlink()) {\n        throw new IOException(\"Cannot concat with a symlink target: \"\n            + trg + \" -> \" + stat.getPath());\n      }\n      absF = fixRelativePart(stat.getPath());\n      for (int i=0; i<psrcs.length; i++) {\n        stat = getFileLinkStatus(srcs[i]);\n        if (stat.isSymlink()) {\n          throw new IOException(\"Cannot concat with a symlink src: \"\n              + psrcs[i] + \" -> \" + stat.getPath());\n        }\n        srcs[i] = fixRelativePart(stat.getPath());\n      }\n      // Try concat again. Can still race with another symlink.\n      for (int i=0; i<psrcs.length; i++) {\n        srcsStr[i] = getPathName(srcs[i]);\n      }\n      dfs.concat(getPathName(absF), srcsStr);\n    }\n  }\n\n\n  @SuppressWarnings(\"deprecation\")\n  @Override\n  public boolean rename(Path src, Path dst) throws IOException {\n    statistics.incrementWriteOps(1);\n    storageStatistics.incrementOpCounter(OpType.RENAME);","sourceCodeStart":981,"sourceCodeEnd":1017,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java#L981-L1017","documentation":"Error \"Cannot concat with a symlink src: \" thrown in apache/hadoop.","triggerScenarios":"concat is called with a source path that is a symlink; concat only accepts real DFS files as sources.","commonSituations":"See trigger scenarios.","solutions":["Ensure all concat source files are real DFS files, not symlinks.","Read and rewrite symlink sources as regular files before concat."],"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"}