chocolatey / choco

Chocolatey - the package manager for Windows
https://chocolatey.org
Other
10.04k stars 890 forks source link

choco uninstalled a number of wrong packages when I want to uninstall ONE package #3437

Closed mio-19 closed 1 week ago

mio-19 commented 2 months ago

Checklist

What You Are Seeing?

I run choco uninstall jetbrainstoolbox. A audacity logo poped out. After this I can't find audacity in my system anymore. Then Keepass

What is Expected?

Uninstall the correct package.

How Did You Get This To Happen?

  1. Install choco on 20240502(YYYYmmdd)
  2. Install a number of packages
  3. I found it took too long when installing jetbrainstoolbox. I clicked Ctrl+C
  4. choco install --force jetbrainstoolbox
  5. choco uninstall jetbrainstoolbox

System Details

Validation Warnings:

0 packages installed.

Installed Packages

PS C:\Users\user> choco list
Chocolatey v2.2.2
3 validations performed. 2 success(es), 1 warning(s), and 0 error(s).

Validation Warnings:
 - A pending system reboot request has been detected, however, this is
   being ignored due to the current command being used 'list'.
   It is recommended that you reboot at your earliest convenience.

7zip 23.1.0
7zip.install 23.1.0
adb 34.0.5
arduino 2.3.2
audacity 3.5.1
autohotkey.portable 2.0.11
autoruns 14.11.0
bitwarden 2024.4.0
blender 4.1.1
calibre 7.9.0
choco-cleaner 1.1.1
chocolatey 2.2.2
chocolatey-compatibility.extension 1.0.0
chocolatey-core.extension 1.4.0
chocolatey-windowsupdate.extension 1.0.5
crystaldiskinfo 9.2.3
crystaldiskinfo.portable 9.2.3
discord 1.0.9005
discord.install 1.0.9005
dotnet 8.0.4
dotnet-8.0-desktopruntime 8.0.4
dotnet-8.0-runtime 8.0.4
dotnet-runtime 8.0.4
element-desktop 1.11.65
elixir 1.16.1
epicgameslauncher 1.3.93
erlang 26.2.2
etcher 1.18.11
exiftool 12.84.0
ffmpeg 7.0.0
filezilla 3.67.0
FirefoxESR 115.10.0
GoogleChrome 124.0.6367.118
imageglass 9.0.10.201
KB2919355 1.0.20160915
KB2919442 1.0.20160915
KB2999226 1.0.20181019
KB3033929 1.0.5
KB3035131 1.0.3
keepass 2.56.0
keepass.install 2.56.0
keepassxc 2.7.7
keeper 16.10.13
krita 5.2.2
moonlight-qt 5.0.1
moonlight-qt.install 5.0.1
motrix 1.6.11
musescore 4.2.1.240230937
nearby-share 1.0.1533.13
nodejs 22.0.0
nodejs.install 22.0.0
notepadplusplus 8.6.5
notepadplusplus.install 8.6.5
obsidian 1.5.12
octave 8.3.0.20230817
octave.install 9.1.0
prismlauncher 8.3.0
procexp 17.5.0.20231021
putty 0.81.0
putty.portable 0.81.0
python2 2.7.18
python3 3.12.3
python312 3.12.3
rclone 1.66.0
rclone.portable 1.66.0
rufus 4.4.0
rust 1.77.2
ryujinx 1.1.1296
spacedesk-client 2.1.16
spacedesk-server 2.1.16
spacesniffer 1.3.0.2
tailscale 1.64.2
TcpView 4.19.0
Temurin17 17.0.10
Temurin17jre 17.0.10
Temurin20 20.0.2.900
Temurin21jre 21.0.2
Temurin8 8.402.6
Temurin8jre 8.402.6
tor-browser 13.0.14
universal-adb-drivers 1.0.4
vcredist140 14.38.33135
vcredist2005 8.0.50727.619501
vcredist2008 9.0.30729.616104
vcredist2010 10.0.40219.32503
vcredist2012 11.0.61031.20230518
vcredist2013 12.0.40660.20180427
vcredist2015 14.0.24215.20170201
vcredist2017 14.16.27033
vcredist-all 1.0.1
vcxsrv 21.1.10
ventoy 1.0.97.20240415
vlc 3.0.20
vlc.install 3.0.20
vnc-viewer 7.7.0
vscode 1.88.1
vscode.install 1.88.1
yt-dlp 2024.4.9
98 packages installed.

