nvuillam / npm-groovy-lint

Lint, format and auto-fix your Groovy / Jenkinsfile / Gradle files using command line
https://nvuillam.github.io/npm-groovy-lint/
MIT License
207 stars 63 forks source link

Downloading Java fails due to an API failure #288

Closed mikeduminy closed 1 year ago

mikeduminy commented 1 year ago

When running this tool in CI we see the following:

Java jre or jdk between 8 and 14 is required 
Installing Java jre 14 in /home/jenkins/.java-caller...
Unexpected error: invalid json response body at https://api.adoptopenjdk.net/v2/info/releases/openjdk14?type=jre&openjdk_impl=hotspot&release=latest&os=linux&arch=x64& reason: Unexpected token < in JSON at position 0
FetchError: invalid json response body at https://api.adoptopenjdk.net/v2/info/releases/openjdk14?type=jre&openjdk_impl=hotspot&release=latest&os=linux&arch=x64& reason: Unexpected token < in JSON at position 0

It looks like there's some internal error in the v2 API, but no sign of it reported on https://status.adoptium.net/. I tweeted at them to look at it but I think it's worth mentioning that this v2 API is deprecated and the recommendation is to migrate to adoptium apis instead.

yonahd commented 1 year ago

We are encountering this as well

mikeduminy commented 1 year ago

Also reported to the API owners - https://github.com/adoptium/api.adoptium.net/issues/681

We solved it by pre-seeding our CI machine with JDK11, thus skipping this dynamic download.

gdams commented 1 year ago

Hi there, Adoptium Maintainer here 👋🏼

This is fixed now but please migrate to the V3 API (https://api.adoptium.net) as the V2 API has been deprecated for a long time.

nvuillam commented 1 year ago

Lucky for everyone, I've got the covid so I have a little time to work on njre / node-java-caller / npm-groovy-lint

Million thanks to @mheiges for his PR !

mheiges commented 1 year ago

@nvuillam, I hope you are recovering well. Is there a plan to make a new release of NGL with the updated java-caller and njre package dependencies?

nvuillam commented 1 year ago

@mheiges I am desperately trying but i've not coded in groovy / java for years now and I'm struggling a lot :/ I might the the beginning of a solution but the CodeNarcServer desperately fails :(

Maybe u would like to continue being a superhero and have a look , with my guidance if necessary ? https://github.com/nvuillam/npm-groovy-lint/pull/286

mheiges commented 1 year ago

oh, wow, that's a lot to digest. I was thinking more of just bumping the java-caller version in package.json, at least for the short term. Otherwise, I'll take a look this weekend but no promises, CodeNarcServer is a beast.

nvuillam commented 1 year ago

Basically, with my updates it kind of works but when i try to call CodeNarc libraries it crashes and i am unable to see a trace i don't even succeed to debug in IntelliJ or VsCode :'(

I'm really rusty, and i see users are more and more complaining so i'll try to solve the issue but with my 2 jobs + MegaLinter + sfdx-hardis it's hard to juggle with priorities :(

nvuillam commented 1 year ago

ps: wrote u on linkedin PM :)