Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packages are uninstalled in the wrong order when uninstalling a package with its dependencies #3581

Open
6 tasks done
gpwen opened this issue Dec 3, 2024 · 2 comments
Open
6 tasks done

Comments

@gpwen
Copy link

gpwen commented Dec 3, 2024

Checklist

  • I confirm there are no unresolved issues reported on the Chocolatey Status page.
  • I have verified this is the correct repository for opening this issue.
  • I have verified no other issues exist related to my problem.
  • I have verified this is not an issue for a specific package.
  • I have verified this issue is not security related.
  • I confirm I am using official, and not unofficial, or modified, Chocolatey products.

What You Are Seeing?

When uninstalling a package with its dependencies using command:
choco uninstall -x -y <pkg>
Chocolatey 2.4.0 will uninstall package dependencies before the package itself. That does not seem to be the correct order.

On the other hand, Chocolatey 1.4.0 will uninstall the package itself before its dependencies. That's the expected behavior.

This looks like a regression defect.

What is Expected?

When uninstalling a package with its dependencies, the package should be uninstalled before its dependencies.

How Did You Get This To Happen?

The following replication steps are performed in Windows Sandbox to ensure a clean environment.

  1. Install Chocolatey 2.4.0 in Windows Sandbox;

  2. Install package chocolatey-core.extension with the following command:

    choco install -y chocolatey-core.extension

    Chocolatey will install its dependency chocolatey-compatibility.extension v1.0.0, then that package itsself chocolatey-core.extension v1.4.0.

  3. Now uninstall chocolatey-core.extension with its dependencies:

    choco uninstall -x -y chocolatey-core.extension

    The output from the above command is:

    Chocolatey v2.4.0
    Uninstalling the following packages:
    chocolatey-core.extension
    
    chocolatey-compatibility.extension v1.0.0
     Skipping auto uninstaller - No registry snapshot.
     Uninstalled chocolatey-compatibility extensions.
     chocolatey-compatibility.extension has been successfully uninstalled.
    
    chocolatey-core.extension v1.4.0
     Skipping auto uninstaller - No registry snapshot.
     Uninstalled chocolatey-core extensions.
     chocolatey-core.extension has been successfully uninstalled.
    
    Chocolatey uninstalled 2/2 packages.
     See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
    

    Apparently the dependency package (chocolatey-compatibility.extension) has been uninstalled before the package itself (chocolatey-core.extension).

  4. Downgrade Chocolatey to version 1.4.0:

    choco upgrade chocolatey -version 1.4.0 -allow-downgrade -y

  5. Repeat steps 2 and 3:

    choco install -y chocolatey-core.extension
    choco uninstall -x -y chocolatey-core.extension
    

    The output from the uninstall command is:

    Chocolatey v1.4.0
    Uninstalling the following packages:
    chocolatey-core.extension
    
    chocolatey-core.extension v1.4.0
     Skipping auto uninstaller - No registry snapshot.
     Uninstalled chocolatey-core extensions.
     chocolatey-core.extension has been successfully uninstalled.
    
    chocolatey-compatibility.extension v1.0.0
     Skipping auto uninstaller - No registry snapshot.
     Uninstalled chocolatey-compatibility extensions.
     chocolatey-compatibility.extension has been successfully uninstalled.
    
    Chocolatey uninstalled 2/2 packages.
    

    That means Chocolatey 1.4.0 uninstalls the package chocolatey-core.extension before its dependency chocolatey-compatibility.extension correctly.

System Details

  • Operating System: Windows 11 23H2 (Sandbox)
  • Windows PowerShell version: 7.4.6
  • Chocolatey CLI Version: 2.4.0
  • Chocolatey Licensed Extension version: N/A
  • Chocolatey License type: N/A
  • Terminal/Emulator: Windows Terminal

Installed Packages

chocolatey-compatibility.extension v1.0.0
chocolatey-core.extension v1.4.0

Output Log

