acceptance-test-harness icon indicating copy to clipboard operation
acceptance-test-harness copied to clipboard

MockUpdateCenter regularly has corrupted plugin downloads

Open jtnord opened this issue 1 year ago • 1 comments

Jenkins and plugins versions report

Environment
Paste the output here

What Operating System are you using (both controller, and any agents involved in the problem)?

Windows 11

Reproduction steps

with a m2 repository with several required plugins already available (from regular maven builds pulling dependencies) installed.

  • mvn -P lts test

Expected Results

tests install the required plugins for the test as determined by @WithPlugins or other code

Actual Results

tests fails, resolved HPIs are corrupted.

master1740766363|2023-07-26 19:51:58.975+0000 [id=136]  INFO    h.m.UpdateCenter$UpdateCenterConfiguration#download: Downloading jackson2-api
master1740766363|2023-07-26 19:51:59.067+0000 [id=136]  SEVERE  h.model.UpdateCenter$DownloadJob#run: Failed to install jackson2-api
master1740766363|java.io.IOException: Downloaded file C:\workarea\source\github\jenkinsci\acceptance-test-harness\target\jenkinshome8417413392245346575\plugins\jackson2-api.jpi.tmp does not match expected SHA-256, expected 'QceK1GpM4/xAs1O/TNQlqhjSpNv+gmYkxig05LGf2q0=', actual 'yMow6XWcRzp7+NIfKfPykb4AMPGDv9FzrbBrjFVbbYI='
master1740766363|       at hudson.model.UpdateCenter.throwVerificationFailure(UpdateCenter.java:2042)
master1740766363|       at hudson.model.UpdateCenter.verifyChecksums(UpdateCenter.java:2077)
master1740766363|       at hudson.model.UpdateCenter$InstallationJob.replace(UpdateCenter.java:2275)
master1740766363|       at hudson.model.UpdateCenter$UpdateCenterConfiguration.install(UpdateCenter.java:1341)
master1740766363|       at hudson.model.UpdateCenter$DownloadJob._run(UpdateCenter.java:1879)
master1740766363|       at hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:2188)
master1740766363|       at hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:1850)
master1740766363|       at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
master1740766363|       at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
master1740766363|       at hudson.remoting.AtmostOneThreadExecutor$Worker.run(AtmostOneThreadExecutor.java:121)
master1740766363|       at java.base/java.lang.Thread.run(Thread.java:829)
master1740766363|2023-07-26 19:51:59.067+0000 [id=136]  INFO    h.model.UpdateCenter$DownloadJob#run: Starting the installation of commons-lang3-api on behalf of anonymous

Anything else?

I verified that the plugin in c/Users/jnord/.m2/repository/org/jenkins-ci/plugins/jackson2-api/2.15.2-350.v0c2f3f8fc595 has an incorrect hash according to https://updates.jenkins.io/download/plugins/jackson2-api/#2.15.2-350.v0c2f3f8fc595

removing plugins and reruning the tests move the tests forward (there are generally several plugins that become corrupted).

Given that the tests pass in CI and on many other users machines I am guessing that there is some buggy file handling code that is triggered on windows.

jtnord avatar Jul 27 '23 09:07 jtnord

ahh.....

incrementals is not behaving as expected.

compare https://repo.jenkins-ci.org/ui/repos/tree/General/releases/org/jenkins-ci/plugins/jackson2-api/2.15.2-350.v0c2f3f8fc595/jackson2-api-2.15.2-350.v0c2f3f8fc595.hpi vs https://repo.jenkins-ci.org/ui/repos/tree/General/incrementals/org/jenkins-ci/plugins/jackson2-api/2.15.2-350.v0c2f3f8fc595/jackson2-api-2.15.2-350.v0c2f3f8fc595.hpi

the shas are different c8ca30e9759c473a7bf8d21f29f3f291be0030f183bfd173adb06b8c555b6d82 (incremental repo) vs 41c78ad46a4ce3fc40b353bf4cd425aa18d2a4dbfe826624c62834e4b19fdaad (non incremental)

jtnord avatar Jul 27 '23 09:07 jtnord