Output Log

I can't upload files due to this github issue template. I will uploads files later.

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows

PS C:\Users\user> choco install --force jetbrainstoolbox
Chocolatey v2.2.2
3 validations performed. 2 success(es), 1 warning(s), and 0 error(s).

Validation Warnings:
 - A pending system reboot request has been detected, however, this is
   being ignored due to the current Chocolatey configuration.  If you
   want to halt when this occurs, then either set the global feature
   using:
     choco feature enable --name="exitOnRebootDetected"
   or pass the option --exit-when-reboot-detected.

Installing the following packages:
jetbrainstoolbox
By installing, you accept licenses for the packages.
jetbrainstoolbox v2.3.1.31116 already installed. Forcing reinstall of version '2.3.1.31116'.
 Please use upgrade if you meant to upgrade to a new version.
Progress: Downloading jetbrainstoolbox 2.3.1.31116... 100%

jetbrainstoolbox v2.3.1.31116 (forced) [Approved]
jetbrainstoolbox package files install completed. Performing other installation steps.
Downloading jetbrainstoolbox
  from 'https://download.jetbrains.com/toolbox/jetbrains-toolbox-2.3.1.31116.exe'
Progress: 100% - Completed download of C:\Users\user\AppData\Local\Temp\chocolatey\jetbrainstoolbox\2.3.1.31116\jetbrains-toolbox-2.3.1.31116.exe (71.78 MB).
Download of jetbrains-toolbox-2.3.1.31116.exe (71.78 MB) completed.
Hashes match.
Installing jetbrainstoolbox...
Chocolatey timed out waiting for the command to finish. The timeout
 specified (or the default value) was '2700' seconds. Perhaps try a
 higher `--execution-timeout`? See `choco -h` for details.
  jetbrainstoolbox can be automatically uninstalled.
Environment Vars (like PATH) have changed. Close/reopen your shell to
 see the changes (or in powershell/cmd.exe just type `refreshenv`).
The install of jetbrainstoolbox was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\jetbrainstoolbox\tools\chocolateyinstall.ps1'.
 See log for details.