2024-12-03 09:25:25,448 4164 [INFO ] - ============================================================
2024-12-03 09:25:25,817 4164 [INFO ] - Chocolatey v2.4.0
2024-12-03 09:25:25,831 4164 [DEBUG] - Chocolatey is running on Windows v 10.0.22621.0
2024-12-03 09:25:25,831 4164 [DEBUG] - Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old".
2024-12-03 09:25:25,846 4164 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\choco.exe.old".
2024-12-03 09:25:25,849 4164 [DEBUG] - Command line: "C:\ProgramData\chocolatey\choco.exe" uninstall -x -y chocolatey-core.extension
2024-12-03 09:25:25,849 4164 [DEBUG] - Received arguments: uninstall -x -y chocolatey-core.extension
2024-12-03 09:25:25,880 4164 [DEBUG] - RemovePendingPackagesTask is now ready and waiting for PreRunMessage.
2024-12-03 09:25:25,894 4164 [DEBUG] - Sending message 'PreRunMessage' out if there are subscribers...
2024-12-03 09:25:25,894 4164 [DEBUG] - [Pending] Removing all pending packages that should not be considered installed...
2024-12-03 09:25:25,926 4164 [DEBUG] - Performing validation checks.
2024-12-03 09:25:25,926 4164 [DEBUG] - Global Configuration Validation Checks:
2024-12-03 09:25:25,926 4164 [DEBUG] -  - Package Exit Code / Exit On Reboot = Checked
2024-12-03 09:25:25,926 4164 [DEBUG] - System State Validation Checks:
2024-12-03 09:25:25,926 4164 [DEBUG] -  Reboot Requirement Checks:
2024-12-03 09:25:25,926 4164 [DEBUG] -  - Pending Computer Rename = Checked
2024-12-03 09:25:25,926 4164 [DEBUG] -  - Pending Component Based Servicing = Checked
2024-12-03 09:25:25,926 4164 [DEBUG] -  - Pending Windows Auto Update = Checked
2024-12-03 09:25:25,926 4164 [DEBUG] -  - Pending File Rename Operations = Checked
2024-12-03 09:25:25,926 4164 [DEBUG] -  - Pending Windows Package Installer = Checked
2024-12-03 09:25:25,926 4164 [DEBUG] -  - Pending Windows Package Installer SysWow64 = Checked
2024-12-03 09:25:25,926 4164 [DEBUG] - Cache Folder Lockdown Checks:
2024-12-03 09:25:25,926 4164 [DEBUG] -  - Elevated State = Checked
2024-12-03 09:25:25,926 4164 [DEBUG] -  - Folder Exists = Checked
2024-12-03 09:25:25,943 4164 [DEBUG] -  - Folder lockdown = Checked
2024-12-03 09:25:25,943 4164 [INFO ] - 3 validations performed. 3 success(es), 0 warning(s), and 0 error(s).
2024-12-03 09:25:25,958 4164 [DEBUG] - The source 'https://server.company.com/artifactory/api/nuget/v3/choco-repo' evaluated to a 'normal' source type
2024-12-03 09:25:25,958 4164 [DEBUG] - 
NOTE: Hiding sensitive configuration data! Please double and triple
 check to be sure no sensitive data is shown, especially if copying
 output to a gist for review.
2024-12-03 09:25:25,958 4164 [DEBUG] - Configuration: CommandName='uninstall'|
CacheLocation='C:\Users\JoeAccount\AppData\Local\Temp\chocolatey'|

CommandExecutionTimeoutSeconds='18000'|WebRequestTimeoutSeconds='30'|
Sources='https://server.company.com/artifactory/api/nuget/v3/choco-repo'|

SourceType='normal'|IncludeConfiguredSources='False'|
ShowOnlineHelp='False'|Debug='False'|Verbose='False'|Trace='False'|
Force='False'|Noop='False'|HelpRequested='False'|
UnsuccessfulParsing='False'|RegularOutput='True'|QuietOutput='False'|
PromptForConfirmation='False'|DisableCompatibilityChecks='False'|
AcceptLicense='True'|AllowUnofficialBuild='False'|
Input='chocolatey-core.extension'|AllVersions='False'|
SkipPackageInstallProvider='False'|SkipHookScripts='False'|
PackageNames='chocolatey-core.extension'|Prerelease='False'|
ForceX86='False'|OverrideArguments='False'|NotSilent='False'|
ApplyPackageParametersToDependencies='False'|
ApplyInstallArgumentsToDependencies='False'|IgnoreDependencies='False'|
CacheExpirationInMinutes='30'|AllowDowngrade='False'|
ForceDependencies='True'|PinPackage='False'|
Information.PlatformType='Windows'|
Information.PlatformVersion='10.0.22621.0'|
Information.PlatformName='Windows 11'|
Information.ChocolateyVersion='2.4.0.0'|
Information.ChocolateyProductVersion='2.4.0'|
Information.FullName='choco, Version=2.4.0.0, Culture=neutral, PublicKeyToken=79d02ea9cad655eb'|

