Jenkins kubernetes plugin: provided port:50000 is not reachable
Asked Answered
I

4

6

I have set up jenkins on GKE using the official helm chart.

I have also created an nginx-ingress controller installation using helm and I am able to access jenkins via https://112.222.111.22/jenkins where 112.222.111.22 is the static IP I am passing to the load balancer.

I am also able to create jobs.

However, when I try to spin up inbound remote agent:

▶ java -jar agent.jar -noCertificateCheck -jnlpUrl https://112.222.111.22/jenkins/computer/My%20Builder%203/slave-agent.jnlp -secret <some_secret>


...
WARNING: Connect timed out
Feb 28, 2020 5:57:18 PM hudson.remoting.jnlp.Main$CuiListener error
SEVERE: https://112.222.111.22/jenkins/ provided port:50000 is not reachable
java.io.IOException: https://112.222.111.22/jenkins/ provided port:50000 is not reachable
    at org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver.resolve(JnlpAgentEndpointResolver.java:303)
    at hudson.remoting.Engine.innerRun(Engine.java:527)
    at hudson.remoting.Engine.run(Engine.java:488)

Why is that?

Illuminance answered 28/2, 2020 at 16:7 Comment(2)
Same error port:50000 is not reachableBedstead
Please see my answer with step by step instruction, I got the same problem, now agent is working for me.Sloane
I
20

I had similar issue. I have solved it enabling the "Use WebSocket". Jenkins Salve/Agent > Configure > Launch Method > Use WebSocket (enable) > Save.

Intumescence answered 9/4, 2021 at 22:22 Comment(1)
Worked like charm!!.. ThanksPersonage
S
0

Might be because port 50000 is not open in the Jenkins master.

You can try to open the port by Creating Inbound rule in Jenkins Master's firewall which allows Port 50000 (coming from other machine in this case Agent, hence Inbound rule). Try following steps:

  1. Go to Master Jenkins.
  2. Open Wiindows Defender Firewall--> Advance setting --> create Inbound Rule allow port 50000

enter image description here

Note: In 1 inbound rule you can allow more than one port as shown in below.

  1. Restart master Jenkins service.

  2. Check if (step is valid only if you have created windows service on agent) agent service is running continuously.

Check Agent status in Jenkins !

Sloane answered 18/2, 2021 at 11:4 Comment(3)
I am facing same error in my ubuntu machine, how to resolve it ? @SloanePersonage
@Tapan Hedge I have no experience with Linux machines.Sloane
Thanks for prompt reply.. I am able to figure this out. I need to open firewall rules in my ubuntu machine for that particular port. @SloanePersonage
C
0

I faced the same error, after doing lots of research later I found that problem was in service.yaml that was used to expose the jenkins server. So I changed this

ports:
    - name: httpport
      port: 8080
      targetPort: 8080
      nodePort: 32000

to this

- name: httpport
  port: 8080
  targetPort: 8080
  nodePort: 32000
- name: jnlpport
  port: 50000
  targetPort: 50000

And it solved my problem.

If interested, here I explained how I deployed my jenkins server on kubernetes 👉 How to Deploy Jenkin on Kubernetes

Consternate answered 5/4, 2023 at 17:43 Comment(0)
D
-2

looks like port 50000 is not open in the jenkins master. Try to open the port and restart the machine and instance ( i.e jenkins via url ) and see if it helps.

Dockyard answered 30/4, 2020 at 13:53 Comment(1)
I know this is an old question, but maybe could be useful to someone, if you are using the jenkins charts to setup the jenkins controller on kubernetes, you don't need to setup any agent manually, you need to use kubernetes as agent in your Jenkinsfile or job definitionInterval

© 2022 - 2024 — McMap. All rights reserved.