{"record":{"id":"f0b1747f905f626f","repo":"elastic/elasticsearch","slug":"can-t-walk-source","errorCode":null,"errorMessage":"Can't walk source {}","messagePattern":"Can't walk source (.+?)","errorType":"exception","errorClass":"UncheckedIOException","httpStatus":null,"severity":"error","filePath":"build-tools/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java","lineNumber":1388,"sourceCode":"                    Files.createDirectories(destination.getParent());\n                    syncMethod.accept(destination, source);\n                    return FileVisitResult.CONTINUE;\n                }\n\n                @Override\n                public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException {\n                    if (exc instanceof NoSuchFileException noFileException) {\n                        // Ignore these files that are sometimes left behind by the JVM\n                        if (noFileException.getFile() != null && noFileException.getFile().contains(\".attach_pid\")) {\n                            LOGGER.info(\"Ignoring file left behind by JVM: {}\", noFileException.getFile());\n                            return FileVisitResult.CONTINUE;\n                        }\n                    }\n                    throw exc;\n                }\n            });\n        } catch (IOException e) {\n            throw new UncheckedIOException(\"Can't walk source \" + sourceRoot, e);\n        }\n    }\n\n    private void createConfiguration() {\n        String nodeName = nameCustomization.apply(safeName(name));\n        Map<String, String> baseConfig = new HashMap<>(defaultConfig);\n        if (nodeName != null) {\n            baseConfig.put(\"node.name\", nodeName);\n        }\n        baseConfig.put(\"path.repo\", confPathRepo.toAbsolutePath().toString());\n        baseConfig.put(\"path.data\", confPathData.toAbsolutePath().toString());\n        baseConfig.put(\"path.logs\", confPathLogs.toAbsolutePath().toString());\n        if (Boolean.getBoolean(\"java.net.preferIPv6Addresses\")) {\n            baseConfig.put(\"network.host\", \"_local:ipv6_\");\n        }\n        baseConfig.put(\"node.attr.testattr\", \"test\");\n        baseConfig.put(\"node.portsfile\", \"true\");\n        baseConfig.put(\"http.port\", httpPort);","sourceCodeStart":1370,"sourceCodeEnd":1406,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/build-tools/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java#L1370-L1406","documentation":"Wraps any IOException that escapes Files.walkFileTree(sourceRoot, ...) during the sync() method. The walker itself handles NoSuchFileException for .attach_pid files (JVM leftovers) by continuing; every other IOException (including failures from the syncMethod callback propagating up through preVisitDirectory/visitFile) is caught here and rethrown as UncheckedIOException.","triggerScenarios":"The visitor throws inside preVisitDirectory/visitFile (e.g. a hard-link or copy failure from syncWithLinks/syncWithCopy bubbles up), or walkFileTree itself cannot read sourceRoot (permissions, sourceRoot deleted mid-walk, broken symlink).","commonSituations":"The extracted distribution sourceRoot is missing or has restrictive permissions; a symlink inside the distro points nowhere; the underlying link/copy operation failed (see errors 86/87) and propagated through the visitor.","solutions":["Look at the wrapped IOException's cause and file path — it identifies which entry in sourceRoot failed.","Re-extract the distribution (delete the extracted dir and let the build task recreate it).","Verify read permissions on the entire sourceRoot tree (chmod -R+r if needed).","If the real cause is link/copy failure, fix that first (errors 86/87) — this throw is a symptom."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (Files.notExists(sourceRoot) || !Files.isReadable(sourceRoot)) {\n    throw new IllegalStateException(\"sourceRoot \" + sourceRoot + \" missing/unreadable\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    Files.walkFileTree(sourceRoot, new SimpleFileVisitor<>() { ... });\n} catch (IOException e) {\n    throw new UncheckedIOException(\"Can't walk source \" + sourceRoot, e);\n}","preventionTips":["Re-extract the distribution when sourceRoot looks incomplete.","Verify read permissions on the whole distro tree before sync.","Fix underlying link/copy failures (errors 86/87) first."],"tags":["testclusters","walk-filetree","io","distribution"],"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-12T08:17:17.861Z"}