Information.Is64BitOperatingSystem='True'|
Information.Is64BitProcess='True'|Information.IsInteractive='True'|
Information.UserName='JoeAccount'|
Information.UserDomainName='4069CC08-B69B-4'|
Information.IsUserAdministrator='True'|
Information.IsUserSystemAccount='False'|
Information.IsUserRemoteDesktop='False'|
Information.IsUserRemote='False'|Information.IsProcessElevated='True'|
Information.IsLicensedVersion='False'|
Information.IsLicensedAssemblyLoaded='False'|
Information.LicenseType='Foss'|
Information.CurrentDirectory='C:\Users\JoeAccount'|
Features.AutoUninstaller='True'|Features.ChecksumFiles='True'|
Features.AllowEmptyChecksums='False'|
Features.AllowEmptyChecksumsSecure='True'|
Features.FailOnAutoUninstaller='False'|
Features.FailOnStandardError='False'|Features.UsePowerShellHost='True'|
Features.LogEnvironmentValues='False'|Features.LogWithoutColor='False'|
Features.VirusCheck='False'|
Features.FailOnInvalidOrMissingLicense='False'|
Features.IgnoreInvalidOptionsSwitches='True'|
Features.UsePackageExitCodes='True'|
Features.UseEnhancedExitCodes='False'|
Features.UseFipsCompliantChecksums='False'|
Features.ShowNonElevatedWarnings='True'|
Features.ShowDownloadProgress='True'|
Features.StopOnFirstPackageFailure='False'|
Features.UseRememberedArgumentsForUpgrades='False'|
Features.IgnoreUnfoundPackagesOnUpgradeOutdated='False'|
Features.SkipPackageUpgradesWhenNotInstalled='False'|
Features.RemovePackageInformationOnUninstall='False'|
Features.ExitOnRebootDetected='False'|
Features.LogValidationResultsOnWarnings='True'|
Features.UsePackageRepositoryOptimizations='True'|
Features.UsePackageHashValidation='False'|
ListCommand.LocalOnly='False'|
ListCommand.IdOnly='False'|ListCommand.IncludeRegistryPrograms='False'|
ListCommand.PageSize='25'|ListCommand.Exact='False'|
ListCommand.ByIdOnly='False'|ListCommand.ByTagOnly='False'|
ListCommand.IdStartsWith='False'|ListCommand.OrderByPopularity='False'|
ListCommand.ApprovedOnly='False'|
ListCommand.DownloadCacheAvailable='False'|
ListCommand.NotBroken='False'|
ListCommand.IncludeVersionOverrides='False'|
ListCommand.ExplicitPageSize='False'|
ListCommand.ExplicitSource='False'|
UpgradeCommand.FailOnUnfound='False'|
UpgradeCommand.FailOnNotInstalled='False'|
UpgradeCommand.NotifyOnlyAvailableUpgrades='False'|
UpgradeCommand.ExcludePrerelease='False'|
UpgradeCommand.IgnorePinned='False'|
NewCommand.AutomaticPackage='False'|
NewCommand.UseOriginalTemplate='False'|SourceCommand.Command='unknown'|
SourceCommand.Priority='0'|SourceCommand.BypassProxy='False'|
SourceCommand.AllowSelfService='False'|
SourceCommand.VisibleToAdminsOnly='False'|
FeatureCommand.Command='unknown'|ConfigCommand.Command='Unknown'|
ApiKeyCommand.Command='Unknown'|PinCommand.Command='Unknown'|
OutdatedCommand.IgnorePinned='False'|
ExportCommand.IncludeVersionNumbers='False'|Proxy.BypassOnLocal='True'|
TemplateCommand.Command='unknown'|CacheCommand.Command='Unknown'|
CacheCommand.RemoveExpiredItemsOnly='False'|
2024-12-03 09:25:25,958 4164 [DEBUG] - _ Chocolatey:ChocolateyUninstallCommand - Normal Run Mode _
2024-12-03 09:25:25,958 4164 [INFO ] - Uninstalling the following packages:
2024-12-03 09:25:26,342 4164 [INFO ] - chocolatey-core.extension
2024-12-03 09:25:26,390 4164 [DEBUG] - Running list with the following filter = ''
2024-12-03 09:25:26,390 4164 [DEBUG] - --- Start of List ---
2024-12-03 09:25:26,453 4164 [DEBUG] - Process Tree: Chocolatey CLI => Chocolatey CLI => powershell => explorer
2024-12-03 09:25:26,474 4164 [DEBUG] - Updating User Agent to 'Chocolatey Command Line/2.4.0 (Chocolatey CLI) via NuGet Client/6.4.1 (Microsoft Windows NT 10.0.22621.0)'.
2024-12-03 09:25:26,505 4164 [DEBUG] - Resolving resource PackageSearchResource for source C:\ProgramData\chocolatey\lib
2024-12-03 09:25:26,644 4164 [DEBUG] - chocolatey 2.4.0
2024-12-03 09:25:26,661 4164 [DEBUG] - chocolatey-compatibility.extension 1.0.0
2024-12-03 09:25:26,661 4164 [DEBUG] - chocolatey-core.extension 1.4.0
2024-12-03 09:25:26,661 4164 [DEBUG] - --- End of List ---
2024-12-03 09:25:26,661 4164 [DEBUG] - Running list with the following filter = ''
2024-12-03 09:25:26,661 4164 [DEBUG] - --- Start of List ---
2024-12-03 09:25:26,661 4164 [DEBUG] - Process Tree: Chocolatey CLI => Chocolatey CLI => powershell => explorer
2024-12-03 09:25:26,661 4164 [DEBUG] - Updating User Agent to 'Chocolatey Command Line/2.4.0 (Chocolatey CLI) via NuGet Client/6.4.1 (Microsoft Windows NT 10.0.22621.0)'.
2024-12-03 09:25:26,661 4164 [DEBUG] - chocolatey 2.4.0
2024-12-03 09:25:26,661 4164 [DEBUG] - chocolatey-compatibility.extension 1.0.0
2024-12-03 09:25:26,661 4164 [DEBUG] - chocolatey-core.extension 1.4.0
2024-12-03 09:25:26,661 4164 [DEBUG] - --- End of List ---
2024-12-03 09:25:26,739 4164 [DEBUG] - Running list with the following filter = ''
2024-12-03 09:25:26,739 4164 [DEBUG] - --- Start of List ---
2024-12-03 09:25:26,739 4164 [DEBUG] - Process Tree: Chocolatey CLI => Chocolatey CLI => powershell => explorer
2024-12-03 09:25:26,739 4164 [DEBUG] - Updating User Agent to 'Chocolatey Command Line/2.4.0 (Chocolatey CLI) via NuGet Client/6.4.1 (Microsoft Windows NT 10.0.22621.0)'.
2024-12-03 09:25:26,739 4164 [DEBUG] - chocolatey 2.4.0
2024-12-03 09:25:26,739 4164 [DEBUG] - chocolatey-compatibility.extension 1.0.0
2024-12-03 09:25:26,739 4164 [DEBUG] - chocolatey-core.extension 1.4.0
2024-12-03 09:25:26,739 4164 [DEBUG] - --- End of List ---
2024-12-03 09:25:26,755 4164 [INFO ] - 
chocolatey-compatibility.extension v1.0.0
2024-12-03 09:25:26,755 4164 [DEBUG] - Running beforeModify step for 'chocolatey-compatibility.extension'
2024-12-03 09:25:26,755 4164 [DEBUG] - Backing up package files for 'chocolatey-compatibility.extension'
2024-12-03 09:25:26,802 4164 [DEBUG] - Attempting to create directory "C:\ProgramData\chocolatey\lib-bkp\chocolatey-compatibility.extension".
2024-12-03 09:25:26,802 4164 [DEBUG] - Moving C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension to C:\ProgramData\chocolatey\lib-bkp\chocolatey-compatibility.extension\1.0.0
2024-12-03 09:25:26,802 4164 [DEBUG] - Moving 'C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension'
 to 'C:\ProgramData\chocolatey\lib-bkp\chocolatey-compatibility.extension\1.0.0'
