I just installed Chocolatey 3.0.0.39 and I am seeing about a 90% failure rate with the Chocatey.exe automatic deployment.
The script logs show the following:
cmd.exe!!! /c "@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\choc
Chocolatey EXE not found- Install failed
I created a custom script and can execute the batch script as admin and the installation works. Is there a fix for the automatic deployment of Chocolatey?
Chocolatey Failing to deploy
Re: Chocolatey Failing to deploy
The Script executes the commands as shown, waits 30 seconds for completion then tests the 2 locations to see if it can see the Choco EXE.
So first we need to see what the return was from the install POSH command was in the agents script logs then see / verify if the choco EXE exists anywhere on agent. It may have placed it else where, which would cause failure from file check.
Post back here your script logs for the following shell command in step 5
So first we need to see what the return was from the install POSH command was in the agents script logs then see / verify if the choco EXE exists anywhere on agent. It may have placed it else where, which would cause failure from file check.
Post back here your script logs for the following shell command in step 5
Re: Chocolatey Failing to deploy
Here are the command and script logs from the agent:
Command Logs -
cmd.exe!!! /c "@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\choc
0|C:\ProgramData\chocolatey\bin\choco.exe-File or Directory Does Not Exist
0|C:\Documents and Settings\All Users\Application Data\chocolatey\choco.exe-File or Directory Does Not Exist
Chocolatey EXE not found- Install failed
The Script(6375) was successful in the Then section.
Command Logs -
cmd.exe!!! /c "@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\choc
0|C:\ProgramData\chocolatey\bin\choco.exe-File or Directory Does Not Exist
0|C:\Documents and Settings\All Users\Application Data\chocolatey\choco.exe-File or Directory Does Not Exist
Chocolatey EXE not found- Install failed
The Script(6375) was successful in the Then section.
Re: Chocolatey Failing to deploy
I failed to mention it but can I also get the command log entry for the same time period?
The log I am most interested in is the Executing log entry for the powershell cmd being run to install Chocolatey.
It should look like this although in this example the command is to Chocolatey features scan but the log type is the same. We need to see what the agent returned when the install command was executed.
The log I am most interested in is the Executing log entry for the powershell cmd being run to install Chocolatey.
It should look like this although in this example the command is to Chocolatey features scan but the log type is the same. We need to see what the agent returned when the install command was executed.
Re: Chocolatey Failing to deploy
I can run this command from an elevated command prompt and it will work
powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
The script commands fail with the following error
ERROR: The system cannot find the file specified.
C:\WINDOWS\TEMP\chocolatey\chocInstall\chocolatey.zip
System ERROR:
The system cannot find the file specified.
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
At line:216 char:9
+ 2 { throw "$errorMessage 7-Zip encountered a fatal error while ex ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (Unable to unzip...cting the files:String) [], RuntimeException
+ FullyQualifiedErrorId : Unable to unzip package using 7zip. Perhaps try setting $env:chocolateyUseWindowsCompres
sion = 'true' and call install again. Error: 7-Zip encountered a fatal error while extracting the files
Getting latest version of the Chocolatey package for download.
Getting Chocolatey from https://chocolatey.org/api/v2/package/c ... ey/0.10.15.
Downloading 7-Zip commandline tool prior to extraction.
Extracting C:\WINDOWS\TEMP\chocolatey\chocInstall\chocolatey.zip to C:\WINDOWS\TEMP\chocolatey\chocInstall...
powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
The script commands fail with the following error
ERROR: The system cannot find the file specified.
C:\WINDOWS\TEMP\chocolatey\chocInstall\chocolatey.zip
System ERROR:
The system cannot find the file specified.
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
At line:216 char:9
+ 2 { throw "$errorMessage 7-Zip encountered a fatal error while ex ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (Unable to unzip...cting the files:String) [], RuntimeException
+ FullyQualifiedErrorId : Unable to unzip package using 7zip. Perhaps try setting $env:chocolateyUseWindowsCompres
sion = 'true' and call install again. Error: 7-Zip encountered a fatal error while extracting the files
Getting latest version of the Chocolatey package for download.
Getting Chocolatey from https://chocolatey.org/api/v2/package/c ... ey/0.10.15.
Downloading 7-Zip commandline tool prior to extraction.
Extracting C:\WINDOWS\TEMP\chocolatey\chocInstall\chocolatey.zip to C:\WINDOWS\TEMP\chocolatey\chocInstall...
Re: Chocolatey Failing to deploy
Any updates on this?
Re: Chocolatey Failing to deploy
Yes, I am reviewing this now..
Everything inside the Execute command is preformed by POSH being executed. Our command just sends POSH the URL to start the process.
Something is preventing the download of the choco zip file. It sees the URL and tries but fails to save file from what it looks like as when it tries to unzip it its not there.
So either AV is locking and removing the file or possible permissions issue with whom the agents LTsvc runs as or it truly could not get download from URL.
Can you send me the specs to the agent in question?
OS type, build number etc...
My next thought is to run installer and monitor the C:Windows\TEMP directory for file to appear. Does it ? Check the Windows logs for security failures.
Let us know what you find, meanwhile we will try to duplicate the issue here to see if we can explain it.
Everything inside the Execute command is preformed by POSH being executed. Our command just sends POSH the URL to start the process.
Something is preventing the download of the choco zip file. It sees the URL and tries but fails to save file from what it looks like as when it tries to unzip it its not there.
So either AV is locking and removing the file or possible permissions issue with whom the agents LTsvc runs as or it truly could not get download from URL.
Can you send me the specs to the agent in question?
OS type, build number etc...
My next thought is to run installer and monitor the C:Windows\TEMP directory for file to appear. Does it ? Check the Windows logs for security failures.
Let us know what you find, meanwhile we will try to duplicate the issue here to see if we can explain it.
Re: Chocolatey Failing to deploy
This appears to be related to a TLS and Windows update problem.
I tried running this command from Powershell:
powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\choc
And was receiving an error in Powershell - Could not create SSL/TLS secure channel
I eventually found this article: https://workconsultants.com/blog/powers ... e-channel/
After applying the registry key manually, I could run powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))"
So my next question, is it okay for me to add the registry key to the function script?
On a related note, I am encountering this issue on machines running Windows 10 .0.19041 and Server 2016 10.0.14393
I tried running this command from Powershell:
powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\choc
And was receiving an error in Powershell - Could not create SSL/TLS secure channel
I eventually found this article: https://workconsultants.com/blog/powers ... e-channel/
After applying the registry key manually, I could run powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))"
So my next question, is it okay for me to add the registry key to the function script?
On a related note, I am encountering this issue on machines running Windows 10 .0.19041 and Server 2016 10.0.14393
Re: Chocolatey Failing to deploy
Hmmm...
What I can do is make a test for this error and if positive it adds the regkey and retries install commands again.
That way it only goes out to agents that show the issue and not blanket all agents with changes.
I should probably add a switch the "enables" this setting so you have an override to this feature incase you want to opt out.
What I can do is make a test for this error and if positive it adds the regkey and retries install commands again.
That way it only goes out to agents that show the issue and not blanket all agents with changes.
I should probably add a switch the "enables" this setting so you have an override to this feature incase you want to opt out.
Re: Chocolatey Failing to deploy
Ok we are updating to 3.0.0.40
Inside is several little changes.
Under the global manager tool there is a new check box to allow override of the TLS/SSL fix.
Then if the script fails with file not found it will attempt a TLS correction in registry if the previous checkbox is selected.
After the fix is applied it will reattempt a chocolatey install one more time during script run.
This update will go out tonight as an auto update to the plugin and a link in your subscriptions manager on our website will be available for DLL downloads manually.
Inside is several little changes.
Under the global manager tool there is a new check box to allow override of the TLS/SSL fix.
Then if the script fails with file not found it will attempt a TLS correction in registry if the previous checkbox is selected.
After the fix is applied it will reattempt a chocolatey install one more time during script run.
This update will go out tonight as an auto update to the plugin and a link in your subscriptions manager on our website will be available for DLL downloads manually.