Yourkit UI 抛出“没有在 localhost 上运行的应用程序配置为侦听端口的分析器代理”异常

Posted

技术标签:

【中文标题】Yourkit UI 抛出“没有在 localhost 上运行的应用程序配置为侦听端口的分析器代理”异常【英文标题】:Yourkit UI throwing "There's no application running at localhost with profiler agent configured to listen on port" exception 【发布时间】:2018-05-06 13:18:28 【问题描述】:

我正在尝试分析部署在 Jboss 中的远程应用程序。到目前为止,我可以连接到远程服务器并查看我的应用程序,我也可以连接到应用程序。但是当我点击“Start CPU profiling”时,它需要很长时间并且大多数时候会导致以下异常:

There's no application running at localhost with profiler agent configured to listen on port 59462
or profiler agent is incompatible with current version of profiler

虽然有时(很少)它会启动分析并给我想要的结果。但我无法理解这种不一致的行为,我也不明白为什么它会给我一个错误,说“没有应用程序在 localhost 上运行......”考虑到我正在尝试分析远程应用程序。

安装 UI 的机器上的片段:

18.04-61 8341.339: com.yourkit.k.jm: LC@7fc6aab9localhost:59131,pid=23651: com.yourkit.b.bb: Bad stream from profiled application
Technical detail: EOF
   at com.yourkit.b.o.a(a:211)
   at com.yourkit.b.o.b(a:53)
   at com.yourkit.b.q.a(a:3385)
   at com.yourkit.b.q.updateTables(a:320)
   at com.yourkit.api.ControllerImpl$31.perform(a:12)
   at com.yourkit.api.ControllerImpl.makeRequest(a:18)
   at com.yourkit.api.ControllerImpl.makeRequest(a:534)
   at com.yourkit.api.ControllerImpl.updateDatabaseTables(a:200)
   at com.yourkit.k.jd.b(a:119)
   at com.yourkit.k.jd.b(a:286)
   at com.yourkit.k.jm.a(a:150)
   at com.yourkit.api.ControllerImpl$30.perform(a:3)
   at com.yourkit.api.ControllerImpl.makeRequest(a:163)
   at com.yourkit.api.ControllerImpl.makeRequest(a:534)
   at com.yourkit.api.ControllerImpl.runBatch(a:544)
   at com.yourkit.k.jm.run(a:150)

18.04-61 8341.339: com.yourkit.k.jm: LC@924ccd1localhost:59570,pid=23851: com.yourkit.b.bb: Bad stream from profiled application
Technical detail: EOF
   at com.yourkit.b.o.a(a:211)
   at com.yourkit.b.o.b(a:60)
   at com.yourkit.b.q.a(a:1275)
   at com.yourkit.b.q.updateTables(a:320)
   at com.yourkit.api.ControllerImpl$31.perform(a:12)
   at com.yourkit.api.ControllerImpl.makeRequest(a:18)
   at com.yourkit.api.ControllerImpl.makeRequest(a:534)
   at com.yourkit.api.ControllerImpl.updateDatabaseTables(a:200)
   at com.yourkit.k.jd.b(a:119)
   at com.yourkit.k.jd.b(a:286)
   at com.yourkit.k.jm.a(a:150)
   at com.yourkit.api.ControllerImpl$30.perform(a:3)
   at com.yourkit.api.ControllerImpl.makeRequest(a:163)
   at com.yourkit.api.ControllerImpl.makeRequest(a:534)
   at com.yourkit.api.ControllerImpl.runBatch(a:544)
   at com.yourkit.k.jm.run(a:150)

18.04-61 8341.339: com.yourkit.k.jm: LC@1fe95a4blocalhost:59991,pid=23983: com.yourkit.b.bb: Bad stream from profiled application
Technical detail: EOF
   at com.yourkit.b.o.a(a:211)
   at com.yourkit.b.o.b(a:74)
   at com.yourkit.b.q.a(a:1854)
   at com.yourkit.b.q.updateTables(a:320)
   at com.yourkit.api.ControllerImpl$31.perform(a:12)
   at com.yourkit.api.ControllerImpl.makeRequest(a:18)
   at com.yourkit.api.ControllerImpl.makeRequest(a:534)
   at com.yourkit.api.ControllerImpl.updateDatabaseTables(a:200)
   at com.yourkit.k.jd.b(a:119)
   at com.yourkit.k.jd.b(a:286)
   at com.yourkit.k.jm.a(a:150)
   at com.yourkit.api.ControllerImpl$30.perform(a:3)
   at com.yourkit.api.ControllerImpl.makeRequest(a:163)
   at com.yourkit.api.ControllerImpl.makeRequest(a:534)
   at com.yourkit.api.ControllerImpl.runBatch(a:544)
   at com.yourkit.k.jm.run(a:150)