2024-12-03 09:25:28,818 4164 [DEBUG] - Attempting to create directory "C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension".
2024-12-03 09:25:28,818 4164 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\chocolatey-compatibility.extension\1.0.0\chocolatey-compatibility.extension.nupkg"
 to "C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension\chocolatey-compatibility.extension.nupkg".
2024-12-03 09:25:28,818 4164 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\chocolatey-compatibility.extension\1.0.0\chocolatey-compatibility.extension.nuspec"
 to "C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension\chocolatey-compatibility.extension.nuspec".
2024-12-03 09:25:28,818 4164 [DEBUG] - Attempting to create directory "C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension\extensions".
2024-12-03 09:25:28,818 4164 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\chocolatey-compatibility.extension\1.0.0\extensions\chocolatey-compatibility.psm1"
 to "C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension\extensions\chocolatey-compatibility.psm1".
2024-12-03 09:25:28,818 4164 [DEBUG] - Attempting to create directory "C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension\extensions\helpers".
2024-12-03 09:25:28,818 4164 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\chocolatey-compatibility.extension\1.0.0\extensions\helpers\Get-PackageParameters.ps1"
 to "C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension\extensions\helpers\Get-PackageParameters.ps1".
2024-12-03 09:25:28,818 4164 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\chocolatey-compatibility.extension\1.0.0\extensions\helpers\Get-UninstallRegistryKey.ps1"
 to "C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension\extensions\helpers\Get-UninstallRegistryKey.ps1".
2024-12-03 09:25:28,818 4164 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\chocolatey-compatibility.extension\1.0.0\extensions\helpers\Install-ChocolateyDesktopLink.ps1"
 to "C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension\extensions\helpers\Install-ChocolateyDesktopLink.ps1".
