Sdkman-cli: Bug: sdk install sbt fails regardless of version

Created on 23 Sep 2020  路  8Comments  路  Source: sdkman/sdkman-cli

Bug report
Attempting to install sbt with sdk does not work now. Appears to be an issue with the repository.
Problem occurs on both a Mac with an old version of sdkman and a Linux instance with the latest version of sdkman installed via curl -s "https://get.sdkman.io" | bash

Error message:

-=O=-                                                                                                               #      #     #   #
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /root/.sdkman/archives/sbt-1.3.13.zip or
        /root/.sdkman/archives/sbt-1.3.13.zip.zip, and cannot find /root/.sdkman/archives/sbt-1.3.13.zip.ZIP, period.

/root/.sdkman/archives is empty

To reproduce
Run sdk install sbt or sdk install <specific version>

System info

  • Mac and Linux
  • bash on both
  • The output of sdk version 5.7.4+362 (Mac) and 5.9.0+555 (Linux)
bug

Most helpful comment

@marc0der I tried to write something here. Does this make sense? - https://github.com/sdkman/sdkman-db-migrations/pull/348

All 8 comments

I am also experiencing this issue. Here's the full debug output.

cels@localhost:~$ sdk install sbt 1.2.8
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,vertx,visualvm
Not refreshing version cache now...
Validate sbt 1.2.8 for Linux64: valid
Validation URL: https://api.sdkman.io/2/candidates/validate/sbt/1.2.8/linux64
Get pre-installation hook: https://api.sdkman.io/2/hooks/pre/sbt/1.2.8/linux64
Copy remote pre-installation hook: /home/cels/.sdkman/tmp/hook_pre_sbt_1.2.8.sh
No Linux pre-install hook found for Sbt 1.2.8.
Completed pre-installation hook...

Downloading: sbt 1.2.8

In progress...

*   Trying 45.55.42.78...
* Connected to api.sdkman.io (45.55.42.78) port 443 (#0)
* found 127 certificates in /etc/ssl/certs/ca-certificates.crt
* found 508 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* SSL connection using TLS1.2 / ECDHE_RSA_AES_128_GCM_SHA256
*    server certificate verification OK
*    server certificate status verification SKIPPED
*    common name: *.sdkman.io (matched)
*    server certificate expiration date OK
*    server certificate activation date OK
*    certificate public key: RSA
*    certificate version: #3
*    subject: CN=*.sdkman.io
*    start date: Sat, 30 May 2020 00:00:00 GMT
*    expire date: Thu, 28 Apr 2022 23:59:59 GMT
*    issuer: C=GB,ST=Greater Manchester,L=Salford,O=Sectigo Limited,CN=Sectigo RSA Domain Validation Secure Server CA
*    compression: NULL
* ALPN, server accepted to use http/1.1
> GET /2/broker/download/sbt/1.2.8/linux64 HTTP/1.1
> Host: api.sdkman.io
> User-Agent: curl/7.47.0
> Accept: */*
> 
< HTTP/1.1 302 Found
< Server: nginx/1.19.1
< Date: Wed, 23 Sep 2020 21:21:21 GMT
< Content-Length: 0
< Connection: keep-alive
< location: https://piccolo.link/sbt-1.2.8.zip
< 
* Connection #0 to host api.sdkman.io left intact
* Issue another request to this URL: 'https://piccolo.link/sbt-1.2.8.zip'
*   Trying 169.55.161.7...
* Connected to piccolo.link (169.55.161.7) port 443 (#1)
* found 127 certificates in /etc/ssl/certs/ca-certificates.crt
* found 508 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* SSL connection using TLS1.2 / ECDHE_RSA_AES_128_GCM_SHA256
*    server certificate verification OK
*    server certificate status verification SKIPPED
*    common name: piccolo.link (matched)
*    server certificate expiration date OK
*    server certificate activation date OK
*    certificate public key: RSA
*    certificate version: #3
*    subject: CN=piccolo.link
*    start date: Thu, 27 Aug 2020 13:19:52 GMT
*    expire date: Wed, 25 Nov 2020 13:19:52 GMT
*    issuer: C=US,O=Let's Encrypt,CN=Let's Encrypt Authority X3
*    compression: NULL
* ALPN, server did not agree to a protocol
> GET /sbt-1.2.8.zip HTTP/1.1
> Host: piccolo.link
> User-Agent: curl/7.47.0
> Accept: */*
> 
< HTTP/1.1 500 Internal Server Error
< content-type: text/html; charset=UTF-8
< transfer-encoding: chunked
< x-powered-by: PHP/7.1.22
< cache-control: no-cache, private
< date: Wed, 23 Sep 2020 21:21:54 GMT
< 
{ [4571 bytes data]
######################################################################## 100.0%* Connection #1 to host piccolo.link left intact

Downloaded binary to: /home/cels/.sdkman/tmp/sbt-1.2.8.bin
Get post-installation hook: https://api.sdkman.io/2/hooks/post/sbt/1.2.8/linux64
Copy remote post-installation hook: /home/cels/.sdkman/tmp/hook_post_sbt_1.2.8.sh
No Linux post-install hook found for Sbt 1.2.8.
Moving /home/cels/.sdkman/tmp/sbt-1.2.8.bin to /home/cels/.sdkman/tmp/sbt-1.2.8.zip
Processed binary as: /home/cels/.sdkman/tmp/sbt-1.2.8.zip
Completed post-installation hook...
Moved to archive folder: /home/cels/.sdkman/archives/sbt-1.2.8.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /home/cels/.sdkman/archives/sbt-1.2.8.zip or
        /home/cels/.sdkman/archives/sbt-1.2.8.zip.zip, and cannot find /home/cels/.sdkman/archives/sbt-1.2.8.zip.ZIP, period.

Stop! The archive was corrupt and has been removed! Please try installing again.

Perhaps this is due to some incorrect binary published by the SBT folks. Any ideas @eed3si9n?

@eed3si9n It seems a more stable solution would be to publish the GitHub releases directly, no?

@helpermethod Yes. In fact for stable builds that are listed on SDKMAN I have been uploading to GitHub Releases - https://github.com/sbt/sbt/releases/tag/v1.3.13

@marc0der What's the processing of updating the artifact URLs? I think we should switch over to more stable GitHub Releases one since it's affecting a bunch of build that's using SDKMAN.

We have a database migrations project that can be used for this. Let me know if I can help in any way @eed3si9n

@marc0der I tried to write something here. Does this make sense? - https://github.com/sdkman/sdkman-db-migrations/pull/348

That's awesome, thanks for jumping in and helping!

Was this page helpful?
0 / 5 - 0 ratings