{"record":{"id":"fbee7421a78e3c5f","repo":"apache/druid","slug":"skipping-deep-storage-directory-kill-backslash-no","errorCode":null,"errorMessage":"Skipping deep storage directory kill: backslash not allowed in path [%s]","messagePattern":"Skipping deep storage directory kill: backslash not allowed in path \\[(.+?)\\]","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/HdfsDataSegmentKiller.java","lineNumber":191,"sourceCode":"  }\n\n  /**\n   * Construct a path to delete from HDFS. Returns null if the path is invalid.\n   * Replicates how {@link HdfsDataSegmentPusher#pushToPath} handles ':', by replacing that with '_'.\n   */\n  @Nullable\n  private Path constructHdfsDeletePath(String relativePath)\n  {\n    if (Strings.isNullOrEmpty(relativePath)) {\n      log.warn(\"Skipping deep storage directory kill: relative path is empty\");\n      return null;\n    }\n    if (relativePath.charAt(0) == '/') {\n      log.warn(\"Skipping deep storage directory kill: relative path must not be absolute, got [%s]\", relativePath);\n      return null;\n    }\n    if (relativePath.indexOf('\\\\') >= 0) {\n      log.warn(\"Skipping deep storage directory kill: backslash not allowed in path [%s]\", relativePath);\n      return null;\n    }\n    for (String segment : StringUtils.splitPreserveAllTokens(relativePath, '/')) {\n      if (segment.isEmpty() || \"..\".equals(segment)) {\n        log.warn(\"Skipping deep storage directory kill: invalid path[%s]\", relativePath);\n        return null;\n      }\n    }\n\n    if (storageDirectory == null) {\n      log.warn(\"Skipping deep storage directory kill: storage directory not configured\");\n      return null;\n    }\n\n    final String hdfsRelativePath = relativePath.replace(':', '_');\n    final String storageDirectoryString = storageDirectory.toString();\n    final String sep = storageDirectoryString.endsWith(Path.SEPARATOR) ? \"\" : Path.SEPARATOR;\n    return new Path(storageDirectoryString + sep + hdfsRelativePath);","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/HdfsDataSegmentKiller.java#L173-L209","documentation":"constructHdfsDeletePath rejects relative paths containing a backslash ('\\'), logging this warning and returning null. Backslashes are illegal in HDFS path components in this context and usually indicate a Windows-style or escaped path that doesn't belong in HDFS deep storage; deleting based on it would be unsafe.","triggerScenarios":"A DataSegment's relative loadSpec path contains '\\' characters, e.g. segments produced with Windows file separators or double-escaped paths.","commonSituations":"Segments generated on Windows-based ingestion tooling, manually constructed segment JSON with escaped separators, or copying segment metadata between Windows and Linux clusters.","solutions":["Fix the segment path in the metadata store to use '/' separators","Re-push affected segments with a correctly configured (Linux-style path) pusher","Skip killing these segments manually via hdfs dfs -rm once you locate the real path"],"exampleFix":"// before\n\"path\": \"datasource\\\\interval\\...\\index.zip\"\n// after\n\"path\": \"datasource/interval/.../index.zip\"","handlingStrategy":"validation","validationCode":"if (segmentPath.contains(\"\\\\\")) {\n  throw new IllegalArgumentException(\"segment path must use '/' separators: \" + segmentPath);\n}","typeGuard":"static boolean usesPosixSeparators(String p) { return p != null && p.indexOf('\\\\') < 0; }","tryCatchPattern":null,"preventionTips":["Run ingestion on POSIX-style path configurations","Normalize Windows-style paths to '/' before pushing","Never hand-edit segment paths with escaped separators"],"tags":["hdfs","segment-kill","path-validation","druid"],"backgroundTag":"invalid-argument-format","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}