2024-12-03 09:25:28,818 4164 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\chocolatey-compatibility.extension\1.0.0\extensions\helpers\Write-ChocolateyFailure.ps1"
 to "C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension\extensions\helpers\Write-ChocolateyFailure.ps1".
2024-12-03 09:25:28,818 4164 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\chocolatey-compatibility.extension\1.0.0\extensions\helpers\Write-ChocolateySuccess.ps1"
 to "C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension\extensions\helpers\Write-ChocolateySuccess.ps1".
2024-12-03 09:25:28,818 4164 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\chocolatey-compatibility.extension\1.0.0\extensions\helpers\Write-FileUpdateLog.ps1"
 to "C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension\extensions\helpers\Write-FileUpdateLog.ps1".
2024-12-03 09:25:30,336 4164 [DEBUG] - Capturing package files in 'C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension'
2024-12-03 09:25:30,336 4164 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension\chocolatey-compatibility.extension.nupkg'
  with checksum 'FA277C3720AB0DA4947D11272DAB96A8'
2024-12-03 09:25:30,349 4164 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension\chocolatey-compatibility.extension.nuspec'
  with checksum 'E4F76BE29CB79EF59D3238F490BA92E2'
2024-12-03 09:25:30,349 4164 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension\extensions\chocolatey-compatibility.psm1'
  with checksum 'D6BED48F1A2055D2CC8A7E65A3B9B653'
2024-12-03 09:25:30,349 4164 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension\extensions\helpers\Get-PackageParameters.ps1'
  with checksum '71D1214302A8DCEDBC514DDD1A4C8B02'
2024-12-03 09:25:30,351 4164 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension\extensions\helpers\Get-UninstallRegistryKey.ps1'
  with checksum 'BEF350705A6096C5A6D5008674F81A0A'
2024-12-03 09:25:30,351 4164 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension\extensions\helpers\Install-ChocolateyDesktopLink.ps1'
  with checksum '507F2FBE3B0E4E7026FF318F57D11629'
2024-12-03 09:25:30,351 4164 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension\extensions\helpers\Write-ChocolateyFailure.ps1'
  with checksum '62F5761ED276CC6E52D7B7A57F50B669'
2024-12-03 09:25:30,351 4164 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension\extensions\helpers\Write-ChocolateySuccess.ps1'
  with checksum 'F2D4D28C6EAA6D52E827761700BFC366'
2024-12-03 09:25:30,351 4164 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension\extensions\helpers\Write-FileUpdateLog.ps1'
  with checksum '96B9E7F714A968AE4CD62E3749C3E5EC'
2024-12-03 09:25:30,351 4164 [INFO ] -  Skipping auto uninstaller - No registry snapshot.
2024-12-03 09:25:30,358 4164 [DEBUG] - Calling command ['"C:\Windows\System32\shutdown.exe" /a']
2024-12-03 09:25:30,399 4164 [DEBUG] - Command ['"C:\Windows\System32\shutdown.exe" /a'] exited with '1116'
2024-12-03 09:25:30,411 4164 [DEBUG] - Attempting to delete directory "C:\ProgramData\chocolatey\lib-bkp\chocolatey-compatibility.extension".
2024-12-03 09:25:30,415 4164 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\extensions\chocolatey-compatibility\chocolatey-compatibility.psm1".
2024-12-03 09:25:30,415 4164 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\extensions\chocolatey-compatibility\helpers\Get-PackageParameters.ps1".
2024-12-03 09:25:30,415 4164 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\extensions\chocolatey-compatibility\helpers\Get-UninstallRegistryKey.ps1".
2024-12-03 09:25:30,415 4164 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\extensions\chocolatey-compatibility\helpers\Install-ChocolateyDesktopLink.ps1".
2024-12-03 09:25:30,415 4164 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\extensions\chocolatey-compatibility\helpers\Write-ChocolateyFailure.ps1".
2024-12-03 09:25:30,415 4164 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\extensions\chocolatey-compatibility\helpers\Write-ChocolateySuccess.ps1".
2024-12-03 09:25:30,415 4164 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\extensions\chocolatey-compatibility\helpers\Write-FileUpdateLog.ps1".
2024-12-03 09:25:30,415 4164 [WARN ] -  Uninstalled chocolatey-compatibility extensions.
2024-12-03 09:25:30,415 4164 [DEBUG] - Ensuring removal of installation files.
2024-12-03 09:25:30,415 4164 [INFO ] -  chocolatey-compatibility.extension has been successfully uninstalled.
2024-12-03 09:25:30,415 4164 [DEBUG] - Removing nupkg if it still exists.
2024-12-03 09:25:30,415 4164 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension\chocolatey-compatibility.extension.nupkg".
2024-12-03 09:25:30,431 4164 [DEBUG] - Ensuring removal of installation files.
2024-12-03 09:25:30,431 4164 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension\chocolatey-compatibility.extension.nuspec'
  with checksum 'E4F76BE29CB79EF59D3238F490BA92E2'
