4

I'm trying to use the windows package manager chocolatey to install jdk8, but it takes forever, powershell just print out the following and never ends:

jdk8 v8.0.66
 Downloading JDK from http://download.oracle.com/otn-pub/java/jdk/8u66-b18/jdk-8u66-windows-x64.ex
e

I copy the link and try to open in browser, what I got is an error page from oracle saying that I must agree to the OTN license terms blah blah ...

Is there a way to get around this?? Why doesn't chocolatey just fail??

2 Answers 2

3

Let's start with terminology - why doesn't the package just fail. Chocolatey itself just releases over to the package to do the install. If the package is badly behaved (and it's not a badly behaved scenario that Chocolatey yet covers), then you will see behavior such as what you are seeing.

Chocolatey Execution Timeout

Chocolatey has a default timeout of 45 minutes for a package install. You can change the default timeout, see choco install -h or https://github.com/chocolatey/choco/wiki/CommandsReference#default-options-and-switches:

--execution-timeout=VALUE
  CommandExecutionTimeoutSeconds - Override the default execution
  timeout in the configuration of 2700 seconds.

You can also set the value in the chocolatey.config file.

Package Issues?

If you are having issues with a package, it is best to contact the maintainers of that package on the package site https://chocolatey.org/packages/jdk8/8.0.66 :

Contact Maintainers link

You can also read through the disqus forum at the bottom and post there as well. That will also reach the maintainers.

Organizations Should Not Depend on the Community Feed

One last reminder - if an organization comes across this post - You should really read over why an organization should not depend on the community packages repository (aka https://chocolatey.org/packages) at organization use of Chocolatey.org. Copied here:

First of all, it goes without stating that if you are a business and you are using Chocolatey, you should think long and hard before trusting an external source you have no control over (chocolatey.org packages, in addition to all of the binaries that download from official distribution channels over the internet). It is too easy to set up your own private feed where you can vet packages and have complete control over the binaries and what gets installed. This is what we recommend for businesses that use Chocolatey in production scenarios (and what many of them do).

5
  • We wrote answers at the same time ;) I send information to maintainer.
    – agabrys
    Dec 22, 2015 at 21:31
  • I noticed! Never saw that before :) Dec 22, 2015 at 21:31
  • Can a super big package tell the choco installer to extend its timeout? eg: a package that is a 7GB download say and then takes a long time to install because it does a lot of work?
    – fiat
    Jun 1, 2016 at 1:20
  • The user controls the timeout. The default timeout of 45 minutes is pretty big - however we found an issue where the download timeout was much less, and we've fixed it in the 0.9.10 beta to match the command timeout. Jun 1, 2016 at 1:48
  • In 0.9.10, choco is also better at telling the user what happened and how to fix it up. You can also use read-host with a timeout (timeout is built into 0.9.10) asking the user if they have a large enough timeout and failing the package if they pick the non-default answer of no. Not the default because the default is to let the pkg continue when used in unattended operations. Jun 1, 2016 at 1:55
2

The package is broken, because (as you written) the URL http://download.oracle.com/otn-pub/java/jdk/8u66-b18/jdk-8u66-windows-x64.exe returns error page instead of exe file:

error page

The chocolatey didn't fail, because the package author:

  • download file without using chocolatey tools (e.g. without checksum verification)
  • didn't throw any error

I send an information to the maintainers.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .