{"record":{"id":"f4e5527a5625a104","repo":"pinpoint-apm/pinpoint","slug":"can-read","errorCode":null,"errorMessage":" can read","messagePattern":" can read","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"agent-module/bootstraps/bootstrap/src/main/java/com/navercorp/pinpoint/bootstrap/agentdir/JarFileUtils.java","lineNumber":43,"sourceCode":"/**\n * @author Woonduk Kang(emeroad)\n */\nfinal class JarFileUtils {\n\n    public static JarFile openJarFile(Path path) {\n        Objects.requireNonNull(path, \"path\");\n\n        if (!Files.exists(path)) {\n            throw new IllegalArgumentException(path + \" not found\");\n        }\n        if (Files.isDirectory(path)) {\n            throw new IllegalArgumentException(path + \" is directory\");\n        }\n        if (!Files.isRegularFile(path)) {\n            throw new IllegalArgumentException(path + \" not file\");\n        }\n        if (!Files.isReadable(path)) {\n            throw new IllegalArgumentException(path + \" can read\");\n        }\n        try {\n            return new JarFile(path.toFile());\n        } catch (IOException e) {\n            throw new IllegalStateException(path + \" create fail Caused by:\" + e.getMessage(), e);\n        }\n    }\n}\n","sourceCodeStart":25,"sourceCodeEnd":52,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/bootstraps/bootstrap/src/main/java/com/navercorp/pinpoint/bootstrap/agentdir/JarFileUtils.java#L25-L52","documentation":"Thrown by JarFileUtils.openJarFile when the target path exists and is a regular file but is not readable by the current process. The utility pre-validates readability with Files.isReadable before attempting to open the jar, so this error surfaces instead of a raw FileSystemException from JarFile.","triggerScenarios":"Calling openJarFile(Path) on a jar whose OS permissions deny read access to the current user (e.g. root-owned jar, or restrictive chmod).","commonSituations":"Agent deployed/extracted by another user (root) so the pinpointer user cannot read jars in the agent directory; restrictive umask during agent installation; files copied from archives losing read bits.","solutions":["Run the JVM/agent as a user with read permission on the jar path","chmod/chown the jar file so the running user can read it (e.g. chmod o+r <jar> or chown)","Check parent directory execute/search permissions which can also block access","Verify path points to the correct file; re-extract the agent distribution with correct permissions"],"exampleFix":"// before\nPath jar = Paths.get(\"/opt/pinpoint/agent/pinpoint-bootstrap.jar\"); // owned by root, mode 600\nJarFile jf = JarFileUtils.openJarFile(jar); // throws 'can read'\n// after\n// as admin: chown pinpoint:pinpoint /opt/pinpoint/agent/pinpoint-bootstrap.jar && chmod 644 ...\nJarFile jf = JarFileUtils.openJarFile(jar); // OK","handlingStrategy":"validation","validationCode":"if (!Files.isRegularFile(path)) throw new IllegalStateException(\"not a readable jar file: \" + path);\nif (!Files.isReadable(path)) throw new IllegalStateException(\"no read permission: \" + path);","typeGuard":"boolean isReadableJar(Path p) { return Files.isRegularFile(p) && Files.isReadable(p); }","tryCatchPattern":"try { JarFile jf = JarFileUtils.openJarFile(path); } catch (IllegalArgumentException e) { log.error(\"cannot read jar: {}\", e.getMessage()); }","preventionTips":["Deploy and run the agent as the same OS user","Verify permissions after extraction (tar preserves modes; check umask)","Add a startup permission check over the agent directory"],"tags":["java","file-permissions","io","agent-bootstrap"],"backgroundTag":"permission-denied","analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}