2024-12-03 09:25:30,431 4164 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension\chocolatey-compatibility.extension.nuspec".
2024-12-03 09:25:30,431 4164 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension\extensions\chocolatey-compatibility.psm1'
  with checksum 'D6BED48F1A2055D2CC8A7E65A3B9B653'
2024-12-03 09:25:30,431 4164 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension\extensions\chocolatey-compatibility.psm1".
2024-12-03 09:25:30,431 4164 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension\extensions\helpers\Get-PackageParameters.ps1'
  with checksum '71D1214302A8DCEDBC514DDD1A4C8B02'
2024-12-03 09:25:30,431 4164 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension\extensions\helpers\Get-PackageParameters.ps1".
2024-12-03 09:25:30,431 4164 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension\extensions\helpers\Get-UninstallRegistryKey.ps1'
  with checksum 'BEF350705A6096C5A6D5008674F81A0A'
2024-12-03 09:25:30,431 4164 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension\extensions\helpers\Get-UninstallRegistryKey.ps1".
2024-12-03 09:25:30,431 4164 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension\extensions\helpers\Install-ChocolateyDesktopLink.ps1'
  with checksum '507F2FBE3B0E4E7026FF318F57D11629'
2024-12-03 09:25:30,431 4164 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension\extensions\helpers\Install-ChocolateyDesktopLink.ps1".
2024-12-03 09:25:30,431 4164 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension\extensions\helpers\Write-ChocolateyFailure.ps1'
  with checksum '62F5761ED276CC6E52D7B7A57F50B669'
2024-12-03 09:25:30,431 4164 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension\extensions\helpers\Write-ChocolateyFailure.ps1".
2024-12-03 09:25:30,431 4164 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension\extensions\helpers\Write-ChocolateySuccess.ps1'
  with checksum 'F2D4D28C6EAA6D52E827761700BFC366'
2024-12-03 09:25:30,431 4164 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension\extensions\helpers\Write-ChocolateySuccess.ps1".
2024-12-03 09:25:30,431 4164 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension\extensions\helpers\Write-FileUpdateLog.ps1'
  with checksum '96B9E7F714A968AE4CD62E3749C3E5EC'
2024-12-03 09:25:30,431 4164 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension\extensions\helpers\Write-FileUpdateLog.ps1".
2024-12-03 09:25:30,431 4164 [DEBUG] - Attempting to delete directory "C:\ProgramData\chocolatey\lib\chocolatey-compatibility.extension".
2024-12-03 09:25:30,431 4164 [INFO ] - 
chocolatey-core.extension v1.4.0
2024-12-03 09:25:30,431 4164 [DEBUG] - Running beforeModify step for 'chocolatey-core.extension'
2024-12-03 09:25:30,431 4164 [DEBUG] - Backing up package files for 'chocolatey-core.extension'
2024-12-03 09:25:30,431 4164 [DEBUG] - Attempting to create directory "C:\ProgramData\chocolatey\lib-bkp\chocolatey-core.extension".
2024-12-03 09:25:30,431 4164 [DEBUG] - Moving C:\ProgramData\chocolatey\lib\chocolatey-core.extension to C:\ProgramData\chocolatey\lib-bkp\chocolatey-core.extension\1.4.0
2024-12-03 09:25:30,442 4164 [DEBUG] - Moving 'C:\ProgramData\chocolatey\lib\chocolatey-core.extension'
 to 'C:\ProgramData\chocolatey\lib-bkp\chocolatey-core.extension\1.4.0'
2024-12-03 09:25:32,458 4164 [DEBUG] - Attempting to create directory "C:\ProgramData\chocolatey\lib\chocolatey-core.extension".
2024-12-03 09:25:32,458 4164 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\chocolatey-core.extension\1.4.0\chocolatey-core.extension.nupkg"
 to "C:\ProgramData\chocolatey\lib\chocolatey-core.extension\chocolatey-core.extension.nupkg".
2024-12-03 09:25:32,458 4164 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\chocolatey-core.extension\1.4.0\chocolatey-core.extension.nuspec"
 to "C:\ProgramData\chocolatey\lib\chocolatey-core.extension\chocolatey-core.extension.nuspec".
2024-12-03 09:25:32,458 4164 [DEBUG] - Attempting to create directory "C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions".
2024-12-03 09:25:32,474 4164 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\chocolatey-core.extension\1.4.0\extensions\chocolatey-core.psm1"
 to "C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\chocolatey-core.psm1".
