问题
We're trying to connect a previously connected agent to a Jenkins server.
We get the following error:
SEVERE: https://jenkins.domainname.com/tcpSlaveAgentListener/ appears to be publishing an invalid X-Instance-Identity.
java.io.IOException: https://jenkins.domainname.com/tcpSlaveAgentListener/ appears to be publishing an invalid X-Instance-Identity.
at org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver.resolve(JnlpAgentEndpointResolver.java:287)
at hudson.remoting.Engine.innerRun(Engine.java:694)
at hudson.remoting.Engine.run(Engine.java:519)
The command to run the agent is:
java -jar agent.jar -jnlpUrl http://${private_ip}:8080/computer/mac/slave-agent.jnlp -secret ${secret} -workDir "/var/jenkins-sign"
- We're running on a MacOS.
- All TCP ports are open internally between the mac and the ${private_ip}. I have telnet working.
- As said, this agent was recently connected to the server, but the agent had a restart. We also upgraded the Jenkins server to latest available version.
- I updated the agent.jar file.
- I think it's related to contacting ${private_ip} while the X-Instance-Identit says "jenkins.dommainame.com", but I am not sure how to resolve it.
- I only saw that there were recently changes in this area, but not a lot of helpful information other than that.
Does anyone have an idea?
回答1:
Unfortunately, I think it's related to Jenkins upgrade that caused this, and I'm not sure there's a better solution than what I found.
Putting here my solution, but if anyone knows something better, I'd be happy to hear about it :)
- Download the agent.jar
- Download the slave-agent.jnlp and modify it:
- Change all occurrences of
https://jenkins.mydomain.com
tohttp://[private_ip]:[port]
.
- Change all occurrences of
- Start the process:
java -jar agent.jar -jnlpUrl "file:/path/to/dir/slave-agent.jnlp" -workDir "/path/to/dir"
- Do not add the secret to this command.
- If you're using Jenkins agent as a service, remove the -secret argument from the file.
回答2:
In case anyone else runs into the issue, in my case it was because I was passing the entire URL, i.e.
http://someurl/jenkins/computer/test/slave-agent.jnlp
and what it really wanted was
http://someurl/jenkins/
来源:https://stackoverflow.com/questions/64015197/severe-https-jenkins-domainname-com-tcpslaveagentlistener-appears-to-be-publ