{"record":{"id":"70c9a7a22c8e4285","repo":"apache/druid","slug":"asked-to-load-path-s-but-it-doesn-t-exist","errorCode":null,"errorMessage":"Asked to load path[%s], but it doesn't exist.","messagePattern":"Asked to load path\\[(.+?)\\], but it doesn't exist\\.","errorType":"exception","errorClass":"SegmentLoadingException","httpStatus":null,"severity":"error","filePath":"server/src/main/java/org/apache/druid/segment/loading/LocalDataSegmentPuller.java","lineNumber":241,"sourceCode":"    return new Predicate<>()\n    {\n      @Override\n      public boolean apply(Throwable input)\n      {\n        return !(input instanceof InterruptedException)\n               && !(input instanceof CancellationException)\n               && (input instanceof Exception);\n      }\n    };\n  }\n\n  private File getFile(DataSegment segment) throws SegmentLoadingException\n  {\n    final Map<String, Object> loadSpec = segment.getLoadSpec();\n    final File path = new File(MapUtils.getString(loadSpec, \"path\"));\n\n    if (!path.exists()) {\n      throw new SegmentLoadingException(\"Asked to load path[%s], but it doesn't exist.\", path);\n    }\n\n    return path;\n  }\n}\n","sourceCodeStart":223,"sourceCodeEnd":247,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/server/src/main/java/org/apache/druid/segment/loading/LocalDataSegmentPuller.java#L223-L247","documentation":"LocalDataSegmentPuller.getFile throws SegmentLoadingException when the path in the segment's local loadSpec does not exist on the filesystem. Druid was asked to load a segment whose recorded deep-storage file is missing, so it cannot serve data from this copy.","triggerScenarios":"getFile(DataSegment) resolves loadSpec 'path' via new File(...) and path.exists() returns false — file deleted, host migrated, or path recorded on a different machine.","commonSituations":"Deep-storage directory wiped or cleaned by a retention job; local storage shared-name mismatch after host move; restore/archive operations removed the file but metadata still references it; typo in druid.storage.baseDir between clusters.","solutions":["Check the path in the message on the historical node; restore the file from backup or another replica.","Verify druid.storage.baseDir/baseKeyPrefix config matches where segments were actually pushed.","Kill the missing segment via the coordinator kill API (or disable it) so metadata stops referencing it.","If segments were moved, re-push them or update the loadSpec paths in metadata store to the new location."],"exampleFix":"// before: base dir changed in config but old segments still on old path\n# druid.storage.baseDir=/mnt/new/deepstorage  (segments live under /mnt/deepstorage)\n// after: point config back or move data\n# druid.storage.baseDir=/mnt/deepstorage\nmv /mnt/deepstorage/druid/segments /mnt/new/deepstorage/druid/segments","handlingStrategy":"validation","validationCode":"String path = (String) segment.getLoadSpec().get(\"path\");\nif (path == null || !new File(path).exists()) {\n  throw new IllegalStateException(\"segment data missing on disk: \" + path);\n}","typeGuard":"boolean localSegmentExists(DataSegment segment) {\n  Object p = segment.getLoadSpec().get(\"path\");\n  return p instanceof String && new File((String) p).exists();\n}","tryCatchPattern":"try {\n  File f = puller.getSegmentFiles(segment, outDir);\n} catch (SegmentLoadingException e) {\n  log.warn(e, \"local segment file missing for %s; triggering re-replication\", segment.getId());\n}","preventionTips":["Don't delete or prune files in Druid deep storage with ad-hoc cron jobs; use the coordinator kill API.","Keep druid.storage.baseDir/baseKeyPrefix consistent across cluster config changes.","Use a shared, persistent filesystem for local deep storage across historical restarts.","Maintain >=2 replicas so missing copies can be re-replicated automatically."],"tags":["segment-loading","file-not-found","local-deep-storage"],"backgroundTag":"file-not-found","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"}