2024-12-03 09:25:32,474 4164 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\chocolatey-core.extension\1.4.0\extensions\Get-AppInstallLocation.ps1"
 to "C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Get-AppInstallLocation.ps1".
2024-12-03 09:25:32,474 4164 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\chocolatey-core.extension\1.4.0\extensions\Get-AvailableDriveLetter.ps1"
 to "C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Get-AvailableDriveLetter.ps1".
2024-12-03 09:25:32,480 4164 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\chocolatey-core.extension\1.4.0\extensions\Get-EffectiveProxy.ps1"
 to "C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Get-EffectiveProxy.ps1".
2024-12-03 09:25:32,481 4164 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\chocolatey-core.extension\1.4.0\extensions\Get-PackageCacheLocation.ps1"
 to "C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Get-PackageCacheLocation.ps1".
2024-12-03 09:25:32,482 4164 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\chocolatey-core.extension\1.4.0\extensions\Get-WebContent.ps1"
 to "C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Get-WebContent.ps1".
2024-12-03 09:25:32,482 4164 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\chocolatey-core.extension\1.4.0\extensions\Register-Application.ps1"
 to "C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Register-Application.ps1".
2024-12-03 09:25:32,482 4164 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\chocolatey-core.extension\1.4.0\extensions\Remove-Process.ps1"
 to "C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Remove-Process.ps1".
2024-12-03 09:25:33,989 4164 [DEBUG] - Capturing package files in 'C:\ProgramData\chocolatey\lib\chocolatey-core.extension'
2024-12-03 09:25:33,989 4164 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\chocolatey-core.extension\chocolatey-core.extension.nupkg'
  with checksum '0CA0F8AA17B974343E7967B1820D0D9C'
2024-12-03 09:25:33,989 4164 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\chocolatey-core.extension\chocolatey-core.extension.nuspec'
  with checksum 'B2C1C3F82AA3D894AD8E5547FF7B1688'
2024-12-03 09:25:33,989 4164 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\chocolatey-core.psm1'
  with checksum '2A0DE2FF529CFC02FDF540ACBEE99EE1'
2024-12-03 09:25:33,989 4164 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Get-AppInstallLocation.ps1'
  with checksum 'D19FCAF1650F0EE327666CA8823F3731'
2024-12-03 09:25:33,989 4164 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Get-AvailableDriveLetter.ps1'
  with checksum 'FF3C638BD18B2D3A563753960F6DD323'
2024-12-03 09:25:33,989 4164 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Get-EffectiveProxy.ps1'
  with checksum '2584085C65E44561A8D8A78F617AFD3E'
2024-12-03 09:25:33,989 4164 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Get-PackageCacheLocation.ps1'
  with checksum '77A378E5C659E5A53D2D64E276159B62'
2024-12-03 09:25:33,989 4164 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Get-WebContent.ps1'
  with checksum '57D013E581EFEA3D4D8366183C9A5797'
2024-12-03 09:25:33,989 4164 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Register-Application.ps1'
  with checksum 'D2853E569DAC9A341642BA76EC4FB411'
2024-12-03 09:25:33,989 4164 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Remove-Process.ps1'
  with checksum '9A56AD3B71FD44CB8D0EA2C1ADB023B2'
2024-12-03 09:25:33,989 4164 [INFO ] -  Skipping auto uninstaller - No registry snapshot.
2024-12-03 09:25:34,101 4164 [DEBUG] - Calling command ['"C:\Windows\System32\shutdown.exe" /a']
2024-12-03 09:25:34,130 4164 [DEBUG] - Command ['"C:\Windows\System32\shutdown.exe" /a'] exited with '1116'
2024-12-03 09:25:34,130 4164 [DEBUG] - Attempting to delete directory "C:\ProgramData\chocolatey\lib-bkp\chocolatey-core.extension".
2024-12-03 09:25:34,130 4164 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\extensions\chocolatey-core\chocolatey-core.psm1".
2024-12-03 09:25:34,130 4164 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\extensions\chocolatey-core\Get-AppInstallLocation.ps1".
2024-12-03 09:25:34,130 4164 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\extensions\chocolatey-core\Get-AvailableDriveLetter.ps1".
2024-12-03 09:25:34,130 4164 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\extensions\chocolatey-core\Get-EffectiveProxy.ps1".
2024-12-03 09:25:34,130 4164 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\extensions\chocolatey-core\Get-PackageCacheLocation.ps1".
2024-12-03 09:25:34,130 4164 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\extensions\chocolatey-core\Get-WebContent.ps1".
2024-12-03 09:25:34,130 4164 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\extensions\chocolatey-core\Register-Application.ps1".
2024-12-03 09:25:34,130 4164 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\extensions\chocolatey-core\Remove-Process.ps1".
2024-12-03 09:25:34,130 4164 [WARN ] -  Uninstalled chocolatey-core extensions.
2024-12-03 09:25:34,130 4164 [DEBUG] - Ensuring removal of installation files.
2024-12-03 09:25:34,130 4164 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\chocolatey-core.extension\chocolatey-core.extension.nupkg'
  with checksum '0CA0F8AA17B974343E7967B1820D0D9C'