Chocolatey installed 0/1 packages. 1 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Failures
 - jetbrainstoolbox (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\jetbrainstoolbox\tools\chocolateyinstall.ps1'.
 See log for details.
PS C:\Users\user> choco uninstall jetbrainstoolbox
Chocolatey v2.2.2
3 validations performed. 2 success(es), 1 warning(s), and 0 error(s).

Validation Warnings:
 - A pending system reboot request has been detected, however, this is
   being ignored due to the current Chocolatey configuration.  If you
   want to halt when this occurs, then either set the global feature
   using:
     choco feature enable --name="exitOnRebootDetected"
   or pass the option --exit-when-reboot-detected.

Uninstalling the following packages:
jetbrainstoolbox

jetbrainstoolbox v2.3.1.31116
 Running auto uninstaller...
 Auto uninstaller has successfully uninstalled jetbrainstoolbox or detected previous uninstall.
 Auto uninstaller has successfully uninstalled jetbrainstoolbox or detected previous uninstall.
 Auto uninstaller has successfully uninstalled jetbrainstoolbox or detected previous uninstall.
 Auto uninstaller has successfully uninstalled jetbrainstoolbox or detected previous uninstall.
 [AutoUninstaller] Starting Update.exe
 [AutoUninstaller] 11776> 2024-05-03 12:48:46> Program: Starting Squirrel Updater: --uninstall -s
 [AutoUninstaller] 11776> 2024-05-03 12:48:46> Program: Starting uninstall for app:
 [AutoUninstaller] 11776> 2024-05-03 12:48:46> SingleGlobalInstance: Grabbing lockfile with timeout of 00:00:10
 [AutoUninstaller] 11776> 2024-05-03 12:48:46> ApplyReleasesImpl: Starting full uninstall
 [AutoUninstaller] 11776> 2024-05-03 12:48:46> Utility: Process Started: C:\Users\user\AppData\Local\Discord\app-1.0.9005\Discord.exe --squirrel-uninstall 1.0.9005, pid 18680
 [AutoUninstaller] 11776> 2024-05-03 12:48:47> Utility: Received exitcode 0 from process C:\Users\user\AppData\Local\Discord\app-1.0.9005\Discord.exe
 [AutoUninstaller] 11776> 2024-05-03 12:48:47> ApplyReleasesImpl: fixPinnedExecutables: newCurrentFolder: app-255.255.255.255
 [AutoUninstaller] 11776> 2024-05-03 12:48:47> ApplyReleasesImpl: fixPinnedExecutables: enumerating path C:\Users\user\AppData\Roaming\Microsoft\Windows\Start Menu failed: System.UnauthorizedAccessException: Access to the path 'C:\Users\user\AppData\Roaming\Microsoft\Windows\Start Menu\程序' is denied.
 [AutoUninstaller]    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
 [AutoUninstaller]    at System.IO.FileSystemEnumerableIterator`1.AddSearchableDirsToStack(SearchData localSearchData)
 [AutoUninstaller]    at System.IO.FileSystemEnumerableIterator`1.MoveNext()
 [AutoUninstaller]    at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
 [AutoUninstaller]    at System.IO.DirectoryInfo.InternalGetFiles(String searchPattern, SearchOption searchOption)
 [AutoUninstaller]    at System.IO.DirectoryInfo.GetFiles(String searchPattern, SearchOption searchOption)
 [AutoUninstaller]    at Squirrel.UpdateManager.ApplyReleasesImpl.fixPinnedExecutables(SemanticVersion newCurrentVersion)
 Auto uninstaller has successfully uninstalled jetbrainstoolbox or detected previous uninstall.
 Auto uninstaller has successfully uninstalled jetbrainstoolbox or detected previous uninstall.
 Auto uninstaller has successfully uninstalled jetbrainstoolbox or detected previous uninstall.
 Auto uninstaller has successfully uninstalled jetbrainstoolbox or detected previous uninstall.
 Auto uninstaller has successfully uninstalled jetbrainstoolbox or detected previous uninstall.
 Auto uninstaller has successfully uninstalled jetbrainstoolbox or detected previous uninstall.
 Auto uninstaller has successfully uninstalled jetbrainstoolbox or detected previous uninstall.

  Did you know licensed versions of Chocolatey are 95% effective with
   Automatic Uninstaller due to licensed enhancements and Package
   Synchronizer?

For the question below, you have 30 seconds to make a selection.
Uninstall may not be silent (could not detect). Proceed?([Y]es/[[N]o]):
 Skipping auto uninstaller - Installer type was not detected and no silent uninstall key exists.
If the application was not removed with a chocolateyUninstall.ps1,
 please remove it from Programs and Features manually.
 Auto uninstaller has successfully uninstalled jetbrainstoolbox or detected previous uninstall.
 Auto uninstaller has successfully uninstalled jetbrainstoolbox or detected previous uninstall.
 Auto uninstaller has successfully uninstalled jetbrainstoolbox or detected previous uninstall.
 Auto uninstaller has successfully uninstalled jetbrainstoolbox or detected previous uninstall.
 Auto uninstaller has successfully uninstalled jetbrainstoolbox or detected previous uninstall.
 Auto uninstaller has successfully uninstalled jetbrainstoolbox or detected previous uninstall.
 Auto uninstaller has successfully uninstalled jetbrainstoolbox or detected previous uninstall.
 Auto uninstaller has successfully uninstalled jetbrainstoolbox or detected previous uninstall.
 Auto uninstaller has successfully uninstalled jetbrainstoolbox or detected previous uninstall.
 Auto uninstaller has successfully uninstalled jetbrainstoolbox or detected previous uninstall.
 Auto uninstaller has successfully uninstalled jetbrainstoolbox or detected previous uninstall.
 Auto uninstaller has successfully uninstalled jetbrainstoolbox or detected previous uninstall.
 Auto uninstaller has successfully uninstalled jetbrainstoolbox or detected previous uninstall.
 Auto uninstaller has successfully uninstalled jetbrainstoolbox or detected previous uninstall.
 Auto uninstaller has successfully uninstalled jetbrainstoolbox or detected previous uninstall.

  Did you know licensed versions of Chocolatey are 95% effective with
   Automatic Uninstaller due to licensed enhancements and Package
   Synchronizer?

For the question below, you have 30 seconds to make a selection.
Uninstall may not be silent (could not detect). Proceed?([Y]es/[[N]o]):
 Skipping auto uninstaller - Installer type was not detected and no silent uninstall key exists.
If the application was not removed with a chocolateyUninstall.ps1,
 please remove it from Programs and Features manually.

  Did you know licensed versions of Chocolatey are 95% effective with
   Automatic Uninstaller due to licensed enhancements and Package
   Synchronizer?

For the question below, you have 30 seconds to make a selection.
Uninstall may not be silent (could not detect). Proceed?([Y]es/[[N]o]):
 Skipping auto uninstaller - Installer type was not detected and no silent uninstall key exists.
If the application was not removed with a chocolateyUninstall.ps1,
 please remove it from Programs and Features manually.
 Auto uninstaller has successfully uninstalled jetbrainstoolbox or detected previous uninstall.
 Auto uninstaller has successfully uninstalled jetbrainstoolbox or detected previous uninstall.
 Auto uninstaller has successfully uninstalled jetbrainstoolbox or detected previous uninstall.
 Auto uninstaller has successfully uninstalled jetbrainstoolbox or detected previous uninstall.
 Auto uninstaller has successfully uninstalled jetbrainstoolbox or detected previous uninstall.
 Auto uninstaller has successfully uninstalled jetbrainstoolbox or detected previous uninstall.
 Auto uninstaller has successfully uninstalled jetbrainstoolbox or detected previous uninstall.
 Auto uninstaller has successfully uninstalled jetbrainstoolbox or detected previous uninstall.
 Auto uninstaller has successfully uninstalled jetbrainstoolbox or detected previous uninstall.
 Skipping auto uninstaller - 'Microsoft Windows Desktop Runtime - 8.0.4 (x86)' appears to have been uninstalled already by other means.
 Auto uninstaller has successfully uninstalled jetbrainstoolbox or detected previous uninstall.
 Auto uninstaller has successfully uninstalled jetbrainstoolbox or detected previous uninstall.
 jetbrainstoolbox has been successfully uninstalled.
Environment Vars (like PATH) have changed. Close/reopen your shell to
 see the changes (or in powershell/cmd.exe just type `refreshenv`).

Chocolatey uninstalled 1/1 packages.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
PS C:\Users\user>

Additional Context

No response

mio-19 commented 2 months ago

chocolatey.log

I had two powershell tabs opened. Here is the other tab. command.log

mio-19 commented 2 months ago

choco uninstalled more than audacity and keepass. Empty spaces on the desktop should be what choco uninstalled in this event. image

Fenixer commented 1 month ago

Also happened with me Uninstalled openvpn and lost sumatrapdf and wiztree as well (Could've been more but these are what I discovered)

pauby commented 1 month ago

When installing software, Chocolatey CLI takes a snapshot of the file system and registry so it knows what to remove when uninstalling.

If, while installing a package, there are other installation going on in the background, then Chocolatey CLI will naturally see those as changing during the install, and naturally assume that those changes are part of the software installation. Upon uninstall, using the Chocolatey Automatic Uninstaller, it will likely remove the other software that was captured during the Chocolatey CLI package installation.

The two options are:

Based on experience I'm not going to try to reproduce this as I won't be able to. It's based on your environment at the time of the uninstallation.

mio-19 commented 1 month ago

Other packages are also installed by choco.

pauby commented 1 month ago

If you mean that you are running Chocolatey CLI in parallel (i.e. more than one instance of Chocolatey CLI is running at the same time) then this will cause the problem you are experiencing.

If that is not what you meant, can you expand on your comment, as I don't understand?

mio-19 commented 4 weeks ago

I might have run Choco CLI in parallel. I suggest Choco CLI to print a warning message when running in parallel

pauby commented 1 week ago

@mio-19 If you have run Chocolatey CLI multiple times, then this will be why you experienced this issue.

There are times when running Chocolatey CLI in parallel will have no effect.

I suggest Choco CLI to print a warning message when running in parallel

That would be a duplicate of #824.

I'll go ahead and close this just now.