虚拟机里面有2个java进程,一个挂载java agent是正常,sandbox.log有日志输出,另外一个进程挂载java agent提示异常,而且sandbox没有日志输出,提示异常如下:
/tmp/chaosblade/chaosblade-1.6.0/blade p jvm --pid 2160
{"code":63063,"success":false,"error":"/bin/sh -c /usr/local/jdk/bin/java -Xms128M -Xmx128M -Xnoclassgc -ea -Xbootclasspath/a:/usr/local/jdk/lib/tools.jar -jar /tmp/chaosblade/chaosblade-1.6.0/lib/sandbox/lib/sandbox-core.jar 2160 \"/tmp/chaosblade/chaosblade-1.6.0/lib/sandbox/lib/sandbox-agent.jar\" \"home=/tmp/chaosblade/chaosblade-1.6.0/lib/sandbox;token=345049114029;server.ip=127.0.0.1;server.port=8903;namespace=chaosblade\": cmd exec failed, err: com.sun.tools.attach.AgentInitializationException: Agent JAR loaded but agent failed to initialize\n\tat sun.tools.attach.HotSpotVirtualMachine.loadAgent(HotSpotVirtualMachine.java:121)\n\tat com.alibaba.jvm.sandbox.core.CoreLauncher.attachAgent(CoreLauncher.java:61)\n\tat com.alibaba.jvm.sandbox.core.CoreLauncher.\u003cinit\u003e(CoreLauncher.java:20)\n\tat com.alibaba.jvm.sandbox.core.CoreLauncher.main(CoreLauncher.java:43)\nsandbox load jvm failed : Agent JAR loaded but agent failed to initialize\n exit status 255","result":"d32228f5eda6b02c"}
查看应用也有异常日志,如下:
java.lang.NullPointerException
at ch.qos.logback.core.sift.SiftingAppenderBase.stop(SiftingAppenderBase.java:89)
at ch.qos.logback.core.spi.AppenderAttachableImpl.detachAndStopAllAppenders(AppenderAttachableImpl.java:107)
at ch.qos.logback.classic.Logger.detachAndStopAllAppenders(Logger.java:206)
at ch.qos.logback.classic.Logger.recursiveReset(Logger.java:331)
at ch.qos.logback.classic.LoggerContext.reset(LoggerContext.java:223)
at ch.qos.logback.classic.LoggerContext.stop(LoggerContext.java:348)
at com.alibaba.jvm.sandbox.core.util.LogbackUtils.destroy(LogbackUtils.java:54)
at com.alibaba.jvm.sandbox.core.server.jetty.JettyCoreServer.destroy(JettyCoreServer.java:243)
at com.alibaba.jvm.sandbox.core.server.ProxyCoreServer.destroy(ProxyCoreServer.java:44)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.alibaba.jvm.sandbox.agent.AgentLauncher.install(AgentLauncher.java:258)
at com.alibaba.jvm.sandbox.agent.AgentLauncher.agentmain(AgentLauncher.java:110)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
at sun.instrument.InstrumentationImpl.loadClassAndCallAgentmain(InstrumentationImpl.java:411)
Exception in thread "Attach Listener" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
at sun.instrument.InstrumentationImpl.loadClassAndCallAgentmain(InstrumentationImpl.java:411)
Caused by: java.lang.RuntimeException: sandbox attach failed.
at com.alibaba.jvm.sandbox.agent.AgentLauncher.install(AgentLauncher.java:271)
at com.alibaba.jvm.sandbox.agent.AgentLauncher.agentmain(AgentLauncher.java:110)
... 6 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.alibaba.jvm.sandbox.agent.AgentLauncher.install(AgentLauncher.java:256)
... 7 more
Caused by: java.io.IOException: server bind failed.
at com.alibaba.jvm.sandbox.core.server.jetty.JettyCoreServer.bind(JettyCoreServer.java:214)
at com.alibaba.jvm.sandbox.core.server.ProxyCoreServer.bind(ProxyCoreServer.java:39)
... 12 more
Caused by: java.lang.NullPointerException
at ch.qos.logback.core.sift.SiftingAppenderBase.stop(SiftingAppenderBase.java:89)
at ch.qos.logback.core.spi.AppenderAttachableImpl.detachAndStopAllAppenders(AppenderAttachableImpl.java:107)
at ch.qos.logback.classic.Logger.detachAndStopAllAppenders(Logger.java:206)
at ch.qos.logback.classic.Logger.recursiveReset(Logger.java:331)
at ch.qos.logback.classic.LoggerContext.reset(LoggerContext.java:223)
at com.alibaba.jvm.sandbox.core.util.LogbackUtils.init(LogbackUtils.java:33)
at com.alibaba.jvm.sandbox.core.server.jetty.JettyCoreServer$2.process(JettyCoreServer.java:183)
at com.alibaba.jvm.sandbox.core.util.Initializer.initProcess(Initializer.java:91)
at com.alibaba.jvm.sandbox.core.server.jetty.JettyCoreServer.bind(JettyCoreServer.java:180)
... 13 more
Agent failed to start!
虚拟机里面有2个java进程,一个挂载java agent是正常,sandbox.log有日志输出,另外一个进程挂载java agent提示异常,而且sandbox没有日志输出,提示异常如下: /tmp/chaosblade/chaosblade-1.6.0/blade p jvm --pid 2160 {"code":63063,"success":false,"error":"
/bin/sh -c /usr/local/jdk/bin/java -Xms128M -Xmx128M -Xnoclassgc -ea -Xbootclasspath/a:/usr/local/jdk/lib/tools.jar -jar /tmp/chaosblade/chaosblade-1.6.0/lib/sandbox/lib/sandbox-core.jar 2160 \"/tmp/chaosblade/chaosblade-1.6.0/lib/sandbox/lib/sandbox-agent.jar\" \"home=/tmp/chaosblade/chaosblade-1.6.0/lib/sandbox;token=345049114029;server.ip=127.0.0.1;server.port=8903;namespace=chaosblade\"
: cmd exec failed, err: com.sun.tools.attach.AgentInitializationException: Agent JAR loaded but agent failed to initialize\n\tat sun.tools.attach.HotSpotVirtualMachine.loadAgent(HotSpotVirtualMachine.java:121)\n\tat com.alibaba.jvm.sandbox.core.CoreLauncher.attachAgent(CoreLauncher.java:61)\n\tat com.alibaba.jvm.sandbox.core.CoreLauncher.\u003cinit\u003e(CoreLauncher.java:20)\n\tat com.alibaba.jvm.sandbox.core.CoreLauncher.main(CoreLauncher.java:43)\nsandbox load jvm failed : Agent JAR loaded but agent failed to initialize\n exit status 255","result":"d32228f5eda6b02c"}查看应用也有异常日志,如下: java.lang.NullPointerException at ch.qos.logback.core.sift.SiftingAppenderBase.stop(SiftingAppenderBase.java:89) at ch.qos.logback.core.spi.AppenderAttachableImpl.detachAndStopAllAppenders(AppenderAttachableImpl.java:107) at ch.qos.logback.classic.Logger.detachAndStopAllAppenders(Logger.java:206) at ch.qos.logback.classic.Logger.recursiveReset(Logger.java:331) at ch.qos.logback.classic.LoggerContext.reset(LoggerContext.java:223) at ch.qos.logback.classic.LoggerContext.stop(LoggerContext.java:348) at com.alibaba.jvm.sandbox.core.util.LogbackUtils.destroy(LogbackUtils.java:54) at com.alibaba.jvm.sandbox.core.server.jetty.JettyCoreServer.destroy(JettyCoreServer.java:243) at com.alibaba.jvm.sandbox.core.server.ProxyCoreServer.destroy(ProxyCoreServer.java:44) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.alibaba.jvm.sandbox.agent.AgentLauncher.install(AgentLauncher.java:258) at com.alibaba.jvm.sandbox.agent.AgentLauncher.agentmain(AgentLauncher.java:110) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386) at sun.instrument.InstrumentationImpl.loadClassAndCallAgentmain(InstrumentationImpl.java:411) Exception in thread "Attach Listener" java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386) at sun.instrument.InstrumentationImpl.loadClassAndCallAgentmain(InstrumentationImpl.java:411) Caused by: java.lang.RuntimeException: sandbox attach failed. at com.alibaba.jvm.sandbox.agent.AgentLauncher.install(AgentLauncher.java:271) at com.alibaba.jvm.sandbox.agent.AgentLauncher.agentmain(AgentLauncher.java:110) ... 6 more Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.alibaba.jvm.sandbox.agent.AgentLauncher.install(AgentLauncher.java:256) ... 7 more Caused by: java.io.IOException: server bind failed. at com.alibaba.jvm.sandbox.core.server.jetty.JettyCoreServer.bind(JettyCoreServer.java:214) at com.alibaba.jvm.sandbox.core.server.ProxyCoreServer.bind(ProxyCoreServer.java:39) ... 12 more Caused by: java.lang.NullPointerException at ch.qos.logback.core.sift.SiftingAppenderBase.stop(SiftingAppenderBase.java:89) at ch.qos.logback.core.spi.AppenderAttachableImpl.detachAndStopAllAppenders(AppenderAttachableImpl.java:107) at ch.qos.logback.classic.Logger.detachAndStopAllAppenders(Logger.java:206) at ch.qos.logback.classic.Logger.recursiveReset(Logger.java:331) at ch.qos.logback.classic.LoggerContext.reset(LoggerContext.java:223) at com.alibaba.jvm.sandbox.core.util.LogbackUtils.init(LogbackUtils.java:33) at com.alibaba.jvm.sandbox.core.server.jetty.JettyCoreServer$2.process(JettyCoreServer.java:183) at com.alibaba.jvm.sandbox.core.util.Initializer.initProcess(Initializer.java:91) at com.alibaba.jvm.sandbox.core.server.jetty.JettyCoreServer.bind(JettyCoreServer.java:180) ... 13 more Agent failed to start!