2024-12-03 09:25:34,130 4164 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\lib\chocolatey-core.extension\chocolatey-core.extension.nupkg".
2024-12-03 09:25:34,130 4164 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\chocolatey-core.extension\chocolatey-core.extension.nuspec'
  with checksum 'B2C1C3F82AA3D894AD8E5547FF7B1688'
2024-12-03 09:25:34,130 4164 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\lib\chocolatey-core.extension\chocolatey-core.extension.nuspec".
2024-12-03 09:25:34,130 4164 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\chocolatey-core.psm1'
  with checksum '2A0DE2FF529CFC02FDF540ACBEE99EE1'
2024-12-03 09:25:34,130 4164 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\chocolatey-core.psm1".
2024-12-03 09:25:34,130 4164 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Get-AppInstallLocation.ps1'
  with checksum 'D19FCAF1650F0EE327666CA8823F3731'
2024-12-03 09:25:34,130 4164 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Get-AppInstallLocation.ps1".
2024-12-03 09:25:34,130 4164 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Get-AvailableDriveLetter.ps1'
  with checksum 'FF3C638BD18B2D3A563753960F6DD323'
2024-12-03 09:25:34,130 4164 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Get-AvailableDriveLetter.ps1".
2024-12-03 09:25:34,130 4164 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Get-EffectiveProxy.ps1'
  with checksum '2584085C65E44561A8D8A78F617AFD3E'
2024-12-03 09:25:34,130 4164 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Get-EffectiveProxy.ps1".
2024-12-03 09:25:34,130 4164 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Get-PackageCacheLocation.ps1'
  with checksum '77A378E5C659E5A53D2D64E276159B62'
2024-12-03 09:25:34,130 4164 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Get-PackageCacheLocation.ps1".
2024-12-03 09:25:34,130 4164 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Get-WebContent.ps1'
  with checksum '57D013E581EFEA3D4D8366183C9A5797'
2024-12-03 09:25:34,130 4164 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Get-WebContent.ps1".
2024-12-03 09:25:34,130 4164 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Register-Application.ps1'
  with checksum 'D2853E569DAC9A341642BA76EC4FB411'
2024-12-03 09:25:34,130 4164 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Register-Application.ps1".
2024-12-03 09:25:34,130 4164 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Remove-Process.ps1'
  with checksum '9A56AD3B71FD44CB8D0EA2C1ADB023B2'
2024-12-03 09:25:34,146 4164 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\lib\chocolatey-core.extension\extensions\Remove-Process.ps1".
2024-12-03 09:25:34,146 4164 [DEBUG] - Attempting to delete directory "C:\ProgramData\chocolatey\lib\chocolatey-core.extension".
2024-12-03 09:25:34,146 4164 [INFO ] -  chocolatey-core.extension has been successfully uninstalled.
2024-12-03 09:25:34,146 4164 [DEBUG] - Removing nupkg if it still exists.
2024-12-03 09:25:34,146 4164 [DEBUG] - Ensuring removal of installation files.
2024-12-03 09:25:34,161 4164 [WARN ] - 
Chocolatey uninstalled 2/2 packages. 
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
2024-12-03 09:25:34,161 4164 [DEBUG] - Sending message 'PostRunMessage' out if there are subscribers...
2024-12-03 09:25:34,161 4164 [DEBUG] - Exiting with 0

Additional Context

Note: I only included log for Chocolatey v2.4.0

@gpwen gpwen added the Bug label Dec 3, 2024
@gpwen
Copy link
Author

gpwen commented Dec 3, 2024

In more sophisticated cases, the dependency could be a extension package that contains PowerShell module required by the uninstall script. If such kind of dependencies have been uninstalled first, uninstallation of impacted packages will fail. This is a quite serious regression defect.

@corbob
Copy link
Member

corbob commented Dec 3, 2024

I can confirm this happens in 2.4.0. I can also confirm that the ordering of packages to uninstall appears to be done alphabetically, so our test package hasdependency doesn't present this issue.

@pauby pauby changed the title choco uninstall: Wrong dependency uninstall order Packages are uninstalled in the wrong order when uninstalling a package with its dependencies Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants