{"record":{"id":"54ba00342e780ce5","repo":"pinpoint-apm/pinpoint","slug":"file-cannot-be-read","errorCode":null,"errorMessage":" File cannot be read","messagePattern":" File cannot be read","errorType":"validation","errorClass":"PluginException","httpStatus":null,"severity":"error","filePath":"agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/plugin/PluginJar.java","lineNumber":81,"sourceCode":"            return new JarFile(pluginJar.toFile());\n        } catch (IOException e) {\n            throw new PluginException(pluginJar + \" JarFile create error \" + e.getCause(), e);\n        }\n    }\n\n    public static PluginJar fromFilePath(Path path) {\n        return new PluginJar(path);\n    }\n\n    private static void verify(Path file) {\n        if (!Files.exists(file)) {\n            throw new PluginException(file + \" File does not exist\");\n        }\n        if (!Files.isRegularFile(file)) {\n            throw new PluginException(file + \" is not a file\");\n        }\n        if (!Files.isReadable(file)) {\n            throw new PluginException(file + \" File cannot be read\");\n        }\n    }\n\n    public URL getURL() {\n        return url;\n    }\n\n    public JarFile getJarFile() {\n        return jarFile;\n    }\n\n    public String getPluginId() {\n        return manifest.getPluginId();\n    }\n\n    public String getPluginCompilerVersion() {\n        return manifest.getPluginCompilerVersion();\n    }","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/plugin/PluginJar.java#L63-L99","documentation":"PluginJar.verify() checks Files.isReadable(file) after existence/regular-file checks and throws this PluginException when the process cannot read the plugin jar. It is a pre-flight permission check before opening the jar for the manifest.","triggerScenarios":"Calling PluginJar.createJarFile(path) on a jar file whose OS permissions deny read access to the pinpoint agent process user.","commonSituations":"Plugin jar deployed by root with 0600 permissions while the agent runs as another user, restrictive umask after manual upload, or container volume mounted read-only/non-readable for the agent UID.","solutions":["Grant read permission on the jar: chmod a+r <jar> (or chown to the agent user)","Verify the user running the JVM can read the file: sudo -u <agent-user> head -c1 <jar>","Fix deployment/CI so plugin jars are copied with world-readable permissions"],"exampleFix":"// shell before\n-rw------- pinpoint-foo-plugin.jar\n// shell after\nchmod 644 pinpoint-foo-plugin.jar","handlingStrategy":"validation","validationCode":"if (!Files.isReadable(jarPath)) { throw new IllegalStateException(\"Agent user cannot read plugin jar: \" + jarPath); }","typeGuard":"boolean isReadableFile(Path p) { return p != null && Files.isRegularFile(p) && Files.isReadable(p); }","tryCatchPattern":"try { PluginJar.createJarFile(jarPath); } catch (PluginException e) { log.error(\"Plugin jar unreadable: {}\", jarPath, e); }","preventionTips":["Deploy plugin jars with 0644 and correct ownership for the agent user","Run deployment and agent under consistent UIDs in containers","Add a startup readiness check verifying plugin jar readability"],"tags":["java","plugin-loader","permissions"],"backgroundTag":"file-read-failed","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"}