jenkinsfile-runner: jenkinsfile-runner-1.0-beta-25 binary Unhandled exception when exploding WAR.
I get a shell into the vanilla image:
root@ffd1873bfc20:/# bash /app/bin/jenkinsfile-runner-launcher cli
No explicit version has been selected, using latest LTS
Running pipeline on jenkins 2.263.4
Exploding,/root/.jenkinsfile-runner/war/2.263.4/jenkins-war-2.263.4.warthis might take some time.
java.lang.RuntimeException: Unhandled exception
at io.jenkins.jenkinsfile.runner.bootstrap.commands.JenkinsLauncherCommand.call(JenkinsLauncherCommand.java:59)
at io.jenkins.jenkinsfile.runner.bootstrap.commands.JenkinsLauncherCommand.call(JenkinsLauncherCommand.java:35)
at picocli.CommandLine.executeUserObject(CommandLine.java:1933)
at picocli.CommandLine.access$1200(CommandLine.java:145)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2332)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2326)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2291)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2159)
at picocli.CommandLine.execute(CommandLine.java:2058)
at io.jenkins.jenkinsfile.runner.bootstrap.Bootstrap.main(Bootstrap.java:45)
Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:225)
at java.util.zip.ZipFile.<init>(ZipFile.java:155)
at java.util.jar.JarFile.<init>(JarFile.java:166)
at java.util.jar.JarFile.<init>(JarFile.java:130)
at io.jenkins.jenkinsfile.runner.bootstrap.Util.explodeWar(Util.java:60)
at io.jenkins.jenkinsfile.runner.bootstrap.commands.JenkinsLauncherCommand.postConstruct(JenkinsLauncherCommand.java:91)
at io.jenkins.jenkinsfile.runner.bootstrap.commands.JenkinsLauncherCommand.call(JenkinsLauncherCommand.java:56)
... 9 more
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 1
- Comments: 16 (8 by maintainers)
Commits related to this issue
- Follow redirects when downloading war Solves #476 — committed to reftel/jenkinsfile-runner by reftel 3 years ago
Note that while
jenkinsfile-runner-1.0-beta-23
works like above, trying to do the same thing withjenkinsfile-runner-1.0-beta-25
does not work. The following is consistently hit.@oleg-nenashev Thanks for the info. Much appreciated. So just to clarify a few things:
I was reading the detailed argument behaviors in the README and it sounded like omitting
-w
was acceptable. Would you accept a fix for this bug where Jenkins isn’t quite getting downloaded and as a result we get the zip exception? Or is this only ever used, in practice, within a container where Jenkins is pre-provisioned? I ask because you alluded to “normal” use and I was curious even though it’s not “normal”, is downloading Jenkins on-the-fly still supported? The README makes me think ‘yes’.Okay no worries. I might take a look at the unpacking, but if there’s a way to only do it once then that’s likely not necessary.
So when we say in the README that “Jenkinsfile Runner bundle includes the Jenkins core and a minimum set of plugins” - that only applies to the Docker image? Should we clarify that? Also, where in the code might I find the list of plugins that would normally ship with the docker image? I was looking for a
plugins.txt
in thepackaging/docker
andvanilla-package
areas but didn’t see any. Is it getting dynamically generated per the pom invanilla-package
by chance?Aha! This is very helpful. I verified it indeed worked.
I’ll consider submitting some README improvements (if you like) to make the above a little clearer to newcomers. I appreciate your time.
In my current understanding of
jenkinsfile-runner-1.0-beta-25
it downloads the war and then attempts to explode it using a basic extraction. This would need some additional testing with the pipeline you are running to figure out the exact reason of the failure. You could make a case for not exploding the war and falling back to telling the user to do it himself. With respect to your suggestions to the readme, I do agree there is definitely scope for certain improvements.Here’s my story. I’m not sure if it’s a recurring situation.
Ultimately I think learning the new concepts for newcomers should be an expectation if you want to do intermediate or advanced things; but not for the base “working” case in a README.
Some potential suggestions:
All that being said, I was able to get things working with the standalone zip of jenkinsfile-runner, without Docker. It was pretty straight forward and these steps might make a good foundation for the guide. Here’s how:
.hpi
files.jenkinsfile-runner-1.0-beta-23/
jenkins/
./bin/jenkinsfile-runner cli -w jenkins/
install-plugin https://updates.jenkins.io/download/plugins/durable-task/1.35/durable-task.hpi -deploy
shutdown
./bin/jenkinsfile-runner -w jenkins/ -f MY_PATH/Jenkinsfile
Works great. Going to use this to iterate on my next automation. I’ll post updates as I go.
Sure, happy to help. Will respond to the comments later today or tomorrow
Yes, it is how Jenkinsfile Runner is used normally in containers (pre-exploded WAR)
Need to profile it to say anything, but unarchiving operation by @sladyn98 uses a very simple sequential unpacking algorithm in a single thread. Since Jenkins WAR includes MANY files, it is expected to be quite slow.
Vanilla image includes all the plugins required for running. It is not a case for a stripped executable JAR. There you need to specify plugins using
-p
It should not be required. If -w points to the exploded directory, Jenkins will just use it every time