{"record":{"id":"18acc36ef105f5bc","repo":"pinpoint-apm/pinpoint","slug":"is-not-a-file","errorCode":null,"errorMessage":" is not a file","messagePattern":" is not a file","errorType":"validation","errorClass":"PluginException","httpStatus":null,"severity":"error","filePath":"agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/plugin/PluginJar.java","lineNumber":78,"sourceCode":"    private static JarFile createJarFile(Path pluginJar) {\n        try {\n            verify(pluginJar);\n            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","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/plugin/PluginJar.java#L60-L96","documentation":"PluginJar.verify() validates the path given to createJarFile() before opening the plugin jar. It throws this PluginException when the path exists but is not a regular file (e.g. a directory or special file). The library refuses to treat non-regular paths as jar sources.","triggerScenarios":"Calling PluginJar.createJarFile(path) where Files.isRegularFile(path) is false but the path exists — e.g. pointing the profiler plugin directory config at a directory itself instead of a .jar file inside it.","commonSituations":"Misconfigured profiler.plugin.pluginJarLocation (or plugin dir) option set to a directory, a symlink resolution leaving a directory path, or a mount point/socket path supplied instead of the jar.","solutions":["Check the path with `ls -l` and confirm it is a regular .jar file, not a directory","Fix the pinpoint profiler configuration to point at the actual plugin jar file or the parent directory scanned for jars","Remove stale symlinks or special files at that path and redeploy the plugin jar"],"exampleFix":"// before\nPluginJar.createJarFile(Path.of(\"/plugins\"));\n// after\nPluginJar.createJarFile(Path.of(\"/plugins/pinpoint-foo-plugin.jar\"));","handlingStrategy":"validation","validationCode":"if (!Files.isRegularFile(jarPath)) { throw new IllegalArgumentException(\"Plugin path is not a regular file: \" + jarPath); }","typeGuard":"boolean isRegularFileOrNull(Path p) { return p != null && Files.isRegularFile(p); }","tryCatchPattern":"try { PluginJar.createJarFile(jarPath); } catch (PluginException e) { log.error(\"Invalid plugin jar path {}: {}\", jarPath, e.getMessage()); }","preventionTips":["Point plugin config at directories to be scanned, or verify the exact jar path with Files.isRegularFile before use","List the plugin directory and confirm jar files exist before agent startup","Validate paths after container mounts/symlinks resolve"],"tags":["java","plugin-loader","filesystem"],"backgroundTag":"file-not-found","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"}