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

Policy-queued installs/scripts aren't removed when the associated policy is deleted #23886

Open
iansltx opened this issue Nov 16, 2024 · 0 comments
Labels
bug Something isn't working as documented #g-endpoint-ops Endpoint ops product group :release Ready to write code. Scheduled in a release. See "Making changes" in handbook. ~released bug This bug was found in a stable release. :reproduce Involves documenting reproduction steps in the issue

Comments

@iansltx
Copy link
Member

iansltx commented Nov 16, 2024

Fleet version: 4.59.0


💥  Actual behavior

See below:

image.png

🧑‍💻  Steps to reproduce

Theoretical, hence the reproduce tag.

  1. Create a policy with a software or script automation
  2. Fail a host for that policy to queue up an install or script execution
  3. Delete the policy
  4. Note that the queued install or script run isn't deleted

🕯️ More info

This seems to be a bit of an edge case on timing, but we hit it in Dogfood for multiple hosts, causing installs to be reported with no associated policy or actor.

@noahtalerman @rachaelshaw I'm guessing the desired behavior is that if a policy is deleted any pending script/software automations for that policy should be removed, similar to how we dequeue scripts when they are edited/deleted, or dequeue installs when a software package is edited. Does that sound right?

Split from #22424 (/cc @allenhouchins @marko-lisica)

🛠️ To fix

Before deleting a policy, either via GitOps or via the API, delete any pending installs or script runs associated with the policy ID (which was added as a column on script runs/software installs in 4.58/4.59). The order of operations is important here because the foreign key will set to null once the underlying script or installer gets deleted.

@iansltx iansltx added #g-endpoint-ops Endpoint ops product group :release Ready to write code. Scheduled in a release. See "Making changes" in handbook. :reproduce Involves documenting reproduction steps in the issue bug Something isn't working as documented ~released bug This bug was found in a stable release. labels Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as documented #g-endpoint-ops Endpoint ops product group :release Ready to write code. Scheduled in a release. See "Making changes" in handbook. ~released bug This bug was found in a stable release. :reproduce Involves documenting reproduction steps in the issue
Development

No branches or pull requests

1 participant