Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradle won't install #445

Closed
rodrigomalara opened this issue Jul 20, 2016 · 15 comments
Closed

Gradle won't install #445

rodrigomalara opened this issue Jul 20, 2016 · 15 comments

Comments

@rodrigomalara
Copy link

I'm a newbie and just installed sdk on a Windows 8.1 machine running cygwing.
Installation went smooth but when I try to install gradle I get the following message:

Rodrigo@rodrigo-pc ~
$ sdk install gradle

Downloading: gradle 2.14.1

In progress...

################################################################## 100.0%

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/Rodrigo/.sdkman/archives/gradle-2.14.1.zip or
/home/Rodrigo/.sdkman/archives/gradle-2.14.1.zip.zip, and cannot find /home/Rodrigo/.sdkman/archives/gradle-2.14.1.zip.ZIP, period.

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

Thanks in advance for any help

@xasx
Copy link

xasx commented Jul 20, 2016

I experience this as well.

OS: Linux AMD64, Fedora 24
curl:

curl 7.49.1 (x86_64-redhat-linux-gnu) libcurl/7.49.1 NSS/3.24 Basic ECC zlib/1.2.8 libidn/1.32 libpsl/0.13.0 (+libidn/1.32) libssh2/1.7.0 nghttp2/1.7.1
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz HTTP2 UnixSockets Metalink PSL 

Apparently curl is not following the redirect there:

$ curl --progress-bar --location 'https://api.sdkman.io/download/gradle/2.14.1?platform=Linux' 
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="https://downloads.gradle.org/distributions/gradle-2.14.1-bin.zip">here</a>.</p>
<hr>
<address>Apache/2.2.3 (CentOS) Server at services.gradle.org Port 443</address>
</body></html>

Looks like this is not a standard redirect:

$ curl --head -i --progress-bar --location 'https://api.sdkman.io/download/gradle/2.14.1?platform=Linux'
HTTP/1.1 404 Not Found
Server: nginx/1.9.14
Date: Wed, 20 Jul 2016 14:33:56 GMT
Connection: keep-alive

However the latter does not fit to the first response from the server (nginx vs. Apache)

$ wget https://api.sdkman.io/download/gradle/2.14.1\?platform\=Linux -O- > /dev/null 
--2016-07-20 16:37:34--  https://api.sdkman.io/download/gradle/2.14.1?platform=Linux
Resolving api.sdkman.io (api.sdkman.io)... 162.243.83.58
Connecting to api.sdkman.io (api.sdkman.io)|162.243.83.58|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://services.gradle.org/distributions/gradle-2.14.1-bin.zip [following]
--2016-07-20 16:37:34--  https://services.gradle.org/distributions/gradle-2.14.1-bin.zip
Resolving services.gradle.org (services.gradle.org)... 2400:cb00:2048:1::6819:ac17, 2400:cb00:2048:1::6819:ad17, 104.25.173.23, ...
Connecting to services.gradle.org (services.gradle.org)|2400:cb00:2048:1::6819:ac17|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://downloads.gradle.org/distributions/gradle-2.14.1-bin.zip [following]
--2016-07-20 16:37:35--  https://downloads.gradle.org/distributions/gradle-2.14.1-bin.zip
Resolving downloads.gradle.org (downloads.gradle.org)... 52.85.245.162
Connecting to downloads.gradle.org (downloads.gradle.org)|52.85.245.162|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 45038784 (43M) [application/zip]
Saving to: 'STDOUT'

@xasx
Copy link

xasx commented Jul 20, 2016

Might be an issue with some transparent proxies on my work network. However, updating sdkman itself worked.

So does installing vertx. There's a similar redirection for it:

