chocolatey / cChoco

Community resource to manage Chocolatey
Apache License 2.0
153 stars 99 forks source link

cChocoInstaller fails with request aborted - connection was closed unexpectedly #116

Closed smcolligan closed 5 years ago

smcolligan commented 5 years ago

We are using the cChocoInstaller resource to install chocolatey so that we can use chocolatey to install the Puppet Agent package.

When we provision a full environment (~18 nodes) we regularly get errors such as this on some of the nodes:

Exception calling \"DownloadFile\" with \"2\" argument(s): \"The request was aborted: The connection was closed unexpectedly.\"

PowerShell DSC resource cChocoInstaller failed to execute Set-TargetResource functionality with error message: Unable to unzip package using 7zip. Perhaps try setting $env:chocolateyUseWindowsCompression = 'true' and call install again. Error: 7-Zip encountered a fatal error while extracting the files

In this example, 11 nodes failed with this message, and 7 succeeded. All are using the same Windows Server 2016 image in Azure.

I assumed this could be a rate-limiting issue but looking at the chocolatey site, I'd expect to be getting a 429 error message?

Any ideas?

Thanks,

Sean

pauby commented 5 years ago

@smcolligan See https://chocolatey.org/docs/community-packages-disclaimer#rate-limiting - this is not a cChoco issue.

smcolligan commented 5 years ago

Thanks @pauby , but shouldn't I be seeing messages like the link you provided shows? Shouldn't I be seeing a 429 or too many connections response if I'm being rate-limited?

pauby commented 5 years ago

Once you have been rate limited you'll be blocked for an hour. When last did you see the error message? If it was within the last hour can you visit https://chocolatey.org (assuming you are coming from the same IP) and see what the message is?

smcolligan commented 5 years ago

The message is coming from VMs provisioned in Azure. I RDP'd to one of the VMs that failed to install to browse the chocolatey site, but I don't see any rate-limiting messages.

I agree that this is likely a rate-limit issue, I just wanted to confirm since the error messages didn't indicate that. I wanted to make sure this wasn't some other case.

Also, given this is on Azure from a shared public IP, I expect I may be lumped in with many other requests in regards to rate-limiting.

I'm going to look at installing the puppet agent directly without chocolatey from a separate source to avoid this issue.

Thanks for your help, you can close this.

Sean

pauby commented 5 years ago

Also, given this is on Azure from a shared public IP, I expect I may be lumped in with many other requests in regards to rate-limiting.

I would suggest that is what is happening. If you use https://chocolatey.org/contact we can look at it there - make sure you provide your IP.

cdhunt commented 4 years ago

I'm running into this setting up just 3 nodes in Azure. Two worked fine and one is getting a 429 error. No issues if I manually download install.ps and 7za.exe from that system.

VERBOSE: [vm-1]:                            [[cChocoInstaller]installChoco] Downloading
https://chocolatey.org/install.ps1 to C:\ProgramData\chocolatey\install.ps1
Exception calling "DownloadFile" with "2" argument(s): "The remote server returned an error: (429) Too Many Requests."
    + CategoryInfo          : NotSpecified: (:) [], CimException
    + FullyQualifiedErrorId : WebException
    + PSComputerName        : localhost
pauby commented 4 years ago

@cdhunt The 429 error you're getting is Rate Limiting on Chocolatey.org. The solution to that is listed on that page.