{"record":{"id":"ac5443cc780cac62","repo":"gradle/gradle","slug":"could-not-read-path-s","errorCode":null,"errorMessage":"Could not read path '%s'.","messagePattern":"Could not read path '(.+?)'\\.","errorType":"exception","errorClass":"GradleException","httpStatus":null,"severity":"error","filePath":"platforms/core-configuration/file-collections/src/main/java/org/gradle/api/internal/file/collections/PathVisitor.java","lineNumber":106,"sourceCode":"            visitor.visitFile(details);\n        }\n        return checkStopFlag();\n    }\n\n    private FileVisitDetails getFileVisitDetails(Path file, @Nullable BasicFileAttributes attrs) {\n        FileVisitDetails dirDetails = directoryDetailsHolder.peek();\n        if (dirDetails != null) {\n            return AttributeBasedFileVisitDetailsFactory.getFileVisitDetails(file, dirDetails.getRelativePath(), attrs, stopFlag, fileSystem);\n        } else {\n            return AttributeBasedFileVisitDetailsFactory.getRootFileVisitDetails(file, rootPath, attrs, stopFlag, fileSystem);\n        }\n    }\n\n    @Override\n    public FileVisitResult visitFileFailed(Path file, IOException exc) {\n        FileVisitDetails details = getFileVisitDetails(file, null);\n        if (isNotFileSystemLoopException(exc) && shouldVisit(details)) {\n            throw new GradleException(String.format(\"Could not read path '%s'.\", file), exc);\n        }\n        return checkStopFlag();\n    }\n\n    private static boolean isNotFileSystemLoopException(@Nullable IOException e) {\n        return e != null && !(e instanceof FileSystemLoopException);\n    }\n\n    @Override\n    public FileVisitResult postVisitDirectory(Path dir, @Nullable IOException exc) {\n        if (exc != null) {\n            if (!(exc instanceof FileSystemLoopException)) {\n                throw new GradleException(String.format(\"Could not read directory path '%s'.\", dir), exc);\n            }\n        } else {\n            if (postfix) {\n                FileVisitDetails details = directoryDetailsHolder.peek();\n                if (directoryDetailsHolder.size() > 1 && details != null) {","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/gradle/gradle/blob/534f27719b66953f95cc907aae7f2c1b12f5482d/platforms/core-configuration/file-collections/src/main/java/org/gradle/api/internal/file/collections/PathVisitor.java#L88-L124","documentation":"Gradle throws this error when the following condition is violated: Could not read path '<value>'.","triggerScenarios":"Thrown at platforms/core-configuration/file-collections/src/main/java/org/gradle/api/internal/file/collections/PathVisitor.java:106 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check file system permissions on the path and ensure the Gradle process can read it."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"534f27719b66953f95cc907aae7f2c1b12f5482d","analyzedAt":"2026-08-22T08:09:12.375Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}