# APM Agent does not start attach

**URL:** <https://discuss.elastic.co/t/apm-agent-does-not-start-attach/252055>\
**Category:** APM\
**Tags:** java\
**Created:** [October 14, 2020, 1:57pm UTC](https://discuss.elastic.co/t/apm-agent-does-not-start-attach/252055 "2020-10-14T13:57:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MfuentesG](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@MfuentesG](https://discuss.elastic.co/u/MfuentesG)\
**Post date:** [October 14, 2020, 1:57pm UTC](https://discuss.elastic.co/t/apm-agent-does-not-start-attach/252055/1 "2020-10-14T13:57:20Z")

</div>

Hi,

**Kibana version** : 7.9

**Elasticsearch version** : 7.9

**APM Server version** : 7.9.2

**APM Agent language and version** : apm-agent-attach-1.18.1-standalone.jar

**Browser version** : Chrome Versión 86.0.4240.75 (Build oficial) (64 bits)

**Original install method (e.g. download page, yum, deb, from source, etc.) and version** : yum

**Fresh install or upgraded from other version?** not

**Is there anything special in your setup?** not.

**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)** :

**Is there anything special in your setup?** not

**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**:

**Steps to reproduce** :

1. As the agent intrumentation in JVM option does not work, we try to implement the implementation by with attach by PID

/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.265.b01-1.el7\_9.x86\_64/jre/bin/java -jar /opt/AgentAPMElastic/apm-agent-attach-1.18.1-standalone.jar -- **pid 5098**  
2020-10-10 12:02:20.652 INFO Attaching the Elastic APM agent to **5098**

**Errors in browser console (if relevant)**:not

**Provide logs and/or server output (if relevant)**:  
Exception in thread "main" java.lang.IllegalStateException: Error during attachment using: co.elastic.apm.attach.bytebuddy.agent.ByteBuddyAgent$AttachmentProvider$Compound@45fe3ee3  
at co.elastic.apm.attach.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:613)  
at co.elastic.apm.attach.bytebuddy.agent.ByteBuddyAgent.attach(ByteBuddyAgent.java:273)  
at co.elastic.apm.attach.ElasticApmAttacher.attach(ElasticApmAttacher.java:159)  
at co.elastic.apm.attach.RemoteAttacher.main(RemoteAttacher.java:88)  
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 co.elastic.apm.attach.bytebuddy.agent.Attacher.install(Attacher.java:106)  
at co.elastic.apm.attach.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:608)  
... 3 more  
Caused by: java.lang.IllegalStateException: **Target VM did not respond: 5098**  
at co.elastic.apm.attach.bytebuddy.agent.VirtualMachine$ForHotSpot$Connection$Factory$ForSocketFile.connect(VirtualMachine.java:541)  
at co.elastic.apm.attach.bytebuddy.agent.VirtualMachine$ForHotSpot.attach(VirtualMachine.java:256)  
at co.elastic.apm.attach.bytebuddy.agent.VirtualMachine$ForHotSpot.attach(VirtualMachine.java:243)  
... 9 more

**Java WAS:**  
[root@wasdev bin]# /opt/IBM/WebSphere/AppServer/java\_1.8\_64/jre/bin/java -version  
java version "1.8.0\_261"  
Java(TM) SE Runtime Environment (build 8.0.6.15 - pxa6480sr6fp15ifix-20200820\_01(SR6 FP15+IJ26443))  
IBM J9 VM (build 2.9, JRE 1.8.0 Linux amd64-64-Bit Compressed References 20200729\_452626 (JIT enabled, AOT enabled)  
OpenJ9 - 43296bc  
OMR - 08b0594  
IBM - 70917a2)  
JCL - 20200720\_01 based on Oracle jdk8u261-b13

[root@wasdev bin]# **jps -lv**  
3236 sun.tools.jps.Jps -Dapplication.home=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.265.b01-1.el7\_9.x86\_64 -Xms8m

[root@wasdev bin]# ./startServer.sh server1 -profileName Nodo01  
ADMU0116I: Tool information is being logged in file  
/opt/IBM/WebSphere/AppServer/profiles/Nodo01/logs/server1/startServer.log  
ADMU0128I: Starting tool with the Nodo01 profile  
ADMU3100I: Reading configuration for server: server1  
ADMU3200I: Server launched. Waiting for initialization status.  
ADMU3000I: Server server1 open for e-business; **process id is 5098**

root@wasdev bin]# top | grep **5098**  
**5098** root 20 0 3125680 221612 68236 S 0.7 5.3 1:14.16 java

[root@wasdev bin]# /usr/bin/java -jar /opt/AgentAPMElastic/apm-agent-attach-1.18.1-standalone.jar --list  
5226 /opt/AgentAPMElastic/apm-agent-attach-1.18.1-standalone.jar

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 4, 2020, 9:57am UTC](https://discuss.elastic.co/t/apm-agent-does-not-start-attach/252055/2 "2020-11-04T09:57:30Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
