trapme: Improve curl error detection when downloading JDKs
- Dominant language
- HTML
- Stars
- 155
- Forks
- 346
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 36
Description
This was split out from somethinf in the Jult/October TCK retrospectives - action is to see if we can produce a more useful error message to the end user in the case of `curl` failures, and probably abort if it's fatal and we won't be able to run `java -version`
--- Message below copied from TC#400
Similar to the first comment, if the `curl` download of a build in the TC jobs fail then it can be non-obvious why.
- Did the curl fail?
- Did it give a zero-length file?
- Was the URL wrong and so the request gave a 404 back?
- Did it download an invalid thing?
- Was there an authentication issue?
I think at one time or another I've hit issues with most of those being the cause :-)
For example, an invalid value can lead to something like this from the logs, although unlike the previous comment this one does abort the job almost immediately. I've hit it a few times and adding some more debug would make this easier to diagnose when (usually some form of user error) causes it to occur.
```
1:20:41 _ENCODE_FILE_NEW=UNTAGGED curl -OLJSks --user ****:**** https://ci.adoptium.net/job/build-scripts/job/jobs/job/evaluation/job/jobs/job/jdk17u/job/jdk17u-evaluation-alpine-linux-aarch64-temurin/lastSuccessfulBuild/artifact/workspace/target/OpenJDK17U-jdk_aarch64_alpine-linux_hotspot_2023-07-16-12-05.tar.gz
11:20:50 Uncompressing file: OpenJDK17U-jdk_aarch64_alpine-linux_hotspot_2023-07-16-12-05.tar.gz ...
11:20:52 Run /home/jenkins/workspace/Grinder/openjdkbinary/j2sdk-image/bin/java -version
11:20:52 =JAVA VERSION OUTPUT BEGIN=
11:20:52 ./get.sh: line 672: /home/jenkins/workspace/Grinder/openjdkbinary/j2sdk-image/bin/java: No such file or directory
```
Contributor guide
Research direction
Inspect get.sh around line 672 and locate the curl invocation used to download JDK builds. Reproduce or review the failure cases described in the issue, including empty, invalid, 404, and authentication responses. Done means curl or unusable downloads produce a useful error and the job aborts before attempting java -version when it cannot proceed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, shell
- Domain
- devops, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100