You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Chocolatey installer no longer uses proxies even though chocolateyProxyLocation is set.
This leaves chocolatey installation in an unfinished/broken state where the only thing that happens is the creation of an empty C:\ProgramData\Chocolatey\lib\chocolatey folder. See related issue here: #3.
What is Expected?
Chocolatey installer to use proxies when chocolateyProxyLocation is set.
How Did You Get This To Happen? (Steps to Reproduce)
Set a proxy to use for installing chocolatey: $env:chocolateyProxyLocation="http://proxy.mycorp.com:81"
Run the installer: .\install.ps1
Output Log
Full Log Output
PS C:\Windows\Temp>$env:chocolateyProxyLocation="http://proxy.mycorp.com:81"
PS C:\Windows\Temp> .\install.ps1
Forcing web requests to allow TLS v1.2 (Required for requests to Chocolatey.org)
Getting latest version of the Chocolatey package for download.
Not using proxy.
Exception calling "DownloadString" with "1" argument(s): "Unable to connect to the remote server"
At C:\Windows\Temp\install.ps1:219 char:5
* (Get-Downloader $url @ProxyConfiguration).DownloadString($url)
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* CategoryInfo : NotSpecified: (:) [], MethodInvocationException
* FullyQualifiedErrorId : WebException Getting Chocolatey from . Downloading to C:\Users\WDAGUtilityAccount\AppData\Local\Temp\chocolatey\chocoInstall\chocolatey.zip Not using proxy. Exception calling "DownloadFile" with "2" argument(s): "The path is not of a legal form." At C:\Windows\Temp\install.ps1:261 char:5 + (Get-Downloader $url @ProxyConfiguration).DownloadFile($url, $fil ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : ArgumentException Extracting C:\Users\WDAGUtilityAccount\AppData\Local\Temp\chocolatey\chocoInstall\chocolatey.zip to C:\Users\WDAGUtilityAccount\AppData\Local\Temp\chocolatey\chocoInstall Microsoft.PowerShell.Archive\Expand-Archive : The path 'C:\Users\WDAGUtilityAccount\AppData\Local\Temp\chocolatey\chocoInstall\chocolatey.zip' either does not exist or is
not a valid file system path.
At C:\Windows\Temp\install.ps1:517 char:5
* Microsoft.PowerShell.Archive\Expand-Archive -Path $file -Destinat ...
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* CategoryInfo : InvalidArgument: (C:\Users\WDAGUt...\chocolatey.zip:String) [Expand-Archive], InvalidOpe
rationException
* FullyQualifiedErrorId : ArchiveCmdletPathNotFound,Expand-Archive
Installing Chocolatey on the local machine
&: The term 'C:\Users\WDAGUtilityAccount\AppData\Local\Temp\chocolatey\chocoInstall\tools\chocolateyInstall.ps1' is
not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or
if a path was included, verify that the path is correct and try again.
At C:\Windows\Temp\install.ps1:528 char:3
*&$chocoInstallPS1*~~~~~~~~~~~~~~~~
* CategoryInfo : ObjectNotFound: (C:\Users\WDAGUt...ateyInstall.ps1:String) [], CommandNotFoundException
* FullyQualifiedErrorId : CommandNotFoundException
Ensuring Chocolatey commands are on the path
Ensuring chocolatey.nupkg is in the lib folder
Context
The issue appears to be in this bit of code (cannot find the GH repo for this):
if (-not ($ProxyUrl-and$ProxyCredential)) {
Write-Host"Not using proxy."$downloader.Proxy=$null
}
This appears to require that both ProxyUrl and ProxyCredential is set despite the code seemingly handling cases where ProxyCredential isn't set. See output from my run below:
What You Are Seeing?
Chocolatey installer no longer uses proxies even though
chocolateyProxyLocation
is set.This leaves chocolatey installation in an unfinished/broken state where the only thing that happens is the creation of an empty
C:\ProgramData\Chocolatey\lib\chocolatey
folder. See related issue here: #3.What is Expected?
Chocolatey installer to use proxies when
chocolateyProxyLocation
is set.How Did You Get This To Happen? (Steps to Reproduce)
$env:chocolateyProxyLocation="http://proxy.mycorp.com:81"
.\install.ps1
Output Log
Full Log Output
Context
The issue appears to be in this bit of code (cannot find the GH repo for this):
This appears to require that both
ProxyUrl
andProxyCredential
is set despite the code seemingly handling cases whereProxyCredential
isn't set. See output from my run below:Changing
-not ($ProxyUrl -and $ProxyCredential)
to-not ($ProxyUrl -or $ProxyCredential)
fixed this issue for me.┆Issue is synchronized with this GitLab issue by Unito
The text was updated successfully, but these errors were encountered: