{"record":{"id":"daf6f83d62d8eeba","repo":"prestodb/presto","slug":"local-file-filesystem-error","errorCode":"LOCAL_FILE_FILESYSTEM_ERROR","errorMessage":"Error listing files in directory: \" + location","messagePattern":"Error listing files in directory: \" \\+ location","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-local-file/src/main/java/com/facebook/presto/localfile/DataLocation.java","lineNumber":100,"sourceCode":"\n        checkState(location.isDirectory(), \"location %s is not a directory\", location);\n\n        try (DirectoryStream<Path> paths = newDirectoryStream(location.toPath(), pattern.get())) {\n            ImmutableList.Builder<File> builder = ImmutableList.builder();\n            for (Path path : paths) {\n                builder.add(path.toFile());\n            }\n            List<File> files = builder.build();\n\n            if (files.isEmpty()) {\n                throw new PrestoException(LOCAL_FILE_NO_FILES, \"No matching files found in directory: \" + location);\n            }\n            return files.stream()\n                    .sorted((o1, o2) -> Long.compare(o2.lastModified(), o1.lastModified()))\n                    .collect(Collectors.toList());\n        }\n        catch (IOException e) {\n            throw new PrestoException(LOCAL_FILE_FILESYSTEM_ERROR, \"Error listing files in directory: \" + location, e);\n        }\n    }\n}\n","sourceCodeStart":82,"sourceCodeEnd":104,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-local-file/src/main/java/com/facebook/presto/localfile/DataLocation.java#L82-L104","documentation":"DataLocation.files() hit an IOException while opening a DirectoryStream over the location with the glob pattern; directory listing itself failed (permissions, concurrent removal, or filesystem error) and the exception is wrapped into this error.","triggerScenarios":"Thrown at presto-local-file/src/main/java/com/facebook/presto/localfile/DataLocation.java:100 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check read/execute permissions on the directory for the Presto process","Ensure the directory still exists and the filesystem is healthy"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}