{"record":{"id":"849e5c28ac4823f7","repo":"pinpoint-apm/pinpoint","slug":"bytecode-read-fail-path","errorCode":null,"errorMessage":"bytecode read fail path:{}","messagePattern":"bytecode read fail path:(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMClassNodeAdapter.java","lineNumber":111,"sourceCode":"                if (stream != null) {\n                    try {\n                        return IOUtils.toByteArray(stream);\n                    } catch (IOException e) {\n                        logger.warn(\"bytecode read fail scanner:{} path:{}\", scanner, classPath);\n                        return null;\n                    }\n                }\n            } finally {\n                scanner.close();\n            }\n        }\n\n        final InputStream in = pluginClassInputStreamProvider.getResourceAsStream(classLoader, classPath);\n        if (in != null) {\n            try {\n                return IOUtils.toByteArray(in);\n            } catch (IOException e) {\n                logger.warn(\"bytecode read fail path:{}\", classPath);\n                return null;\n            }\n        }\n        return null;\n    }\n\n    private static final String[] EMPTY_STRING_ARRAY = new String[0];\n\n    private final ClassInputStreamProvider pluginInputStreamProvider;\n    private final ClassLoader classLoader;\n    private final ProtectionDomain protectionDomain;\n    private final ClassNode classNode;\n    private final boolean skipCode;\n\n    public ASMClassNodeAdapter(final ClassInputStreamProvider pluginInputStreamProvider, final ClassLoader classLoader, ProtectionDomain protectionDomain, final ClassNode classNode) {\n        this(pluginInputStreamProvider, classLoader, protectionDomain, classNode, false);\n    }\n","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMClassNodeAdapter.java#L93-L129","documentation":"This warn is logged in ASMClassNodeAdapter.readStream when the plugin's class file bytecode cannot be read from the InputStream obtained via PluginClassInputStreamProvider.getResourceAsStream. The library throws nothing; it logs and returns null so the caller can degrade gracefully. It indicates an I/O problem (truncated jar, closed stream, IO error) while reading plugin bytecode, not a missing class.","triggerScenarios":"PluginClassInputStreamProvider.getResourceAsStream returned a non-null InputStream, but IOUtils.toByteArray(in) threw IOException while reading the plugin class resource for the given classPath.","commonSituations":"Corrupt or partially downloaded plugin jar in the plugin directory; jar closed/refreshed by another thread while bytecode is being read; disk or VFS I/O errors; reading from a nested jar inside a fat jar that got rewritten at startup.","solutions":["Verify the plugin jar integrity (re-download/replace it) and restart the agent.","Check that no other process rewrites the plugin directory while the agent runs.","Confirm disk health and sufficient file descriptors; inspect the IOException stack trace from the same log record for the root cause.","If the class is not actually needed as bytecode, ensure callers handle the null return path correctly."],"exampleFix":"// before\nreturn IOUtils.toByteArray(in);\n// after\ntry {\n    return IOUtils.toByteArray(in);\n} catch (IOException e) {\n    logger.warn(\"bytecode read fail path:{}\", classPath, e); // log cause for diagnosis\n    return null;\n}","handlingStrategy":"fallback","validationCode":"File jar = new File(pluginJarPath);\nif (!jar.isFile() || jar.length() == 0) { throw new IllegalStateException(\"plugin jar missing/empty: \" + jar); }","typeGuard":null,"tryCatchPattern":"InputStream in = provider.getResourceAsStream(cl, path);\nif (in == null) { return fallbackBytes(path); }\ntry { return IOUtils.toByteArray(in); } catch (IOException e) { log.warn(\"read fail {}\", path, e); return null; }","preventionTips":["Keep plugin jars immutable while the agent runs","Verify plugin jar checksums at deploy time","Monitor disk/fd health on the agent host","Always null-check the stream before reading"],"tags":["io","plugin","bytecode","instrumentation"],"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"}