{"record":{"id":"dbc9804c6ce4aaa5","repo":"elastic/elasticsearch","slug":"failed-to-read-exclusionsfileabsolutepath","errorCode":null,"errorMessage":"Failed to read {exclusionsFileAbsolutePath}","messagePattern":"Failed to read (.+?)","errorType":"exception","errorClass":"GradleException","httpStatus":null,"severity":"error","filePath":"build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/docker/DockerSupportService.java","lineNumber":279,"sourceCode":"\n            return excluded;\n        }\n\n        return false;\n    }\n\n    private List<String> getLinuxExclusionList() {\n        File exclusionsFile = getParameters().getExclusionsFile();\n\n        if (exclusionsFile.exists()) {\n            try {\n                return Files.readAllLines(exclusionsFile.toPath())\n                    .stream()\n                    .map(String::trim)\n                    .filter(line -> (line.isEmpty() || line.startsWith(\"#\")) == false)\n                    .collect(Collectors.toList());\n            } catch (IOException e) {\n                throw new GradleException(\"Failed to read \" + exclusionsFile.getAbsolutePath(), e);\n            }\n        } else {\n            return Collections.emptyList();\n        }\n    }\n\n    // visible for testing\n    static String deriveId(Map<String, String> values) {\n        return values.get(\"ID\") + \"-\" + values.get(\"VERSION_ID\");\n    }\n\n    // visible for testing\n    static Map<String, String> parseOsRelease(final List<String> osReleaseLines) {\n        final Map<String, String> values = new HashMap<>();\n\n        osReleaseLines.stream().map(String::trim).filter(line -> (line.isEmpty() || line.startsWith(\"#\")) == false).forEach(line -> {\n            final String[] parts = line.split(\"=\", 2);\n            final String key = parts[0];","sourceCodeStart":261,"sourceCodeEnd":297,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/docker/DockerSupportService.java#L261-L297","documentation":"Thrown by DockerSupportService.getLinuxExclusionList() when reading the Docker exclusion list file fails. The file path is configured via the DOCKER_ON_LINUX_EXCLUSIONS_FILE parameter, set by DockerSupportPlugin to .ci/dockerOnLinuxExclusions relative to the settings directory. The file contains newline-separated Linux distribution IDs that should be excluded from Docker tasks. IOException is wrapped in GradleException.","triggerScenarios":"getLinuxExclusionList() is called (transitively from isExcludedOs()), the exclusions file exists (File.exists() returns true), but Files.readAllLines throws IOException. This can happen due to permission denied, the file being a broken symlink, or concurrent modification during read.","commonSituations":"The .ci/dockerOnLinuxExclusions file has restrictive permissions (e.g., 000 or owned by a different user). The file is a symlink pointing to a non-existent target (exists() follows symlinks and returns true for broken symlinks in some JVM versions). A CI agent has a corrupted checkout where the file is partially written.","solutions":["Check the file permissions and ownership: ls -la .ci/dockerOnLinuxExclusions.","If the file is a broken symlink, recreate it from git: git checkout -- .ci/dockerOnLinuxExclusions.","Verify the file is readable by the Gradle daemon process user: test -r .ci/dockerOnLinuxExclusions && echo readable."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Pre-flight check on exclusions file\nFile exclusionsFile = new File(settingsDir, \".ci/dockerOnLinuxExclusions\");\nif (exclusionsFile.exists() && !exclusionsFile.canRead()) {\n    throw new GradleException(\"Exclusions file exists but cannot be read: \" + exclusionsFile);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure .ci/dockerOnLinuxExclusions is committed with read permissions (644).","Add a pre-build check that verifies the file is readable in CI.","Avoid symlinks for this file to prevent broken-link issues."],"tags":["docker","ci","filesystem","configuration","io"],"backgroundTag":null,"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}