jenkinsci / mesos-plugin

Mesos Cloud Jenkins Plugin
https://plugins.jenkins.io/mesos/
Apache License 2.0
289 stars 165 forks source link

Jenkins url in mesos configuration doesn't populate correctly in jnlp xml #418

Closed dispalt closed 2 years ago

dispalt commented 2 years ago

Version report

Jenkins and plugins versions report: Jenkins: 2.319.1 mesos: 2.0

Copy/paste here....
Linux

Reproduction steps

Edit the global jenkins url to something external. jenkins.example.com Edit the jenkins url in the mesos cloud to something internal, jenkins.mesos:10000 Use the docker executor for a job Slave starts, pulls agent.jar from internal, with jnlpUrl pointing to internal jenkins if I download the jnlpUrl and look inside the xml it is using the external jenkins with the internal port.

Dec 17, 2021 8:39:53 AM hudson.remoting.jnlp.Main createEngine
INFO: Setting up agent: jenkins-agent-linux-lg-0cc19956-0206-4900-88ca-6fc00bb98c28
Dec 17, 2021 8:39:53 AM hudson.remoting.jnlp.Main$CuiListener <init>
INFO: Jenkins agent is running in headless mode.
Dec 17, 2021 8:39:53 AM hudson.remoting.Engine startEngine
INFO: Using Remoting version: 4.11.2
Dec 17, 2021 8:39:53 AM hudson.remoting.Engine startEngine
WARNING: No Working Directory. Using the legacy JAR Cache location: /root/.jenkins/cache/jars
Dec 17, 2021 8:39:53 AM hudson.remoting.jnlp.Main$CuiListener status
INFO: Locating server among [https://jenkins.example.com]
Dec 17, 2021 8:39:53 AM org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver resolve
INFO: Remoting server accepts the following protocols: [JNLP4-connect, Ping]
Dec 17, 2021 8:39:58 AM org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver isPortVisible
WARNING: connect timed out
Dec 17, 2021 8:39:58 AM hudson.remoting.jnlp.Main$CuiListener error
SEVERE: https://jenkins.example.com/ provided port:10000 is not reachable

I think it has something to do with this. https://www.jenkins.io/doc/upgrade-guide/2.249/#alternate-url-removed-from-inbound-agent

dispalt commented 2 years ago

For anyone that searches for this in the future I figured it out by starting jenkins with the following parameter

-Djenkins.agent.inboundUrl=http://jenkins.mesos:10000