[Fleet] Fix error when deleting orphaned integration policies#237875
[Fleet] Fix error when deleting orphaned integration policies#237875criamico merged 4 commits intoelastic:mainfrom
Conversation
|
Pinging @elastic/fleet (Team:Fleet) |
|
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]
cc @criamico |
|
Starting backport for target branches: 8.19, 9.1, 9.2 |
…c#237875) Fixes elastic#237700 ## Summary Attempting to delete an orphaned integration policy fails with a misleading error. This PR fixes this case and allows the user to force delete orphaned integration policies from Fleet APIs ### Repro steps - Have an agent policy with an installed integration policy. For instance `system` - Get the ids of both the agent policy and the integration policy. Manually delete the agent policy (it may require a `superuser` user): ``` DELETE .kibana_ingest/_doc/fleet-agent-policies:<agent-policy-id> ``` - At this point the integration policy should be "orphaned". Try to force delete it with fleet APIs: ``` DELETE kbn:/api/fleet/package_policies/<integration-policy-id>?force=true ``` The deletion should succeed - previously it was failing with an error. ### Checklist - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [ ] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit 14fdb32)
…c#237875) Fixes elastic#237700 ## Summary Attempting to delete an orphaned integration policy fails with a misleading error. This PR fixes this case and allows the user to force delete orphaned integration policies from Fleet APIs ### Repro steps - Have an agent policy with an installed integration policy. For instance `system` - Get the ids of both the agent policy and the integration policy. Manually delete the agent policy (it may require a `superuser` user): ``` DELETE .kibana_ingest/_doc/fleet-agent-policies:<agent-policy-id> ``` - At this point the integration policy should be "orphaned". Try to force delete it with fleet APIs: ``` DELETE kbn:/api/fleet/package_policies/<integration-policy-id>?force=true ``` The deletion should succeed - previously it was failing with an error. ### Checklist - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [ ] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit 14fdb32)
💔 Some backports could not be created
Note: Successful backport PRs will be merged automatically after passing CI. Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…c#237875) Fixes elastic#237700 ## Summary Attempting to delete an orphaned integration policy fails with a misleading error. This PR fixes this case and allows the user to force delete orphaned integration policies from Fleet APIs ### Repro steps - Have an agent policy with an installed integration policy. For instance `system` - Get the ids of both the agent policy and the integration policy. Manually delete the agent policy (it may require a `superuser` user): ``` DELETE .kibana_ingest/_doc/fleet-agent-policies:<agent-policy-id> ``` - At this point the integration policy should be "orphaned". Try to force delete it with fleet APIs: ``` DELETE kbn:/api/fleet/package_policies/<integration-policy-id>?force=true ``` The deletion should succeed - previously it was failing with an error. ### Checklist - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [ ] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit 14fdb32) # Conflicts: # x-pack/platform/plugins/shared/fleet/server/services/package_policy.test.ts
…237875) (#238045) # Backport This will backport the following commits from `main` to `9.1`: - [[Fleet] Fix error when deleting orphaned integration policies (#237875)](#237875) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Cristina Amico","email":"criamico@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-10-08T13:21:22Z","message":"[Fleet] Fix error when deleting orphaned integration policies (#237875)\n\nFixes https://github.com/elastic/kibana/issues/237700\n\n## Summary\nAttempting to delete an orphaned integration policy fails with a\nmisleading error. This PR fixes this case and allows the user to force\ndelete orphaned integration policies from Fleet APIs\n\n\n### Repro steps\n- Have an agent policy with an installed integration policy. For\ninstance `system`\n- Get the ids of both the agent policy and the integration policy.\nManually delete the agent policy (it may require a `superuser` user):\n```\n DELETE .kibana_ingest/_doc/fleet-agent-policies:<agent-policy-id>\n```\n- At this point the integration policy should be \"orphaned\". Try to\nforce delete it with fleet APIs:\n```\nDELETE kbn:/api/fleet/package_policies/<integration-policy-id>?force=true\n```\nThe deletion should succeed - previously it was failing with an error.\n\n### Checklist\n\n- [ ] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [ ] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [ ] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"14fdb329e952918bf7f6d2ead15fbcc235932851","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Fleet","backport:version","v9.1.0","v9.2.0","v9.3.0","v8.19.6"],"title":"[Fleet] Fix error when deleting orphaned integration policies","number":237875,"url":"https://github.com/elastic/kibana/pull/237875","mergeCommit":{"message":"[Fleet] Fix error when deleting orphaned integration policies (#237875)\n\nFixes https://github.com/elastic/kibana/issues/237700\n\n## Summary\nAttempting to delete an orphaned integration policy fails with a\nmisleading error. This PR fixes this case and allows the user to force\ndelete orphaned integration policies from Fleet APIs\n\n\n### Repro steps\n- Have an agent policy with an installed integration policy. For\ninstance `system`\n- Get the ids of both the agent policy and the integration policy.\nManually delete the agent policy (it may require a `superuser` user):\n```\n DELETE .kibana_ingest/_doc/fleet-agent-policies:<agent-policy-id>\n```\n- At this point the integration policy should be \"orphaned\". Try to\nforce delete it with fleet APIs:\n```\nDELETE kbn:/api/fleet/package_policies/<integration-policy-id>?force=true\n```\nThe deletion should succeed - previously it was failing with an error.\n\n### Checklist\n\n- [ ] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [ ] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [ ] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"14fdb329e952918bf7f6d2ead15fbcc235932851"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","9.2","8.19"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.2","label":"v9.2.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/237875","number":237875,"mergeCommit":{"message":"[Fleet] Fix error when deleting orphaned integration policies (#237875)\n\nFixes https://github.com/elastic/kibana/issues/237700\n\n## Summary\nAttempting to delete an orphaned integration policy fails with a\nmisleading error. This PR fixes this case and allows the user to force\ndelete orphaned integration policies from Fleet APIs\n\n\n### Repro steps\n- Have an agent policy with an installed integration policy. For\ninstance `system`\n- Get the ids of both the agent policy and the integration policy.\nManually delete the agent policy (it may require a `superuser` user):\n```\n DELETE .kibana_ingest/_doc/fleet-agent-policies:<agent-policy-id>\n```\n- At this point the integration policy should be \"orphaned\". Try to\nforce delete it with fleet APIs:\n```\nDELETE kbn:/api/fleet/package_policies/<integration-policy-id>?force=true\n```\nThe deletion should succeed - previously it was failing with an error.\n\n### Checklist\n\n- [ ] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [ ] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [ ] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"14fdb329e952918bf7f6d2ead15fbcc235932851"}},{"branch":"8.19","label":"v8.19.6","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Cristina Amico <criamico@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
|
Ty for the fix and all the backports! I think this could be backported to 8.18 too, I see we are planning another patch release there. Also I think you need a |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…c#237875) Fixes elastic#237700 ## Summary Attempting to delete an orphaned integration policy fails with a misleading error. This PR fixes this case and allows the user to force delete orphaned integration policies from Fleet APIs ### Repro steps - Have an agent policy with an installed integration policy. For instance `system` - Get the ids of both the agent policy and the integration policy. Manually delete the agent policy (it may require a `superuser` user): ``` DELETE .kibana_ingest/_doc/fleet-agent-policies:<agent-policy-id> ``` - At this point the integration policy should be "orphaned". Try to force delete it with fleet APIs: ``` DELETE kbn:/api/fleet/package_policies/<integration-policy-id>?force=true ``` The deletion should succeed - previously it was failing with an error. ### Checklist - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [ ] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit 14fdb32) # Conflicts: # x-pack/platform/plugins/shared/fleet/server/services/package_policy.test.ts # x-pack/platform/plugins/shared/fleet/server/services/package_policy.ts
…237875) (#238046) # Backport This will backport the following commits from `main` to `9.2`: - [[Fleet] Fix error when deleting orphaned integration policies (#237875)](#237875) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Cristina Amico","email":"criamico@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-10-08T13:21:22Z","message":"[Fleet] Fix error when deleting orphaned integration policies (#237875)\n\nFixes https://github.com/elastic/kibana/issues/237700\n\n## Summary\nAttempting to delete an orphaned integration policy fails with a\nmisleading error. This PR fixes this case and allows the user to force\ndelete orphaned integration policies from Fleet APIs\n\n\n### Repro steps\n- Have an agent policy with an installed integration policy. For\ninstance `system`\n- Get the ids of both the agent policy and the integration policy.\nManually delete the agent policy (it may require a `superuser` user):\n```\n DELETE .kibana_ingest/_doc/fleet-agent-policies:<agent-policy-id>\n```\n- At this point the integration policy should be \"orphaned\". Try to\nforce delete it with fleet APIs:\n```\nDELETE kbn:/api/fleet/package_policies/<integration-policy-id>?force=true\n```\nThe deletion should succeed - previously it was failing with an error.\n\n### Checklist\n\n- [ ] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [ ] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [ ] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"14fdb329e952918bf7f6d2ead15fbcc235932851","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Fleet","backport:version","v9.1.0","v9.2.0","v9.3.0","v8.19.6"],"title":"[Fleet] Fix error when deleting orphaned integration policies","number":237875,"url":"https://github.com/elastic/kibana/pull/237875","mergeCommit":{"message":"[Fleet] Fix error when deleting orphaned integration policies (#237875)\n\nFixes https://github.com/elastic/kibana/issues/237700\n\n## Summary\nAttempting to delete an orphaned integration policy fails with a\nmisleading error. This PR fixes this case and allows the user to force\ndelete orphaned integration policies from Fleet APIs\n\n\n### Repro steps\n- Have an agent policy with an installed integration policy. For\ninstance `system`\n- Get the ids of both the agent policy and the integration policy.\nManually delete the agent policy (it may require a `superuser` user):\n```\n DELETE .kibana_ingest/_doc/fleet-agent-policies:<agent-policy-id>\n```\n- At this point the integration policy should be \"orphaned\". Try to\nforce delete it with fleet APIs:\n```\nDELETE kbn:/api/fleet/package_policies/<integration-policy-id>?force=true\n```\nThe deletion should succeed - previously it was failing with an error.\n\n### Checklist\n\n- [ ] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [ ] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [ ] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"14fdb329e952918bf7f6d2ead15fbcc235932851"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","9.2","8.19"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.2","label":"v9.2.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/237875","number":237875,"mergeCommit":{"message":"[Fleet] Fix error when deleting orphaned integration policies (#237875)\n\nFixes https://github.com/elastic/kibana/issues/237700\n\n## Summary\nAttempting to delete an orphaned integration policy fails with a\nmisleading error. This PR fixes this case and allows the user to force\ndelete orphaned integration policies from Fleet APIs\n\n\n### Repro steps\n- Have an agent policy with an installed integration policy. For\ninstance `system`\n- Get the ids of both the agent policy and the integration policy.\nManually delete the agent policy (it may require a `superuser` user):\n```\n DELETE .kibana_ingest/_doc/fleet-agent-policies:<agent-policy-id>\n```\n- At this point the integration policy should be \"orphaned\". Try to\nforce delete it with fleet APIs:\n```\nDELETE kbn:/api/fleet/package_policies/<integration-policy-id>?force=true\n```\nThe deletion should succeed - previously it was failing with an error.\n\n### Checklist\n\n- [ ] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [ ] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [ ] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"14fdb329e952918bf7f6d2ead15fbcc235932851"}},{"branch":"8.19","label":"v8.19.6","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Cristina Amico <criamico@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
…237875) (#238077) # Backport This will backport the following commits from `main` to `8.19`: - [[Fleet] Fix error when deleting orphaned integration policies (#237875)](#237875) <!--- Backport version: 10.0.2 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Cristina Amico","email":"criamico@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-10-08T13:21:22Z","message":"[Fleet] Fix error when deleting orphaned integration policies (#237875)\n\nFixes https://github.com/elastic/kibana/issues/237700\n\n## Summary\nAttempting to delete an orphaned integration policy fails with a\nmisleading error. This PR fixes this case and allows the user to force\ndelete orphaned integration policies from Fleet APIs\n\n\n### Repro steps\n- Have an agent policy with an installed integration policy. For\ninstance `system`\n- Get the ids of both the agent policy and the integration policy.\nManually delete the agent policy (it may require a `superuser` user):\n```\n DELETE .kibana_ingest/_doc/fleet-agent-policies:<agent-policy-id>\n```\n- At this point the integration policy should be \"orphaned\". Try to\nforce delete it with fleet APIs:\n```\nDELETE kbn:/api/fleet/package_policies/<integration-policy-id>?force=true\n```\nThe deletion should succeed - previously it was failing with an error.\n\n### Checklist\n\n- [ ] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [ ] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [ ] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"14fdb329e952918bf7f6d2ead15fbcc235932851","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Fleet","backport:version","v9.1.0","v9.2.0","v9.3.0","v8.19.6"],"title":"[Fleet] Fix error when deleting orphaned integration policies","number":237875,"url":"https://github.com/elastic/kibana/pull/237875","mergeCommit":{"message":"[Fleet] Fix error when deleting orphaned integration policies (#237875)\n\nFixes https://github.com/elastic/kibana/issues/237700\n\n## Summary\nAttempting to delete an orphaned integration policy fails with a\nmisleading error. This PR fixes this case and allows the user to force\ndelete orphaned integration policies from Fleet APIs\n\n\n### Repro steps\n- Have an agent policy with an installed integration policy. For\ninstance `system`\n- Get the ids of both the agent policy and the integration policy.\nManually delete the agent policy (it may require a `superuser` user):\n```\n DELETE .kibana_ingest/_doc/fleet-agent-policies:<agent-policy-id>\n```\n- At this point the integration policy should be \"orphaned\". Try to\nforce delete it with fleet APIs:\n```\nDELETE kbn:/api/fleet/package_policies/<integration-policy-id>?force=true\n```\nThe deletion should succeed - previously it was failing with an error.\n\n### Checklist\n\n- [ ] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [ ] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [ ] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"14fdb329e952918bf7f6d2ead15fbcc235932851"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/238045","number":238045,"state":"OPEN"},{"branch":"9.2","label":"v9.2.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/238046","number":238046,"state":"OPEN"},{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/237875","number":237875,"mergeCommit":{"message":"[Fleet] Fix error when deleting orphaned integration policies (#237875)\n\nFixes https://github.com/elastic/kibana/issues/237700\n\n## Summary\nAttempting to delete an orphaned integration policy fails with a\nmisleading error. This PR fixes this case and allows the user to force\ndelete orphaned integration policies from Fleet APIs\n\n\n### Repro steps\n- Have an agent policy with an installed integration policy. For\ninstance `system`\n- Get the ids of both the agent policy and the integration policy.\nManually delete the agent policy (it may require a `superuser` user):\n```\n DELETE .kibana_ingest/_doc/fleet-agent-policies:<agent-policy-id>\n```\n- At this point the integration policy should be \"orphaned\". Try to\nforce delete it with fleet APIs:\n```\nDELETE kbn:/api/fleet/package_policies/<integration-policy-id>?force=true\n```\nThe deletion should succeed - previously it was failing with an error.\n\n### Checklist\n\n- [ ] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [ ] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [ ] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"14fdb329e952918bf7f6d2ead15fbcc235932851"}},{"branch":"8.19","label":"v8.19.6","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
|
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
1 similar comment
|
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
…237875) (#238192) # Backport This will backport the following commits from `main` to `8.18`: - [[Fleet] Fix error when deleting orphaned integration policies (#237875)](#237875) <!--- Backport version: 10.0.2 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Cristina Amico","email":"criamico@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-10-08T13:21:22Z","message":"[Fleet] Fix error when deleting orphaned integration policies (#237875)\n\nFixes https://github.com/elastic/kibana/issues/237700\n\n## Summary\nAttempting to delete an orphaned integration policy fails with a\nmisleading error. This PR fixes this case and allows the user to force\ndelete orphaned integration policies from Fleet APIs\n\n\n### Repro steps\n- Have an agent policy with an installed integration policy. For\ninstance `system`\n- Get the ids of both the agent policy and the integration policy.\nManually delete the agent policy (it may require a `superuser` user):\n```\n DELETE .kibana_ingest/_doc/fleet-agent-policies:<agent-policy-id>\n```\n- At this point the integration policy should be \"orphaned\". Try to\nforce delete it with fleet APIs:\n```\nDELETE kbn:/api/fleet/package_policies/<integration-policy-id>?force=true\n```\nThe deletion should succeed - previously it was failing with an error.\n\n### Checklist\n\n- [ ] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [ ] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [ ] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"14fdb329e952918bf7f6d2ead15fbcc235932851","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Fleet","backport:version","v9.2.0","v9.3.0","v9.1.6","v8.19.6"],"title":"[Fleet] Fix error when deleting orphaned integration policies","number":237875,"url":"https://github.com/elastic/kibana/pull/237875","mergeCommit":{"message":"[Fleet] Fix error when deleting orphaned integration policies (#237875)\n\nFixes https://github.com/elastic/kibana/issues/237700\n\n## Summary\nAttempting to delete an orphaned integration policy fails with a\nmisleading error. This PR fixes this case and allows the user to force\ndelete orphaned integration policies from Fleet APIs\n\n\n### Repro steps\n- Have an agent policy with an installed integration policy. For\ninstance `system`\n- Get the ids of both the agent policy and the integration policy.\nManually delete the agent policy (it may require a `superuser` user):\n```\n DELETE .kibana_ingest/_doc/fleet-agent-policies:<agent-policy-id>\n```\n- At this point the integration policy should be \"orphaned\". Try to\nforce delete it with fleet APIs:\n```\nDELETE kbn:/api/fleet/package_policies/<integration-policy-id>?force=true\n```\nThe deletion should succeed - previously it was failing with an error.\n\n### Checklist\n\n- [ ] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [ ] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [ ] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"14fdb329e952918bf7f6d2ead15fbcc235932851"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"9.2","label":"v9.2.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/238046","number":238046,"state":"OPEN"},{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/237875","number":237875,"mergeCommit":{"message":"[Fleet] Fix error when deleting orphaned integration policies (#237875)\n\nFixes https://github.com/elastic/kibana/issues/237700\n\n## Summary\nAttempting to delete an orphaned integration policy fails with a\nmisleading error. This PR fixes this case and allows the user to force\ndelete orphaned integration policies from Fleet APIs\n\n\n### Repro steps\n- Have an agent policy with an installed integration policy. For\ninstance `system`\n- Get the ids of both the agent policy and the integration policy.\nManually delete the agent policy (it may require a `superuser` user):\n```\n DELETE .kibana_ingest/_doc/fleet-agent-policies:<agent-policy-id>\n```\n- At this point the integration policy should be \"orphaned\". Try to\nforce delete it with fleet APIs:\n```\nDELETE kbn:/api/fleet/package_policies/<integration-policy-id>?force=true\n```\nThe deletion should succeed - previously it was failing with an error.\n\n### Checklist\n\n- [ ] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [ ] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [ ] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"14fdb329e952918bf7f6d2ead15fbcc235932851"}},{"branch":"9.1","label":"v9.1.6","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/238045","number":238045,"state":"MERGED","mergeCommit":{"sha":"90b6e320e21072a606649be2f0faf792489f1768","message":"[9.1] [Fleet] Fix error when deleting orphaned integration policies (#237875) (#238045)\n\n# Backport\n\nThis will backport the following commits from `main` to `9.1`:\n- [[Fleet] Fix error when deleting orphaned integration policies\n(#237875)](https://github.com/elastic/kibana/pull/237875)\n\n\n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by: Cristina Amico <criamico@users.noreply.github.com>\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>"}},{"branch":"8.19","label":"v8.19.6","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/238077","number":238077,"state":"OPEN"}]}] BACKPORT--> --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
…c#237875) Fixes elastic#237700 ## Summary Attempting to delete an orphaned integration policy fails with a misleading error. This PR fixes this case and allows the user to force delete orphaned integration policies from Fleet APIs ### Repro steps - Have an agent policy with an installed integration policy. For instance `system` - Get the ids of both the agent policy and the integration policy. Manually delete the agent policy (it may require a `superuser` user): ``` DELETE .kibana_ingest/_doc/fleet-agent-policies:<agent-policy-id> ``` - At this point the integration policy should be "orphaned". Try to force delete it with fleet APIs: ``` DELETE kbn:/api/fleet/package_policies/<integration-policy-id>?force=true ``` The deletion should succeed - previously it was failing with an error. ### Checklist - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [ ] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
…c#237875) Fixes elastic#237700 ## Summary Attempting to delete an orphaned integration policy fails with a misleading error. This PR fixes this case and allows the user to force delete orphaned integration policies from Fleet APIs ### Repro steps - Have an agent policy with an installed integration policy. For instance `system` - Get the ids of both the agent policy and the integration policy. Manually delete the agent policy (it may require a `superuser` user): ``` DELETE .kibana_ingest/_doc/fleet-agent-policies:<agent-policy-id> ``` - At this point the integration policy should be "orphaned". Try to force delete it with fleet APIs: ``` DELETE kbn:/api/fleet/package_policies/<integration-policy-id>?force=true ``` The deletion should succeed - previously it was failing with an error. ### Checklist - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [ ] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Fixes #237700
Summary
Attempting to delete an orphaned integration policy fails with a misleading error. This PR fixes this case and allows the user to force delete orphaned integration policies from Fleet APIs
Repro steps
systemsuperuseruser):The deletion should succeed - previously it was failing with an error.
Checklist
release_note:*label is applied per the guidelinesbackport:*labels.