{"record":{"id":"ca2d95e219cd944b","repo":"pinpoint-apm/pinpoint","slug":"bytecode-read-fail-scanner-path","errorCode":null,"errorMessage":"bytecode read fail scanner:{} path:{}","messagePattern":"bytecode read fail scanner:(.+?) path:(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMClassNodeAdapter.java","lineNumber":97,"sourceCode":"    private static int getParsingOption(boolean skipCode) {\n        if (skipCode) {\n            return ClassReader.SKIP_CODE;\n        } else {\n            return 0;\n        }\n    }\n\n    private static byte[] readStream(String classPath, ClassInputStreamProvider pluginClassInputStreamProvider, ProtectionDomain protectionDomain, ClassLoader classLoader) {\n\n        final Scanner scanner = ClassScannerFactory.newScanner(protectionDomain);\n        if (scanner != null) {\n            try {\n                final InputStream stream = scanner.openStream(classPath);\n                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;","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMClassNodeAdapter.java#L79-L115","documentation":"ASMClassNodeAdapter.readStream logs this warning when reading the raw bytecode of a class from the plugin scanner's InputStream fails with an IOException. The adapter returns null, so callers treat the class as unreadable and typically skip transforming that class. It usually indicates a corrupted jar/class file, a truncated stream, or an I/O problem opening the resource inside a jar.","triggerScenarios":"scanner.openStream(classPath) returned a valid stream but IOUtils.toByteArray hit an IOException mid-read — broken/truncated jar entry, corrupted class file, disk or network filesystem errors, or jar being modified concurrently while the agent reads it.","commonSituations":"Hot-deploy/overwriting an application jar while the Pinpoint agent lazily reads classes from it; corrupted fat-jar produced by a failed build; reading classes over a flaky network mount (NFS); zip64 or malformed entries in shaded jars.","solutions":["Verify the jar containing the class is not corrupted (jar tf / unzip -t) and rebuild it if needed","Ensure the application is not overwriting/deleting jars while the agent runs; restart the JVM after redeploying","Check the storage holding the jar (local disk vs NFS) for I/O errors","Exclude the problematic jar/class from plugin transformation if its instrumentation is not required"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// before scanning, validate the jar is readable:\ntry (JarFile jf = new JarFile(path)) { if (jf.getJarEntry(classPath) == null) skip(); }","typeGuard":null,"tryCatchPattern":"try { return IOUtils.toByteArray(stream); } catch (IOException e) { logger.warn(\"bytecode read fail scanner:{} path:{}\", scanner, classPath); return null; }","preventionTips":["Never hot-replace application jars while the JVM and agent are running; restart after redeploy","Verify artifact integrity (checksums) when copying fat-jars across machines/mounts","Avoid reading classpath jars from flaky network filesystems","Rebuild corrupted jars found via unzip -t and redeploy"],"tags":["io","bytecode","jar","class-loading"],"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-17T15:17:12.973Z"}