Cannot attach to JVM VirtualMachineImpl

If you are having issue in monitoring a process and seeing an error similar to as posted below with a suggestion at the end of the message "Try restarting the process to restore its attach capability"

Then first thing to try is to restart the process which is currently not getting monitored. This should most likely resolve the issue. Please contact support if the issue persists.

2018-10-30T12:40:30.192+01:00 | ERROR | m.instana.plugin.java.3681attach | aagentLoaderImpl | com.instana.agent - 1.1.461 | Cannot attach to JVM VirtualMachineImpl [attachType=HOTSPOT_TOOLS, hasAttachFile=true, commandLine=org.elasticsearch.bootstrap.Elasticsearch -p /var/run/elasticsearch/elasticsearch.pid --quiet, vmArgs=-Xms3g -Xmx3g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+AlwaysPreTouch -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -XX:-OmitStackTraceInFastThrow -Dio.netty.noUnsafe=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Djava.io.tmpdir=/tmp/elasticsearch.JvZPeROJ -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/lib/dump/ -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime -Xloggc:/var/log/elasticsearch/gc.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=32 -XX:GCLogFileSize=64m -Des.path.home=/usr/share/elasticsearch -Des.path.conf=/etc/elasticsearch, pid=3681, name=OpenJDK 64-Bit Server VM, vendor=Oracle Corporation, version=1.8.0_171, build=25.171-b11, heapCapacity=3221225472, process=SigarProcessImpl [pid=3681, parentPid=<lazy>, name=/usr/bin/java, directory=/usr/share/elasticsearch, executable=/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java, arguments=[-Xms3g, -Xmx3g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.io.tmpdir=/tmp/elasticsearch.JvZPeROJ, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=/var/lib/dump/, -XX:+PrintGCDetails, -XX:+PrintGCDateStamps, -XX:+PrintTenuringDistribution, -XX:+PrintGCApplicationStoppedTime, -Xloggc:/var/log/elasticsearch/gc.log, -XX:+UseGCLogFileRotation, -XX:NumberOfGCLogFiles=32, -XX:GCLogFileSize=64m, -Des.path.home=/usr/share/elasticsearch, -Des.path.conf=/etc/elasticsearch, -cp, /usr/share/elasticsearch/lib/*, org.elasticsearch.bootstrap.Elasticsearch, -p, /var/run/elasticsearch/elasticsearch.pid, --quiet], userName=<lazy>, groupName=<lazy>]] - Try restarting the process to restore its attach capability.

 

Additional recommended actions:

Check the version of the used technologies e.g. Weblogic, Java in order to verify that they are supported.
I would recommend restarting JVM if it is possible. Stop agent, restart JVM and then start agent again.

If the JVM can not be restarted due to being PROD or any other reason - Check why the agent cannot attach. It should be in debug logs.

Have more questions? Submit a request

Comments