$ wget 'https://api.sdkman.io/download/vertx/3.3.2?platform=Linux' -O- > /dev/null
--2016-07-20 16:49:01--  https://api.sdkman.io/download/vertx/3.3.2?platform=Linux
Resolving api.sdkman.io (api.sdkman.io)... 162.243.83.58
Connecting to api.sdkman.io (api.sdkman.io)|162.243.83.58|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://bintray.com/artifact/download/vertx/downloads/vert.x-3.3.2-full.zip [following]
--2016-07-20 16:49:02--  https://bintray.com/artifact/download/vertx/downloads/vert.x-3.3.2-full.zip
Resolving bintray.com (bintray.com)... 108.168.194.93, 75.126.118.184
Connecting to bintray.com (bintray.com)|108.168.194.93|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://dl.bintray.com/vertx/downloads/vert.x-3.3.2-full.zip [following]
--2016-07-20 16:49:02--  https://dl.bintray.com/vertx/downloads/vert.x-3.3.2-full.zip
Resolving dl.bintray.com (dl.bintray.com)... 5.153.35.248, 159.122.18.156
Connecting to dl.bintray.com (dl.bintray.com)|5.153.35.248|:443... connected.
HTTP request sent, awaiting response... 302 
Location: https://akamai.bintray.com/53/5395b7f5b112b9652df1b5a103222a4bc9d68c5341b780ec6807ee86a3dc2ad4?__gda__=exp=1469026862~hmac=81e88213cf39330a48ee48ad6310759f3142f0e99b1648dc32c6f9feb5d2ee61&response-content-disposition=attachment%3Bfilename%3D%22vert.x-3.3.2-full.zip%22&response-content-type=application%2Fzip [following]
--2016-07-20 16:49:02--  https://akamai.bintray.com/53/5395b7f5b112b9652df1b5a103222a4bc9d68c5341b780ec6807ee86a3dc2ad4?__gda__=exp=1469026862~hmac=81e88213cf39330a48ee48ad6310759f3142f0e99b1648dc32c6f9feb5d2ee61&response-content-disposition=attachment%3Bfilename%3D%22vert.x-3.3.2-full.zip%22&response-content-type=application%2Fzip
Resolving akamai.bintray.com (akamai.bintray.com)... 104.109.102.245
Connecting to akamai.bintray.com (akamai.bintray.com)|104.109.102.245|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 72288188 (69M) [application/zip]
Saving to: 'STDOUT'

@xasx
Copy link

xasx commented Jul 20, 2016

Comparing my own outputs and matching curl's output to wget's, I think that it is a problem on Gradle's side. Something with the 301 redirect probably,

https://services.gradle.org/distributions/gradle-2.14.1-bin.ziphttps://downloads.gradle.org/distributions/gradle-2.14.1-bin.zip

@rodrigomalara
Copy link
Author

Thanks xasx for the help.

I've installed sdkman today but anyway forced an upgrade.
Still not working.

I tried installing vertx and it works.
Is there a way to tell sdkman where it should point for gradle distribution ?

@xasx
Copy link

xasx commented Jul 21, 2016

@rodrigomalara sdkman retrieves downloads from a resource on sdkman.io, e.g.

https://api.sdkman.io/download/gradle/2.14.1?platform=Linux
(your browser will download this just fine)

It is implicitly being built from the pattern

https://api.sdkman.io/download/<candidate>/<version>?platform=<platform>

I haven't found a way to override this for specific candidates so far. Probably it would be enough to redirect to the downloads.gradle.org URI instead of the services.gradle.org one.
However, from a Gradle distributor point of view, I don't know whether it is desirable.

@xasx
Copy link

xasx commented Jul 21, 2016

Workaround: Download manually and copy the -bin.zip over to $HOME/.sdkman/archives/gradle-$VERSION.zip (without the bin), then install.

@xasx
Copy link

xasx commented Jul 22, 2016

Created a topic in their forum to help sorting this out:

https://discuss.gradle.org/t/zip-download-redirect-and-sdkman/18629?u=xasx

@marc0der
Copy link
Member

marc0der commented Jul 22, 2016

I've just tried this locally and have no problem whatsoever atm. Curl follows the redirects without any issues. It could have been a problem with one of the proxies, or even with a CDN. Could you please try again and let me know if this is resolved?

@xasx the download endpoint that you were calling will give a 404 because the HEAD method is not supported, only GET.

@xasx
Copy link

xasx commented Jul 25, 2016

@marc0der In fact it works now, at least for me.

@rodrigomalara Perhaps you can also re-check.

@marc0der
Copy link
Member

No further response so closing this issue.

@tbodine88
Copy link

tbodine88 commented Nov 29, 2016

I experienced this same issue last night,

I finally resorted to downloading gradle, unzipping and installing manually. Was closing premature?

BTW I thought my issue might be caused by installing unxutils.zip instead of cygwin, but when I removed zip and unzip in unxutils , then used cygwin instead I still got the same "Stop! The archive was corrupt and has been removed!" error

@pchartrand
Copy link

same problem using curl -s get.sdkman.io

inspecting the install script I found the url called for downloading is

https://api.sdkman.io/1/res?platform=Linux&purpose=install

this returns a 404 from a tomcat server on bintray.com

https://bintray.com/artifact/download/sdkman/generic/sdkman-cli-5.2.0%2B125.zip

@tbodine88
Copy link

tbodine88 commented Dec 6, 2016 via email

@marc0der
Copy link
Member

marc0der commented Dec 6, 2016

This had nothing to do with Gradle not downloading. What you were experiencing was due to the sdkman binary not being published to bintray after the release of 5.2.0. I rectified this.

@pchartrand
Copy link

Thanks for correcting the situation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants