Cannot connect to profile remote agent

Questions about YourKit Java Profiler
Post Reply
ramanja
Posts: 3
Joined: Wed Jul 01, 2020 4:56 am

Cannot connect to profile remote agent

Post by ramanja »

I started remote application with agent and application is running in the Docker Container.
When I tried to connect to the agent and profile, my UI says Remote application is being profiled for couple seconds and after that "Remote Application abcxyz.war at 192.XXX.XXX.XXX:XXXXXX has terminated or connection lost.
I see below in the logs at remote agent
19.1-133 1489.595: F_B_S_W: 25327108
19.1-133 1489.596: SP: pin java.io.EOFException
19.1-133 1489.598: error: exception in dispatchRequest(): 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(Packet.java:50)
at com.yourkit.runtime.RequestProcessing.dispatchRequest(RequestProcessing.java:31)
at com.yourkit.runtime.Core$4.run(Core.java:791)
at java.lang.Thread.run(Thread.java:748)


and UI log says

19.1-133 5.644: com.yourkit.n.ja: LC@683d5ce6{192.168.102.241:32555,pid=1}: com.yourkit.util.bu: There's no application running at 192.168.102.241 with profiler agent configured to listen on port 32555
or profiler agent is incompatible with current version of profiler
at com.yourkit.api.ControllerImpl.transformException(a:157)
at com.yourkit.api.ControllerImpl.makeRequest(a:392)
at com.yourkit.api.ControllerImpl.makeRequest(a:135)
at com.yourkit.api.ControllerImpl.updateDatabaseTables(a:448)
at com.yourkit.n.ir.b(a:119)
at com.yourkit.n.ir.b(a:309)
at com.yourkit.n.ja.a(a:90)
at com.yourkit.api.ControllerImpl$30.perform(a:3)
at com.yourkit.api.ControllerImpl.makeRequest(a:209)
at com.yourkit.api.ControllerImpl.makeRequest(a:135)
at com.yourkit.api.ControllerImpl.runBatch(a:190)
at com.yourkit.n.ja.run(a:90)
Caused by: com.yourkit.api.ControllerImpl$DifferentProfiledProcessRespondedException: A different process is now listening at the same host:port. The profiled application likely restarted.
at com.yourkit.api.ControllerImpl.readAndValidateSessionId(a:155)
at com.yourkit.api.ControllerImpl.readHeaderWithStandardResponse(a:257)
at com.yourkit.api.ControllerImpl.access$200(a:569)
at com.yourkit.api.ControllerImpl$31.perform(a:21)
at com.yourkit.api.ControllerImpl.makeRequest(a:307)
... 10 more
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Cannot connect to profile remote agent

Post by Anton Katilin »

You're using old unsupported version.

Please use the released version 2019.8 instead:
https://www.yourkit.com/download/
https://www.yourkit.com/docs/java/help/docker.jsp

or 2020.7 early access:
https://www.yourkit.com/eap/
URL for docker is https://www.yourkit.com/download/YourKi ... docker.zip
Please replace in instructions accordingly. Also change all "2019.8" with "2020.7".
ramanja
Posts: 3
Joined: Wed Jul 01, 2020 4:56 am

Re: Cannot connect to profile remote agent

Post by ramanja »

Hi,
Updated the Yourkit agent to latest version 2019.8-b141.
I am still getting error in the UI

19.8-141 455320.027: com.yourkit.o.f.by: LC@1b8e943{192.168.101.198:32555,pid=1}: com.yourkit.util.bm: There's no application running at 192.168.101.198 with profiler agent configured to listen on port 32555
or profiler agent is incompatible with current version of profiler
at com.yourkit.api.ControllerImpl.transformException(a:335)
at com.yourkit.api.ControllerImpl.makeRequest(a:311)
at com.yourkit.api.ControllerImpl.makeRequest(a:109)
at com.yourkit.api.ControllerImpl.updateDatabaseTables(a:648)
at com.yourkit.o.f.bp.b(a:110)
at com.yourkit.o.f.bp.b(a:306)
at com.yourkit.o.f.by.a(a:59)
at com.yourkit.api.ControllerImpl$30.perform(a:9)
at com.yourkit.api.ControllerImpl.makeRequest(a:501)
at com.yourkit.api.ControllerImpl.makeRequest(a:109)
at com.yourkit.api.ControllerImpl.runBatch(a:164)
at com.yourkit.o.f.by.run(a:59)
Caused by: com.yourkit.api.ControllerImpl$DifferentProfiledProcessRespondedException: A different process is now listening at the same host:port. The profiled application likely restarted.
at com.yourkit.api.ControllerImpl.readAndValidateSessionId(a:260)
at com.yourkit.api.ControllerImpl.readHeaderWithStandardResponse(a:544)
at com.yourkit.api.ControllerImpl.access$200(a:381)
at com.yourkit.api.ControllerImpl$31.perform(a:13)
at com.yourkit.api.ControllerImpl.makeRequest(a:190)
... 10 more