18.04-61 8344.342: com.yourkit.k.jm: LC@1fe95a4blocalhost:59991,pid=23983: com.yourkit.util.bs: There's no application running at localhost with profiler agent configured to listen on port 59991
   at com.yourkit.api.ControllerImpl.transformException(a:273)
   at com.yourkit.api.ControllerImpl.makeRequest(a:293)
   at com.yourkit.api.ControllerImpl.makeRequest(a:534)
   at com.yourkit.api.ControllerImpl.runBatch(a:544)
   at com.yourkit.k.jm.run(a:150)

18.04-61 8346.665: com.yourkit.b.bh: LC@74c29709localhost:60361,pid=23651: created; local=false
18.04-61 8347.545: com.yourkit.b.q: snapshot_outer: starting: null
18.04-61 8347.545: com.yourkit.k.jm: LC@1fe95a4blocalhost:59991,pid=23983: com.yourkit.util.bs: There's no application running at localhost with profiler agent configured to listen on port 59991
   at com.yourkit.api.ControllerImpl.transformException(a:273)
   at com.yourkit.api.ControllerImpl.makeRequest(a:293)
   at com.yourkit.api.ControllerImpl.makeRequest(a:534)
   at com.yourkit.api.ControllerImpl.runBatch(a:544)
   at com.yourkit.k.jm.run(a:150)

18.04-61 8347.545: com.yourkit.k.jm: LC@1fe95a4blocalhost:59991,pid=23983: disconnected
18.04-61 8347.545: com.yourkit.b.q: controller telemetry limit: 3600
18.04-61 8347.545: com.yourkit.b.q: snapshot_outer: done in 0 sec: null
18.04-61 8379.660: com.yourkit.k.my: error: com.yourkit.util.bs: There's no application running at localhost with profiler agent configured to listen on port 60361
or profiler agent is incompatible with current version of profiler
   at com.yourkit.api.ControllerImpl.transformException(a:278)
   at com.yourkit.api.ControllerImpl.makeRequest(a:293)
   at com.yourkit.api.ControllerImpl.makeRequest(a:534)
   at com.yourkit.api.ControllerImpl.startCpuProfiling(a:154)
   at com.yourkit.k.kt.a(a:92)
   at com.yourkit.k.jo.b(a:60)
   at com.yourkit.k.d.al.a(a:183)
   at com.yourkit.k.dz.run(a:16)
Caused by: java.net.SocketTimeoutException: Read timed out
   at java.net.SocketInputStream.socketRead0(Native Method)
   at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
   at java.net.SocketInputStream.read(SocketInputStream.java:171)
   at java.net.SocketInputStream.read(SocketInputStream.java:141)
   at com.yourkit.b.bj.read(a:21)
   at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
   at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
   at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
   at java.io.DataInputStream.readFully(DataInputStream.java:195)
   at java.io.DataInputStream.readLong(DataInputStream.java:416)
   at com.yourkit.runtime.Packet.readHeader(a:3)
   at com.yourkit.runtime.Packet.readHeader(a:51)
   at com.yourkit.runtime.Packet.readHeaderWithStandardResponse(a:17)
   at com.yourkit.api.ControllerImpl.readHeaderWithStandardResponse(a:10)
   at com.yourkit.api.ControllerImpl.access$100(a:558)
   at com.yourkit.api.ControllerImpl$3.perform(a:8)
   at com.yourkit.api.ControllerImpl.makeRequest(a:163)
   ... 6 more

