jenkinsci / docker-agent

Jenkins agent (base image) and inbound agent Docker images
https://hub.docker.com/r/jenkins/inbound-agent/
MIT License
282 stars 232 forks source link

JDK 21 preview updatecli manifest is failing #798

Closed lemeurherve closed 5 months ago

lemeurherve commented 5 months ago

Jenkins and plugins versions report

N/A

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

N/A

Reproduction steps

Observe updatecli actions logs in this repository.

Expected Results

No error in logs.

Actual Results

Error in logs:

SOURCES
=======

getLatestJDK21PreviewVersion
----------------------------
Searching for version matching pattern ".*-ea-.*"
✔ Git tag "jdk-21.0.4+1-ea-beta" found matching pattern ".*-ea-.*" of kind "regex"

CONDITIONS:
===========

checkIfReleaseIsAvailable
-------------------------
The shell 🐚 command "/bin/sh /var/folders/ly/77mv7l9968g068w9_fwzwggw0000gp/T/updatecli/bin/d3ffbc3fbbe15c1cb14dacbe20856423b65a42ac0add7e5e19d1b29ad3fe138d.sh" exited on error (exit code 1) with the following output:
----
ERROR: the following URL is NOT available: https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B1-ea-beta/OpenJDK21U-jdk_x64_linux_hotspot_21.0.4_1-ea.tar.gz.

Anything else?

No response

Are you interested in contributing a fix?

No response

lemeurherve commented 5 months ago

Not sure why it's failing on main, on #796 but not on #786, not on #799 and not locally 🤔

gounthar commented 5 months ago

updatecli version maybe?

dduportal commented 5 months ago

The error is clearly related to the shell script:

<...> exited on error (exit code 1) with the following output:

=> worth executing it in debug over there

gounthar commented 5 months ago

The script is failing, but the URL is valid. 🤔

lemeurherve commented 5 months ago

The script is failing, but the URL is valid. 🤔

https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B1-ea-beta/OpenJDK21U-jdk_x64_linux_hotspot_21.0.4_1-ea.tar.gz was returning a 404 error yesterday 🤔

Maybe a GitHub intermittent issue that would explain why it succeeded sometimes?

lemeurherve commented 5 months ago

FTR, the URL from #772 isn't the same cf https://ci.jenkins.io/job/Packaging/job/docker-agent/job/PR-772/16/pipeline-console/?selected-node=102

- https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B1-ea-beta/OpenJDK21U-jdk_x64_linux_hotspot_21.0.4_1-ea.tar.gz
+ https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B1-ea-beta/OpenJDK21U-jdk_arm_linux_hotspot_ea_21-0-4-1.tar.gz
dduportal commented 5 months ago

Is the error reproducible locally? And if yes, is running the shell script (without updatecli) allows to reproduce the error?

lemeurherve commented 5 months ago

Is the error reproducible locally?

No (cf https://github.com/jenkinsci/docker-agent/issues/798#issuecomment-2097050565)

Not reproduced in CI anymore and version correctly bumped by updatecli in https://github.com/jenkinsci/docker-agent/pull/772. The manifest is valid in the sense of even if it returns a wrong link, at least it doesn't fail the updatecli pipeline.

Important note, this jdk21 preview manifest isn't using the adoptium scripts to retrieve the JDK download link (it was introduced before them): https://github.com/jenkinsci/docker-agent/blob/master/updatecli/updatecli.d/jdk21-preview.yaml

The adoptium scripts need additional logic if we want to use them for that as this preview version is an "EA" one, not a "GA". The Adoptium API logic to retrieve data is not the same. (From what I recall and if I'm not mistaken, multiple EA releases can correspond to a JDK version).

I'd suggest fixing this jdk21 preview manifest to return the correct URL for now instead of increasing the complexity of the adoptium scripts immediately.

lemeurherve commented 5 months ago

Important note, this jdk21 preview manifest isn't using the adoptium scripts to retrieve the JDK download link

Nor the jdk21 preview Dockerfile cf https://github.com/jenkinsci/docker-agent/blob/d473399f681df4ee79f2f525266f951944f86f5f/debian/preview/Dockerfile#L15-L27

Last URL from https://ci.jenkins.io/job/Packaging/job/docker-agent/job/PR-772/25/pipeline-console/?selected-node=94:

https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B2-ea-beta/OpenJDK21U-jdk_arm_linux_hotspot_ea_21-0-4-2.tar.gz (404 not found)

I'd suggest fixing this jdk21 preview manifest

or the jdk21 Dockerfile logic.

lemeurherve commented 5 months ago

21.0.4+2 is absent from https://github.com/adoptium/temurin21-binaries/releases 🤔

dduportal commented 5 months ago

21.0.4+2 is absent from https://github.com/adoptium/temurin21-binaries/releases 🤔

https://github.com/adoptium/temurin21-binaries/releases/tag/jdk-21.0.4%2B2-ea-beta

dduportal commented 5 months ago

Is the error reproducible locally?

No (cf #798 (comment))

Not reproduced in CI anymore and version correctly bumped by updatecli in #772.

I don't understand what the problem is then. The updatecli manifest is made to retrieve the "latest" version matching a certain pattern as source, and the condition verify that this version has the proper binaries available (because between creating a tag and having all binary released, a lot of time can pass).

The partial log output you've added in the body message shows that the condition failed, which is usually because the binaries are NOT available (yet).

The manifest is valid in the sense of even if it returns a wrong link, at least it doesn't fail the updatecli pipeline.

Yes, that is and always has been the whole puprose of running the check in an "update condition".

=> What is the problem we want to solve, considering all of this thread? I'm asking because it looks like the error was "transient" (which happens on each Temurin release as they don't release everything immediately) so the issue might be closeable but I might be missing something?

lemeurherve commented 5 months ago

This issue can be closed but the jdk21 Dockerfile needs a fix as the final URL called in the image build https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B2-ea-beta/OpenJDK21U-jdk_arm_linux_hotspot_ea_21-0-4-2.tar.gz is invalid.