In the agent
19.8-141 0.915: GcPauseCounter: installed to G1 Young Generation
19.8-141 0.915: GcPauseCounter: installed to G1 Old Generation
19.8-141 0.921: processorCount=2
19.8-141 0.924: SP: pin java.lang.NoSuchFieldError
19.8-141 1.546: SP: pin java.io.FileNotFoundException
19.8-141 1.718: SP: pin java.security.PrivilegedActionException
19.8-141 2.266: SP: pin java.lang.IllegalArgumentException
19.8-141 2.281: SP: pin java.security.AccessControlException
19.8-141 4.685: SP: pin org.apache.xerces.impl.XMLEntityScanner$1
19.8-141 9.355: tracing=off: large method: 4120 sun.text.resources.FormatData.getContents()
19.8-141 9.375: tracing=off: large method: 8619 sun.util.resources.CurrencyNames.getContents()
19.8-141 9.485: [m: 6109 271] total classes: processed=2000 instrumented=1804 788ms
19.8-141 9.811: tracing=off: large method: 17796 sun.util.resources.TimeZoneNames.getContents()
19.8-141 12.764: SP: pin java.lang.NoSuchMethodError
19.8-141 13.634: SP: pin javax.naming.NoInitialContextException
19.8-141 16.524: SP: pin java.lang.InterruptedException
19.8-141 16.674: [m: 6375 502] total classes: processed=3000 instrumented=2707 1254ms
19.8-141 17.258: SP: pin javax.validation.ValidationException
19.8-141 22.011: SP: pin java.lang.IncompatibleClassChangeError
19.8-141 22.589: [m: 6381 673] total classes: processed=4000 instrumented=3622 1845ms
19.8-141 26.529: tracing=off: large method: 2455 java.awt.event.KeyEvent.getKeyText(int)
19.8-141 30.663: tracing=off: large method: 5085 org.springframework.asm.ClassReader.readCode(org.springframework.asm.MethodVisitor, org.springframework.asm.Context, int)
19.8-141 32.731: SP: pin java.net.UnknownHostException
19.8-141 32.798: SP: pin java.net.SocketException
19.8-141 32.944: SP: pin org.springframework.beans.factory.NoSuchBeanDefinitionException
19.8-141 33.183: [m: 6394 936] total classes: processed=5000 instrumented=4457 2323ms
19.8-141 34.884: SP: pin java.net.MalformedURLException
19.8-141 41.616: SP: pin java.lang.NoClassDefFoundError
19.8-141 42.777: SP: pin java.lang.IllegalStateException
19.8-141 45.440: [m: 6465 1029] total classes: processed=6000 instrumented=5169 2666ms
19.8-141 56.346: warning: resulting bytecode is too long, trying a fallback: vue/exam/core/content/NodeType <clinit> ()V
19.8-141 61.853: [m: 6471 1047] total classes: processed=7000 instrumented=6050 3220ms
19.8-141 62.135: tracing=off: large method: 2305 org.springframework.asm.Frame.execute(int, int, org.springframework.asm.Symbol, org.springframework.asm.SymbolTable)
19.8-141 62.338: SP: pin org.springframework.cglib.core.ClassNameReader$EarlyExitException
19.8-141 66.707: tracing=off: large method: 2346 com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next()
19.8-141 66.872: tracing=off: large method: 3807 com.sun.crypto.provider.SunJCE$1.run()
19.8-141 67.050: SP: pin java.util.MissingResourceException
19.8-141 67.053: SP: pin java.lang.reflect.InvocationTargetException
19.8-141 73.795: SP: pin java.lang.UnsatisfiedLinkError
19.8-141 73.798: SP: pin org.apache.tomcat.jni.LibraryNotFoundError
19.8-141 74.403: [m: 6544 1080] total classes: processed=8000 instrumented=6862 3612ms
19.8-141 77.943: tracing=off: large method: 2539 org.apache.tomcat.util.net.openssl.ciphers.OpenSSLCipherConfigurationParser.init()
19.8-141 79.240: tracing=off: large method: 2665 org.apache.catalina.core.StandardWrapperValve.invoke(org.apache.catalina.connector.Request, org.apache.catalina.connector.Response)
19.8-141 89.647: SP: pin java.io.IOException
19.8-141 99.218: [m: 6552 1099] total classes: processed=9000 instrumented=7749 3961ms
19.8-141 103.259: tracing=off: large method: 3852 com.sun.crypto.provider.AESCrypt.decryptBlock(byte[], int, byte[], int)
19.8-141 107.035: tracing=off: large method: 5015 org.mariadb.jdbc.MariaDbDatabaseMetaData.getTypeInfo()
19.8-141 112.520: tracing=off: large method: 2369 liquibase.database.core.DerbyDatabase.<init>()
19.8-141 112.641: tracing=off: large method: 2097 liquibase.database.core.MySQLDatabase.createReservedWords()
19.8-141 116.994: tracing=off: large method: 2277 liquibase.sqlgenerator.core.CreateTableGenerator.generateSql(liquibase.statement.core.CreateTableStatement, liquibase.database.Database, liquibase.sqlgenerator.SqlGeneratorChain)
19.8-141 124.588: [m: 6820 1181] total classes: processed=10000 instrumented=8699 4422ms
19.8-141 128.623: SP: pin liquibase.exception.UnexpectedLiquibaseException
19.8-141 129.108: SP: pin java.lang.NullPointerException
19.8-141 138.623: tracing=off: large method: 4628 liquibase.util.grammar.SimpleSqlGrammarTokenManager.jjMoveNfa_0(int, int)
19.8-141 145.072: SP: pin liquibase.exception.PreconditionFailedException
19.8-141 149.497: tracing=off: large method: 2243 org.hibernate.dialect.Cache71Dialect.commonRegistration()
19.8-141 149.601: tracing=off: large method: 2305 org.hibernate.dialect.CUBRIDDialect.<init>()
19.8-141 150.036: tracing=off: large method: 2311 org.hibernate.dialect.AbstractHANADialect.<init>()
19.8-141 156.191: SP: pin org.hibernate.HibernateException
19.8-141 169.881: [m: 6828 1267] total classes: processed=11000 instrumented=9596 4795ms
19.8-141 189.362: tracing=off: large method: 2208 org.hibernate.engine.jdbc.env.spi.AnsiSqlKeywords.<init>()
19.8-141 194.904: tracing=off: large method: 4602 org.hibernate.cfg.AnnotationBinder.processElementAnnotations(org.hibernate.cfg.PropertyHolder, org.hibernate.cfg.annotations.Nullability, org.hibernate.cfg.PropertyData, java.util.HashMap, org.hibernate.cfg.annotations.EntityBinder, boolean, boolean, boolean, org.hibernate.boot.spi.MetadataBuildingContext, java.util.Map)
19.8-141 199.515: [m: 6832 1414] total classes: processed=12000 instrumented=10352 5166ms
19.8-141 201.522: tracing=off: large method: 2205 org.hibernate.cfg.annotations.CollectionBinder.bindManyToManySecondPass(org.hibernate.mapping.Collection, java.util.Map, org.hibernate.cfg.Ejb3JoinColumn[], org.hibernate.cfg.Ejb3JoinColumn[], org.hibernate.cfg.Ejb3Column[], boolean, org.hibernate.annotations.common.reflection.XClass, boolean, boolean, boolean, org.hibernate.cfg.annotations.TableBinder, org.hibernate.annotations.common.reflection.XProperty, org.hibernate.cfg.PropertyHolder, org.hibernate.boot.spi.MetadataBuildingContext)
19.8-141 219.557: SP: pin org.hibernate.boot.registry.classloading.spi.ClassLoadingException
19.8-141 231.216: tracing=off: large method: 2529 org.hibernate.persister.entity.SingleTableEntityPersister.<init>(org.hibernate.mapping.PersistentClass, org.hibernate.cache.spi.access.EntityDataAccess, org.hibernate.cache.spi.access.NaturalIdDataAccess, org.hibernate.persister.spi.PersisterCreationContext)
19.8-141 231.254: tracing=off: large method: 2642 org.hibernate.persister.entity.AbstractEntityPersister.<init>(org.hibernate.mapping.PersistentClass, org.hibernate.cache.spi.access.EntityDataAccess, org.hibernate.cache.spi.access.NaturalIdDataAccess, org.hibernate.persister.spi.PersisterCreationContext)
19.8-141 233.304: [m: 6838 1433] total classes: processed=13000 instrumented=11069 5535ms
19.8-141 236.167: tracing=off: large method: 5171 net.bytebuddy.dynamic.scaffold.InstrumentedType$Default.validated()
19.8-141 246.540: tracing=off: large method: 2318 net.bytebuddy.jar.asm.Frame.execute(int, int, net.bytebuddy.jar.asm.Symbol, net.bytebuddy.jar.asm.SymbolTable)
19.8-141 252.023: SP: pin org.hibernate.MappingException
19.8-141 254.254: tracing=off: large method: 3339 org.hibernate.persister.entity.JoinedSubclassEntityPersister.<init>(org.hibernate.mapping.PersistentClass, org.hibernate.cache.spi.access.EntityDataAccess, org.hibernate.cache.spi.access.NaturalIdDataAccess, org.hibernate.persister.spi.PersisterCreationContext)
19.8-141 259.449: tracing=off: large method: 2429 org.hibernate.persister.collection.AbstractCollectionPersister.<init>(org.hibernate.mapping.Collection, org.hibernate.cache.spi.access.CollectionDataAccess, org.hibernate.persister.spi.PersisterCreationContext)
19.8-141 262.558: SP: pin antlr.MismatchedTokenException
19.8-141 289.165: [m: 6844 1460] total classes: processed=14000 instrumented=11915 5970ms
19.8-141 289.293: tracing=off: large method: 2993 org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.comparisonExpr(antlr.collections.AST)
19.8-141 292.035: SP: pin org.hibernate.QueryException
19.8-141 292.379: tracing=off: large method: 2169 org.hibernate.hql.internal.antlr.SqlGeneratorBase.orderExprs(antlr.collections.AST)
19.8-141 312.590: SP: pin javax.naming.NamingException
19.8-141 318.145: [m: 7050 1486] total classes: processed=15000 instrumented=12823 6459ms
19.8-141 346.255: tracing=off: large method: 2646 org.apache.cxf.wsdl.JAXBExtensionHelper.createExtensionClass(java.lang.Class, javax.xml.namespace.QName, java.lang.ClassLoader)
19.8-141 354.252: [m: 7056 1500] total classes: processed=16000 instrumented=13766 6850ms
19.8-141 365.818: tracing=off: large method: 2299 freemarker.template.utility.StringUtil.isFTLIdentifierStart(char)
19.8-141 372.796: SP: pin org.springframework.beans.ConversionNotSupportedException
19.8-141 372.809: SP: pin org.springframework.beans.factory.UnsatisfiedDependencyException
19.8-141 374.219: [m: 7129 1524] total classes: processed=17000 instrumented=14692 7313ms
19.8-141 377.918: tracing=off: large method: 27477 freemarker.core.FMParserTokenManager.jjMoveNfa_0(int, int)
19.8-141 377.918: tracing=off: large method: 4938 freemarker.core.FMParserTokenManager.jjMoveNfa_2(int, int)
19.8-141 377.919: tracing=off: large method: 4822 freemarker.core.FMParserTokenManager.jjMoveNfa_3(int, int)
19.8-141 377.919: tracing=off: large method: 4730 freemarker.core.FMParserTokenManager.jjMoveNfa_6(int, int)
19.8-141 377.919: tracing=off: large method: 5026 freemarker.core.FMParserTokenManager.jjMoveNfa_4(int, int)
19.8-141 377.920: tracing=off: large method: 5546 freemarker.core.FMParserTokenManager.TokenLexicalActions(freemarker.core.Token)
19.8-141 384.299: SP: pin org.springframework.beans.factory.BeanCurrentlyInCreationException
19.8-141 385.773: SP: pin java.lang.SecurityException
19.8-141 388.246: warning: long telemetry sample: 215 ms (0/215)
19.8-141 395.111: [m: 7135 1544] total classes: processed=18000 instrumented=15654 7794ms
19.8-141 403.732: tracing=off: large method: 2094 org.apache.jasper.EmbeddedServletOptions.<init>(javax.servlet.ServletConfig, javax.servlet.ServletContext)
19.8-141 543.592: SP: gc #0 41 ms=24 sz=97180 p=40 t=96
19.8-141 1166.939: TRN: gc #0 554-0 ms=2
19.8-141 1358.703: tracing=off: large method: 2696 sun.security.ssl.ServerHandshaker.clientHello(sun.security.ssl.HandshakeMessage$ClientHello)
19.8-141 1374.946: SP: gc #1 540 ms=26 sz=99364 p=40 t=93
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Cannot connect to profile remote agent

Post by Anton Katilin »

Please try the EAP version https://www.yourkit.com/eap/
ramanja
Posts: 3
Joined: Wed Jul 01, 2020 4:56 am

Re: Cannot connect to profile remote agent

Post by ramanja »

Are you saying that, there is some issue with 2019.8?
I did upgraded from older version to 2019.8 which is released on June 11, 2020.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Cannot connect to profile remote agent

Post by Anton Katilin »

There were improvements in the EAP version in the related field, that's why I suggested to try the EAP. If the problem is reproducible with the EAP too, we'll continue the investigation.

According to the log, the problem is that the remote profiler process has restarted, and the profiler agent in the new process listens on the same port.
When does the problem happen, immediately on connecting the profiler UI to the profiled application? Or does the error happen long after the profiler UI has connected?
Does re-connecting the same profiler UI instance (close the session tab, connect again) to the same process help?
Post Reply