18.04-61 9097.534: com.yourkit.k.my: error: com.yourkit.util.bs: There's no application running at localhost with profiler agent configured to listen on port 60361
or profiler agent is incompatible with current version of profiler
   at com.yourkit.api.ControllerImpl.transformException(a:278)
   at com.yourkit.api.ControllerImpl.makeRequest(a:293)
   at com.yourkit.api.ControllerImpl.makeRequest(a:534)
   at com.yourkit.api.ControllerImpl.startCpuProfiling(a:154)
   at com.yourkit.k.kt.a(a:92)
   at com.yourkit.k.jo.b(a:60)
   at com.yourkit.k.d.al.a(a:183)
   at com.yourkit.k.dz.run(a:16)
Caused by: java.net.SocketTimeoutException: Read timed out
   at java.net.SocketInputStream.socketRead0(Native Method)
   at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
   at java.net.SocketInputStream.read(SocketInputStream.java:171)
   at java.net.SocketInputStream.read(SocketInputStream.java:141)
   at com.yourkit.b.bj.read(a:21)
   at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
   at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
   at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
   at java.io.DataInputStream.readFully(DataInputStream.java:195)
   at java.io.DataInputStream.readLong(DataInputStream.java:416)
   at com.yourkit.runtime.Packet.readHeader(a:3)
   at com.yourkit.runtime.Packet.readHeader(a:51)
   at com.yourkit.runtime.Packet.readHeaderWithStandardResponse(a:17)
   at com.yourkit.api.ControllerImpl.readHeaderWithStandardResponse(a:10)
   at com.yourkit.api.ControllerImpl.access$100(a:558)
   at com.yourkit.api.ControllerImpl$3.perform(a:8)
   at com.yourkit.api.ControllerImpl.makeRequest(a:163)
   ... 6 more

18.04-61 9191.727: com.yourkit.k.jm: LC@74c29709localhost:60361,pid=23651: com.yourkit.util.bs: There's no application running at localhost with profiler agent configured to listen on port 60361
or profiler agent is incompatible with current version of profiler
   at com.yourkit.api.ControllerImpl.transformException(a:278)
   at com.yourkit.api.ControllerImpl.makeRequest(a:293)
   at com.yourkit.api.ControllerImpl.makeRequest(a:534)
   at com.yourkit.api.ControllerImpl.getStatus(a:308)
   at com.yourkit.api.ControllerImpl.cacheStatuses(a:175)
   at com.yourkit.k.jd.b(a:130)
   at com.yourkit.k.jd.b(a:286)
   at com.yourkit.k.jm.a(a:150)
   at com.yourkit.api.ControllerImpl$30.perform(a:3)
   at com.yourkit.api.ControllerImpl.makeRequest(a:163)
   at com.yourkit.api.ControllerImpl.makeRequest(a:534)
   at com.yourkit.api.ControllerImpl.runBatch(a:544)
   at com.yourkit.k.jm.run(a:150)
Caused by: java.io.EOFException
   at java.io.DataInputStream.readFully(DataInputStream.java:197)
   at java.io.DataInputStream.readLong(DataInputStream.java:416)
   at com.yourkit.runtime.Packet.readHeader(a:3)
   at com.yourkit.runtime.Packet.readHeader(a:51)
   at com.yourkit.runtime.Packet.readHeaderWithStandardResponse(a:17)
   at com.yourkit.api.ControllerImpl.readHeaderWithStandardResponse(a:10)
   at com.yourkit.api.ControllerImpl.access$100(a:558)
   at com.yourkit.api.ControllerImpl$2.perform(a:5)
   at com.yourkit.api.ControllerImpl.makeRequest(a:18)
   ... 11 more

18.04-61 9268.954: com.yourkit.h.c.k: SSH: delPortForwarding error: Task java.util.concurrent.FutureTask@3ea383e2 rejected from java.util.concurrent.ThreadPoolExecutor@60cb8835[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 55]
18.04-61 9271.891: com.yourkit.h.a.e: 
  cmd: /home/dpagmk/software/jdk1.7.0_45/jre/bin/java -cp .yjp/2018.04-b61/lib/yourkit.jar -Dfile.encoding=UTF-8 -Dyk.logger.stdErrOnly=true com.yourkit.Main -host-server
  request: getVmInfos
  exit code: -1
  stdout:
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f509d520ac0, pid=16167, tid=139984557885184
#
# JRE version: Java(TM) SE Runtime Environment (7.0_45-b18) (build 1.7.0_45-b18)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.45-b08 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  [libyjpagent.so+0x14cac0]  Options::containsSubstring(YStringImpl<char> const&)+0x0
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /home/admin/hs_err_pid16167.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

