{"record":{"id":"42987d612bc0f7a1","repo":"quarkusio/quarkus","slug":"failed-to-make-the-file-executable-exe","errorCode":null,"errorMessage":"Failed to make the file executable: ${exe}","messagePattern":"Failed to make the file executable: (.+?)","errorType":"exception","errorClass":"CodeGenException","httpStatus":null,"severity":"error","filePath":"extensions/grpc/codegen/src/main/java/io/quarkus/grpc/codegen/GrpcCodeGen.java","lineNumber":522,"sourceCode":"            Path artifactPath) throws CodeGenException {\n        Path exe = buildDir.resolve(String.format(\"%s-%s-%s-%s\", groupId, artifactId, classifier, packaging));\n\n        if (Files.exists(exe)) {\n            return exe;\n        }\n\n        if (artifactPath == null) {\n            String location = String.format(\"%s:%s:%s:%s\", groupId, artifactId, classifier, packaging);\n            throw new CodeGenException(\"Failed to find \" + location + \" among dependencies\");\n        }\n\n        try {\n            Files.copy(artifactPath, exe, StandardCopyOption.REPLACE_EXISTING);\n        } catch (IOException e) {\n            throw new CodeGenException(\"Failed to copy file: \" + artifactPath + \" to \" + exe, e);\n        }\n        if (!exe.toFile().setExecutable(true)) {\n            throw new CodeGenException(\"Failed to make the file executable: \" + exe);\n        }\n        return exe;\n    }\n\n    private static Path findArtifactPath(ApplicationModel model, String groupId, String artifactId, String classifier,\n            String packaging) {\n        Path artifactPath = null;\n\n        for (ResolvedDependency artifact : model.getDependencies()) {\n            if (groupId.equals(artifact.getGroupId())\n                    && artifactId.equals(artifact.getArtifactId())\n                    && classifier.equals(artifact.getClassifier())\n                    && packaging.equals(artifact.getType())) {\n                artifactPath = artifact.getResolvedPaths().getSinglePath();\n            }\n        }\n        return artifactPath;\n    }","sourceCodeStart":504,"sourceCodeEnd":540,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/grpc/codegen/src/main/java/io/quarkus/grpc/codegen/GrpcCodeGen.java#L504-L540","documentation":"Quarkus copies the protoc binary into the build directory and marks it executable with File.setExecutable(true). This CodeGenException is thrown when the OS refuses to set the execute bit — common on filesystems that do not support permissions.","triggerScenarios":"Code generation where the copied protoc/protoc-gen-grpc-java file lives on a filesystem without POSIX exec permissions (NTFS/FAT mounts, Windows drives mounted on Linux, some NFS/SMB shares, WSL /mnt/c), so setExecutable returns false.","commonSituations":"WSL2 builds writing to /mnt/c instead of the Linux filesystem; CI runners with tmpfs/noexec mounts; Docker volumes mounted with noexec; FAT32 USB drives used as workspace.","solutions":["Move the project/build directory onto a native filesystem (e.g. inside WSL use ~/project, not /mnt/c)","Remount the volume without noexec (mount -o remount,exec) or remove noexec from fstab/docker volume options","Use a POSIX-compliant filesystem for the build (ext4/overlayfs in containers, not NTFS/FAT mounts)","Alternatively supply a working protoc via -Dquarkus.grpc.protoc-path pointing to an already-executable binary"],"exampleFix":"# before (WSL)\ncd /mnt/c/Users/me/project && mvn compile\n# after\ncd ~/project && mvn compile","handlingStrategy":"validation","validationCode":"Path probe = buildDir.resolve(\".exec-probe\");\nFiles.writeString(probe, \"#\");\nif (!probe.toFile().setExecutable(true)) {\n    throw new IllegalStateException(\"Filesystem \" + buildDir + \" does not support execute bits; move build off noexec/NTFS mounts\");\n}\nFiles.deleteIfExists(probe);","typeGuard":null,"tryCatchPattern":"try {\n    build.run();\n} catch (CodeGenException e) {\n    if (e.getMessage().contains(\"Failed to make the file executable\")) {\n        throw new IllegalStateException(\"Re-run on an exec-capable filesystem (not noexec/NFS/NTFS)\", e);\n    }\n}","preventionTips":["Keep build directories on native POSIX filesystems (not /mnt/c in WSL, FAT, or noexec mounts)","Check mount options with `mount | grep noexec` before CI setup","In Docker, do not mount the workspace with :noexec","Use -Dquarkus.grpc.protoc-path pointing to an already-executable protoc as a workaround"],"tags":["filesystem","permissions","grpc","codegen"],"backgroundTag":"permission-denied","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}