sdkman / sdkman-db-migrations

Database migrations for the sdkman API
Apache License 2.0
71 stars 125 forks source link

Bug: [Invalid default candidate for Java] #393

Closed aivantsov closed 4 years ago

aivantsov commented 4 years ago

Bug report

Cannot install a default java version

To reproduce

sdk i java
No update at this time. Using existing cache: ant,asciidoctorj,ballerina,bpipe,btrace,ceylon,concurnas,crash,cuba,cxf,doctoolchain,dotty,gaiden,glide,gradle,gradleprofiler,grails,groovy,groovyserv,http4k,infrastructor,java,jbake,jbang,karaf,kotlin,kscript,lazybones,leiningen,maven,micronaut,mulefd,mvnd,sbt,scala,spark,springboot,sshoogr,test,tomcat,vertx,visualvm
Not refreshing version cache now...
Validate java 11.0.8.hs-adpt for Darwin: invalid
Validation URL: https://api.sdkman.io/2/candidates/validate/java/11.0.8.hs-adpt/darwin

Stop! java 11.0.8.hs-adpt is not available. Possible causes:
 * 11.0.8.hs-adpt is an invalid version
 * java binaries are incompatible with Darwin
 * java has not been released yet

The SDK API call is returning a wrong version:

curl https://api.sdkman.io/2/candidates/default/java
11.0.8.hs-adpt%                                                                                                                  

The expected version should be

11.0.9.hs-adpt

System info

OS:

Darwin 157278S0 19.6.0 Darwin Kernel Version 19.6.0: Mon Aug 31 22:12:52 PDT 2020; root:xnu-6153.141.2~1/RELEASE_X86_64 x86_64

Shell

zsh --version
zsh 5.7.1 (x86_64-apple-darwin19.0)

SDK version

sdk version
SDKMAN 5.9.1+575
helpermethod commented 4 years ago

Hi @aivantsov!

Can confirm. The version 11.0.8.hs-adpt has been removed, but it's still set as the default version.

@marc0der What would be the quickest way to fix this?

marc0der commented 4 years ago

@helpermethod A quick database migration would do the trick.

aivantsov commented 4 years ago

The API is now returning a new valid java version

date && curl https://api.sdkman.io/2/candidates/default/java
Wed Oct 28 09:53:38 CET 2020
11.0.9.hs-adpt%                                                                                                                  

Closed. Thx for a quick response.