18.04-61 9278.271: com.yourkit.b.bh: LC@3f153e3localhost:61219,pid=23720: created; local=false
18.04-61 9279.359: com.yourkit.b.q: snapshot_outer: starting: null
18.04-61 9279.359: com.yourkit.b.q: controller telemetry limit: 3600
18.04-61 9279.359: com.yourkit.b.q: snapshot_outer: done in 0 sec: null
18.04-61 9313.164: com.yourkit.k.my: error: com.yourkit.util.bs: There's no application running at localhost with profiler agent configured to listen on port 61219
or profiler agent is incompatible with current version of profiler
   at com.yourkit.api.ControllerImpl.transformException(a:278)
   at com.yourkit.api.ControllerImpl.makeRequest(a:293)
   at com.yourkit.api.ControllerImpl.makeRequest(a:534)
   at com.yourkit.api.ControllerImpl.startCpuProfiling(a:154)
   at com.yourkit.k.kt.a(a:92)
   at com.yourkit.k.jo.b(a:60)
   at com.yourkit.k.d.al.a(a:183)
   at com.yourkit.k.dz.run(a:16)
Caused by: java.net.SocketTimeoutException: Read timed out
   at java.net.SocketInputStream.socketRead0(Native Method)
   at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
   at java.net.SocketInputStream.read(SocketInputStream.java:171)
   at java.net.SocketInputStream.read(SocketInputStream.java:141)
   at com.yourkit.b.bj.read(a:21)
   at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
   at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
   at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
   at java.io.DataInputStream.readFully(DataInputStream.java:195)
   at java.io.DataInputStream.readLong(DataInputStream.java:416)
   at com.yourkit.runtime.Packet.readHeader(a:3)
   at com.yourkit.runtime.Packet.readHeader(a:51)
   at com.yourkit.runtime.Packet.readHeaderWithStandardResponse(a:17)
   at com.yourkit.api.ControllerImpl.readHeaderWithStandardResponse(a:10)
   at com.yourkit.api.ControllerImpl.access$100(a:558)
   at com.yourkit.api.ControllerImpl$3.perform(a:8)
   at com.yourkit.api.ControllerImpl.makeRequest(a:163)
   ... 6 more

如果有人能解释和指导这件事,那就太好了。

提前致谢!

【问题讨论】:

【参考方案1】:

所以我终于在 Yourkit 支持团队的帮助下解决了我的问题。这是他们告诉我的:

请尝试通过以下方式增加分析器分析器 UI 的套接字超时 指定 -Dyk.controller.connect.timeout.ms=(默认为 5000 ms = 5 s) 和 -Dyk.controller.read.timeout.ms= (默认 在 /.yjp/ui.ini 中是 30000 ms = 30 s)

例如设置

-Dyk.controller.connect.timeout.ms=60000 -Dyk.controller.read.timeout.ms=60000

我希望它对面临同样问题的其他人有所帮助。

【讨论】:

【参考方案2】:

我刚刚遇到了同样的奇怪行为。一天前,我设法远程分析了该应用程序,但今天没有。我通过 SSH 连接到远程 JVM,并且没有更改任何设置。

【讨论】:

对我来说也不一致。您是否碰巧知道为什么它在异常中引用特定的端口号?当它说“localhost”时,它是指哪台机器?是代理的 localhost 还是 UI 应用程序的 localhost?

以上是关于Yourkit UI 抛出“没有在 localhost 上运行的应用程序配置为侦听端口的分析器代理”异常的主要内容,如果未能解决你的问题,请参考以下文章

YourKit 未显示完整信息

是否有用于分析 yourkit 快照(内存/cpu)的 API? [关闭]

使用 Yourkit 分析 Spray HTTP 应用程序

Yourkit 在次要 GC 集合中延长 STW 暂停?

如何使用 YourKit 分析 Domino 代理 (AMgr)?

yourkit cpu view 和 top 命令 - 显示不同的结果