-
Notifications
You must be signed in to change notification settings - Fork 473
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
Fleet uninstall script removes other apps from the host #22571
Comments
Adding P0. |
Following is the current default uninstaller script for pkg: fleet/pkg/file/scripts/uninstall_pkg.sh Lines 1 to 21 in 8cfa35c
We've found that many packages list The team has discussed two proposals: A. Make current default uinstall script smarter by adding checks to explicitly prevent deletion of these directories. But then we are open to some missed path or edge case that could cause similar issue. B. Be a bit dumber when it comes to uninstalling. Change the default uninstall script to just remove IMO we should go with B (safe and dumb but flexible). |
Copying my Slack response to supporting option B: I like this approach for a few reasons: Does it remove supporting files? no. But it doesn't need to most of the time. More complicated uninstalls (plugins/extensions) are usually handled by a vendor supplied uninstaller. |
Decision provided in Slack conversation to proceed with option B. |
…#22585) #22571 - [X] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/Committing-Changes.md#changes-files) for more information. - [X] Added/updated tests - [X] Manual QA for all new/changed functionality
@getvictor @lucasmrod @lukeheath I would like to recommend using something like the logic in this script for application removals. Why?
|
@xpkoala added QA notes. |
…#22585) #22571 - [X] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/Committing-Changes.md#changes-files) for more information. - [X] Added/updated tests - [X] Manual QA for all new/changed functionality
@nonpunctual Thanks for the ideas. We are going to release an immediate quick fix to resolve the P0, and will circle back on something more permanent. |
For reference when we circle back after immediate fix is released. Ideas from a prospective customer: "You might consider replicating the logic in https://github.com/munki/munki/blob/main/code/client/removepackages and https://github.com/munki/munki/blob/main/code/client/munkilib/installer/rmpkgs.py" |
Well in order to do any of that you would need to partially rely on the metadata munki creates when it installs things. The spotlight metadata is independent of that. If you are only looking at metadata related to pkg installs, you are ignoring all other ways of installing apps. Bundle ID is an attribute that every app has. You don't really need install history to do .app removals unless you are using .bom to remove dependencies. |
#22571 `20241002104104_UpdateUninstallScript.go` will be released in v4.57.2, thus I'm moving the unreleased migrations in main to run after it.
QA Notes: Migration test results performed for each app type are as follows: Will stop QA efforts here until we decide on path forward based on results from the functional tests |
#22571 - [X] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/Committing-Changes.md#changes-files) for more information. - [X] Added/updated tests - [X] If database migrations are included, checked table schema to confirm autoupdate - For database migrations: - [X] Checked schema for all modified table for columns that will auto-update timestamps during migration. - [X] Confirmed that updating the timestamps is acceptable, and will not cause unwanted side effects. - [X] Ensured the correct collation is explicitly set for character columns (`COLLATE utf8mb4_unicode_ci`). - [X] Manual QA for all new/changed functionality
#22571 - [X] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/Committing-Changes.md#changes-files) for more information. - [X] Added/updated tests - [X] If database migrations are included, checked table schema to confirm autoupdate - For database migrations: - [X] Checked schema for all modified table for columns that will auto-update timestamps during migration. - [X] Confirmed that updating the timestamps is acceptable, and will not cause unwanted side effects. - [X] Ensured the correct collation is explicitly set for character columns (`COLLATE utf8mb4_unicode_ci`). - [X] Manual QA for all new/changed functionality
Uninstall script fixed, |
Fleet version: 4.57.1
Web browser and operating system: Google Chrome 129.0.6668.90 on macOS (arm64)
💥 Actual behavior
I uninstalled
IriunWebcam.app
(IriunWebcam-2.8.8.pkg
), and it uninstalled many other apps from the host (1Password, Google Chrome, Fleet Desktop, Slack, Spotify, Raycast, Zoom, VSCode and probably some more, but can't remember now what I had on the host).🧑💻 Steps to reproduce
🕯️ More info (optional)
Script content and output are attached here:
Archive.zip
QA notes
Functional Test
Please test with as many PKGs as you can and report findings.
Test that only the directory containing the app is deleted (
/Applications/$APP_NAME
, e.g./Applications/MicrosoftTeams.pkg
).Some uninstall scripts may not work for some PKGs, we should just document the findings for now.
We plan on iterating the dumb script.
Migration
We need to test migrating from 4.57.0/4.57.1 to 4.57.2
pkgutil
.The text was updated successfully, but these errors were encountered: