chocolatey-archive/puppet-chocolatey

Upgrade fails

genebean opened this issue · 8 comments

I have Chocolatey set to upgrade itself via Puppet but with the 0.9.9.7 release and now with the 0.9.9.8 release I get the following error:

PS C:\Windows\system32> puppet agent -t
Notice: Ignoring --listen on onetime run
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Error loading fact C:/ProgramData/PuppetLabs/puppet/var/lib/facter/facts.rb: cannot load such file -- util/sssd
Info: Caching catalog for adm-recruitdb.uwg.westga.edu
Info: Applying configuration version '1435590280'
←[1;31mError: Could not update: Execution of 'C:\ProgramData\chocolatey\bin\choco.exe upgrade chocolatey -dvy ' returned
 1: Chocolatey v0.9.9.7
Chocolatey is running on Windows v 6.1.7601.65536
Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old".
This is try 1/3. Retrying after 300 milliseconds.
 Error converted to warning:
 System.UnauthorizedAccessException: Access to the path 'C:\ProgramData\chocolatey\choco.exe.old' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.File.InternalDelete(String path, Boolean checkHost)
   at chocolatey.infrastructure.tolerance.FaultTolerance.<>c__DisplayClass1.<retry>b__0()
   at chocolatey.infrastructure.tolerance.FaultTolerance.retry[T](Int32 numberOfTries, Func`1 function, Int32 waitDurati
onMilliseconds, Int32 increaseRetryByMilliseconds)
This is try 2/3. Retrying after 400 milliseconds.
 Error converted to warning:
 System.UnauthorizedAccessException: Access to the path 'C:\ProgramData\chocolatey\choco.exe.old' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.File.InternalDelete(String path, Boolean checkHost)
   at chocolatey.infrastructure.tolerance.FaultTolerance.<>c__DisplayClass1.<retry>b__0()
   at chocolatey.infrastructure.tolerance.FaultTolerance.retry[T](Int32 numberOfTries, Func`1 function, Int32 waitDurati
onMilliseconds, Int32 increaseRetryByMilliseconds)
Maximum tries of 3 reached. Throwing error.
Attempting to delete choco.exe.old ran into an issue:
 Access to the path 'C:\ProgramData\chocolatey\choco.exe.old' is denied.
Command line: "C:\ProgramData\chocolatey\choco.exe" upgrade chocolatey -dvy
Received arguments: upgrade chocolatey -dvy

When investigating on systems that show this problem I see in task manager that there are two choco.exe processes still running. One just has "chocolatey" as its description but the other says "ShimGen generated shim". If I kill these then Puppet can upgrade things just fine.

I am seeing this problem on 2008 R2, 2012, and 2012 R2.

It appears you have a hanging command running out there. I wonder if this is the result of something else?

Can you pass along the logs of 0.9.9.7/0.9.9.8 upgrade attempts? I want to see if there are any blind calls to list running in the background.

Sorry for the delay... where would I find the logs you are looking for?

Depends on where the choco install is located, but likely C:\ProgramData\chocolatey\logs

Uploaded the log to https://gist.github.com/genebean/9d042133cacc7ebf3512 Check out around line 603.

Have you tried to upgrade choco in previous versions or is this the first time?

The is the second version in a row that I have had the same issue.

This is 0.9.9.x upgrading to 0.9.9+ series though, which is believed to work. But apparently it is failing.

@genebean followup here - what I think I see happening is that something is running choco in the background.