{"record":{"id":"43a5e2d13957d5d6","repo":"apache/druid","slug":"no-files-found-in-s","errorCode":null,"errorMessage":"No files found in [%s]","messagePattern":"No files found in \\[(.+?)\\]","errorType":"exception","errorClass":"SegmentLoadingException","httpStatus":null,"severity":"error","filePath":"server/src/main/java/org/apache/druid/segment/loading/LocalDataSegmentPuller.java","lineNumber":125,"sourceCode":"      }\n\n      @Override\n      public boolean delete()\n      {\n        return file.delete();\n      }\n    };\n  }\n\n  private static final Logger log = new Logger(LocalDataSegmentPuller.class);\n\n  public FileUtils.FileCopyResult getSegmentFiles(final File sourceFile, final File dir) throws SegmentLoadingException\n  {\n    if (sourceFile.isDirectory()) {\n      try {\n        final File[] files = sourceFile.listFiles();\n        if (files == null) {\n          throw new SegmentLoadingException(\"No files found in [%s]\", sourceFile.getAbsolutePath());\n        }\n\n        if (sourceFile.equals(dir)) {\n          log.info(\"Asked to load [%s] into itself, done!\", dir);\n          return new FileUtils.FileCopyResult(Arrays.asList(files));\n        }\n\n        final FileUtils.FileCopyResult result = new FileUtils.FileCopyResult();\n        boolean link = true;\n        for (final File oldFile : files) {\n          if (oldFile.isDirectory()) {\n            log.info(\"[%s] is a child directory, skipping\", oldFile.getAbsolutePath());\n            continue;\n          }\n\n          final File newFile = new File(dir, oldFile.getName());\n          final FileUtils.LinkOrCopyResult linkOrCopyResult = FileUtils.linkOrCopy(oldFile, newFile);\n          link = link && linkOrCopyResult == FileUtils.LinkOrCopyResult.LINK;","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/server/src/main/java/org/apache/druid/segment/loading/LocalDataSegmentPuller.java#L107-L143","documentation":"LocalDataSegmentPuller.getSegmentFiles lists the contents of the source directory holding the segment. File.listFiles() returns null (not an empty array) when the directory can't be read or the listing fails, so a null result is reported as \"No files found\" with the absolute path to help diagnose access problems.","triggerScenarios":"getSegmentFiles(sourceFile, dir) invoked when sourceFile.listFiles() returns null — permissions deny read access, sourceFile vanished between isDirectory() and listFiles(), or an I/O error on the listing.","commonSituations":"Historical nodes pulling segments from a local deep storage directory whose permissions changed; segments deleted concurrently by cleanup jobs; container mounts missing the expected directory contents.","solutions":["Verify the directory exists and is readable/executable by the Druid user (chmod/chown as needed).","Check whether the segment directory was concurrently deleted or moved and re-trigger segment load.","If running in a container, confirm the segment volume is mounted and populated on this host."],"exampleFix":"// before\n$ ls -ld /var/druid/segments/wikipedia/2015/.../index.zip-dir  # druid cannot read\n// after\n$ chmod -R o+rx /var/druid/segments && restart historical / retry load","handlingStrategy":"validation","validationCode":"File src = new File(path);\nif (!src.isDirectory() || !src.canRead() || src.listFiles() == null) {\n  throw new IOException(\"Segment directory unreadable: \" + src.getAbsolutePath());\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure druid user has r+x on every level of the local segment storage path.","Avoid concurrent cleanup jobs deleting segment directories during loads."],"tags":["filesystem","segment-loading","permissions"],"backgroundTag":"directory-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"}