{"record":{"id":"91a7977d40fd193a","repo":"pinpoint-apm/pinpoint","slug":"pinpoint-bootstrap-already-started-skipping-agent","errorCode":null,"errorMessage":"pinpoint-bootstrap already started. skipping agent loading.","messagePattern":"pinpoint-bootstrap already started\\. skipping agent loading\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"agent-module/bootstraps/bootstrap/src/main/java/com/navercorp/pinpoint/bootstrap/PinpointBootStrap.java","lineNumber":57,"sourceCode":" */\npublic class PinpointBootStrap {\n\n    private static final BootLogger logger = BootLogger.getLogger(PinpointBootStrap.class);\n\n    private static final LoadState STATE = new LoadState();\n\n    public static void premain(String agentArgs, Instrumentation instrumentation) {\n\n        if (DisableOptions.isBootDisabled()) {\n            if (logger.isWarnEnabled()) {\n                logger.warn(\"PinPoint is disabled via Env/Property.\");\n            }\n            return;\n        }\n\n        final boolean success = STATE.start();\n        if (!success) {\n            logger.warn(\"pinpoint-bootstrap already started. skipping agent loading.\");\n            return;\n        }\n\n        PinpointBootStrap bootStrap = new PinpointBootStrap(agentArgs, instrumentation);\n        bootStrap.start();\n\n    }\n\n    private final String agentArgs;\n    private final Instrumentation instrumentation;\n\n    private PinpointBootStrap(String agentArgs, Instrumentation instrumentation) {\n        this.agentArgs = agentArgs;\n        this.instrumentation = Objects.requireNonNull(instrumentation, \"instrumentation\");\n    }\n\n\n    private void start() {","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/bootstraps/bootstrap/src/main/java/com/navercorp/pinpoint/bootstrap/PinpointBootStrap.java#L39-L75","documentation":"LoadState.start() returned false, meaning the bootstrap has already been initialized in this JVM. The premain logs a warning and skips loading to avoid double initialization (duplicate agents, duplicate class instrumentation).","triggerScenarios":"pinpoint-bootstrap.jar is on the bootclasspath/system path AND passed via -javaagent, so premain runs twice; the agent is attached programmatically (attach API) to a JVM that already loaded it; the jar is reloaded by a hot-reload mechanism.","commonSituations":"Misconfigured startup scripts listing the agent twice; using both -javaagent and an attach-based deployment; framework hot-reload triggering re-instrumentation; copying the bootstrap jar into the bootclasspath 'to make sure it loads'.","solutions":["Ensure pinpoint-bootstrap.jar is passed only once via -javaagent and is not also on the classpath/bootclasspath","Do not attach the agent programmatically if it was already loaded at startup","Restart the JVM — the agent cannot be cleanly re-loaded in the same process","If seen after an attach attempt, verify with the agent logs which path loaded it first"],"exampleFix":"// before\njava -javaagent:pinpoint-bootstrap.jar -cp pinpoint-bootstrap.jar -jar app.jar\n// after\njava -javaagent:pinpoint-bootstrap.jar -jar app.jar","handlingStrategy":"validation","validationCode":"// shell: count -javaagent occurrences for pinpoint\nCOUNT=$(echo \"$JAVA_OPTS\" | grep -o 'pinpoint-bootstrap.jar' | wc -l)\n[ \"$COUNT\" -le 1 ] || echo \"pinpoint-bootstrap.jar referenced $COUNT times\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never place pinpoint-bootstrap.jar on the classpath as well as -javaagent","Skip programmatic attach if the agent was loaded at startup","Centralize agent flags in one launch script"],"tags":["java","javaagent","duplicate-load","initialization"],"backgroundTag":"invalid-state-transition","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"}