Hi, I recently deployed the Jenkins Docker container (jenkins/jenkins:lts-jdk17) on my Linux server and set up an agent. However, I encountered an error when running the agent.jar
with the command provided in the instructions:
java -jar agent.jar -url http://xxx.xxx.xxx.xxx:8080/jenkins/ -secret xxxxxxxxxxxxxxx -name "XXXXXX" -workDir "C:\dev\jenkins"
The error message was: ‘Error: Invalid or corrupt jarfile agent.jar.’
Upon opening agent.jar
with a text editor, I discovered it was actually an HTML file indicating an authentication issue:
<html>
<head>
<meta http-equiv='refresh' content='1;url=/login?from=%2Fjenkins%2FjnlpJars%2Fagent.jar'/>
<script id='redirect' data-redirect-url='/login?from=%2Fjenkins%2FjnlpJars%2Fagent.jar' src='/static/84148f85/scripts/redirect.js'></script>
</head>
<body style='background-color:white; color:white;'>
Authentication required
<!--
-->
</body>
</html>
I tried downloading agent.jar from /jenkins/jnlpJars/agent.jar with my browser that logged in to the Jenkins server instead of curl.exe but still no luck:
Any ideas on this? Thanks!