Fully featured low overhead profiler for Java EE and Java SE platforms.
Performance monitoring and profiling of Jenkins, TeamCity, Gradle, Maven, Ant, JUnit and TestNG.
Easy to use performance and memory profiler for .NET framework.

Cannot start: predefined port [number] is already in use

Moderators: Vladimir Kondratyev, Anton Katilin

Cannot start: predefined port [number] is already in use

Postby charliek » Mon Nov 19, 2018 7:34 pm

Hi there,
I'm using YourKit-JavaProfiler-2018.04-b86 and getting an error "Cannot start: predefined port 8763 is already in use". I've tried using few different ports but same error.
Note that this only happens if I want to restrict to certain IP in the listen setting, i.e with "listen=1.2.3.4,port=8763". If I use "listen=all,port=8763", no issues with predefined port already in use error. Also, 1.2.3.4 is just an example for sake of this porting.

Here is the startup setting:
disablestacktelemetry,delay=10000,dir=/home/me/var/tmp,logdir=/home/me/logs/app,sessionname=yourkit,listen=1.2.3.4,port=8763

Trying to see if any process is already using port 8763, but nothing is listening on that port:

[charlesk@bruntfront ~]$ sudo netstat -tulpn | grep LISTEN
Touch Yubikey:
tcp 0 0 127.0.0.1:808 0.0.0.0:* LISTEN 19255/**
tcp 0 0 127.0.0.1:809 0.0.0.0:* LISTEN 19255/**
tcp 0 0 0.0.0.0:2222 0.0.0.0:* LISTEN 1478/sshd-2222
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 19255/**
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1495/sshd
tcp 0 0 :::2222 :::* LISTEN 1478/sshd-2222
tcp 0 0 :::22

Here is the error message from yourkit:

18.04-86 0.703: setTriggers: to unregister: 0
18.04-86 0.703: setTriggers: method listeners to register: 0
18.04-86 0.703: setTriggers: OK
18.04-86 0.703: ourUnsafe: true
18.04-86 0.703: shmem 42341490: OK
18.04-86 0.704: shmem 4234148E: OK
18.04-86 0.732: Cannot start: predefined port 8763 is already in use
18.04-86 0.732: agentInit: Core.init() called
18.04-86 0.732: error: agentInit: Core.init() returned false
charliek
 
Posts: 5
Joined: Mon Nov 19, 2018 7:21 pm

Re: Cannot start: predefined port [number] is already in use

Postby Anton Katilin » Tue Nov 20, 2018 11:20 am

Hi,

We cannot reproduce the problem. Could you please send the full agent log file to support@yourkit.com

Does it work with "listen=localhost,port=8763"?

Please check that 1.2.3.4 is correct. It should be the IP of one of the machine's network interfaces.
Anton Katilin
 
Posts: 5788
Joined: Wed Aug 11, 2004 8:37 am

Re: Cannot start: predefined port [number] is already in use

Postby charliek » Tue Nov 20, 2018 6:21 pm

Yes, it seems to start up with "listen=localhost,port=8763"

18.04-86 0.561: YourKit Java Profiler agent is listening on port 8763, "listen=localhost"
18.04-86 0.562: *** HINT ***: To get profiling results, connect to the application from the profiler UI
18.04-86 0.562: agentInit: Core.init() called
18.04-86 0.566: agentInit: OK
18.04-86 0.566: vmInit: 3
18.04-86 0.566: onStartProfiling: entering...
18.04-86 0.566: onStartProfiling: done
18.04-86 0.566: vmInit: OK

Quick question on the listen setting. Is that suppose to used for limiting access to the agent based on an IP address? i.e I want to limit the access to single IP address from my Mac for example.

I'll get the full agent log sent to support@yourkit.com with title "Cannot start: predefined port [number] is already in use"
charliek
 
Posts: 5
Joined: Mon Nov 19, 2018 7:21 pm

Re: Cannot start: predefined port [number] is already in use

Postby Anton Katilin » Tue Nov 20, 2018 7:15 pm

Quick question on the listen setting. Is that suppose to used for limiting access to the agent based on an IP address? i.e I want to limit the access to single IP address from my Mac for example.

Absolutely not. It's not the address from which you listen, but the address on which you listen. This option makes sense if the machine has multiple network interfaces (network cards), and you want to bound the connection to particular one.
Anton Katilin
 
Posts: 5788
Joined: Wed Aug 11, 2004 8:37 am

Re: Cannot start: predefined port [number] is already in use

Postby charliek » Tue Nov 20, 2018 8:26 pm

Absolutely not. It's not the address from which you listen, but the address on which you listen. This option makes sense if the machine has multiple network interfaces (network cards), and you want to bound the connection to particular one.


Ah I see. So I was misinterpreting that setting.
So, connecting from remote machine is only available through SSH unless listen=all is used right?
charliek
 
Posts: 5
Joined: Mon Nov 19, 2018 7:21 pm

Re: Cannot start: predefined port [number] is already in use

Postby charliek » Tue Nov 20, 2018 9:24 pm

Okay so, removed the listen setting as well as the port and then, configured SSH tunnel and that seems to start the agent. However, when I try to connect to the agent using the UI, I see the status "All applications are hidden" It seems like I'm able to connect but something else is missing?

I'm running the oracle jdk:
Code: Select all
[charlesk@bruntfront ~]$ java -version
java version "1.8.0_192"
Java(TM) SE Runtime Environment (build 1.8.0_192-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.192-b12, mixed mode)



Code: Select all
8.04-86 0.571: socket timeout: 30000
18.04-86 0.572: YourKit Java Profiler agent is listening on port 10001, "listen=localhost"
18.04-86 0.572: *** HINT ***: To get profiling results, connect to the application from the profiler UI
18.04-86 0.572: agentInit: Core.init() called
18.04-86 0.580: agentInit: OK
charliek
 
Posts: 5
Joined: Mon Nov 19, 2018 7:21 pm

Re: Cannot start: predefined port [number] is already in use

Postby charliek » Tue Nov 20, 2018 10:02 pm

"All applications are hidden"


I had to uncheck "Hide develpment tools, e.g. IDEs"
I think this is due to setting the startup option with sessionname=yourkit :roll:
charliek
 
Posts: 5
Joined: Mon Nov 19, 2018 7:21 pm

Re: Cannot start: predefined port [number] is already in use

Postby Anton Katilin » Wed Nov 21, 2018 12:00 pm

What is the full command line? Could you please send it to support@yourkit.com and we'll check the development tool detection heuristics.
Anton Katilin
 
Posts: 5788
Joined: Wed Aug 11, 2004 8:37 am


Return to Java Profiler

Who is online

Users browsing this forum: Google [Bot] and 23 guests

cron